zeriontech / web3swift Goto Github PK
View Code? Open in Web Editor NEWEthereum Web3 library implementation for Swift
Home Page: https://web3swift.io
License: Apache License 2.0
Ethereum Web3 library implementation for Swift
Home Page: https://web3swift.io
License: Apache License 2.0
We should rename it to toUnprefixedString()
and adjust the other to toPrefixedString()
We will have to deal with big numbers (256-bit integers).
For example, in issue #55 we will already have an overflow with this address 0xfbb1b73c4f0bda4f67dca266ce6ef42f520fbb98
The quickest way will be using this library
See EthereumTransaction
in bankex web3 for reference
let originalPublicKey = SECP256K1.privateToPublic(privateKey: privateKey)
let recoveredPublicKey = self.recoverPublicKey()
if (originalPublicKey != recoveredPublicKey) {
return false
}
BlockChainState
is a DTO
We should probably develop 3 decorators for remote procedures instead of having 3 implementations of BlockChainState
.
This is a very serious issue
eth_getBalance
needs to be implemented
I believe that should document all classes, methods and properties. We should enforce this rule through SwiftLint, or if this not possible, through PR code reviews.
There are some issues with IDEs that cause duplication of folders and files which already leads to #62
Lets create a simple script that will verify that the root directory only contains two directories: Web3Swift and Example
They should belong to Web3Swift-Example
target and should be located in the corresponding folders in Example/
folder
Implement KeyStore object and encryption-decryption for it (all keystore versions)
Implement HD Wallet object and encryption-decryption for it (password based and not password based)
Implement Wallet object for storing all accounts in application memory
Hex string ctor for Data is ambiguous when character count is odd
We need to implement inheritance prohibiting rules:
As per #63 (comment)
Let's adjust swift lint config, so that we could use this naming signature
private let USER_ID: SomeType = 1
Currently, swift lint raises an error for such naming.
Testing with XCTest becomes impossibly difficult given most of our methods throw and cascade errors.
We need to decide upon the documentation format, find the tool to automate documentation and document the existing instances.
We need to implement proper tests as in EIP 155
We should also take data for testing from MyEtherWallet. Beware that parameters that are displayed on MyEtherWallet might not be correct.
https://github.com/ethereum/wiki/wiki/RLP
Transaction creation flow:
RLP.encode this [self.nonce, self.gasPrice, self.gasLimit, self.to.addressData, self.value, self.data, self.chainID!, BigUInt(0), BigUInt(0)]
and receive hash (an array of bytes)
SECP256K1.signForRecovery(hash: hash, privateKey: privateKey)
we receive a compressed version of signature from transaction hash (an array of bytes).
See #10 for reference
SECP256K1.unmarshalSignature(signatureData: compressedSignature)
Now we need to create v from last byte of compressed signature + BigInt(35)(how does that convert to Array?) + chainId + chainId
At this point we have
[self.nonce, self.gasPrice, self.gasLimit, self.to.addressData, self.value, self.data, self.v, self.r, self.s]
and we use this to get RLP for signed transaction request
These are actually integration tests between SECP256k1Signature
and SimpleRLP
but I think we can put them into RLPTests
for now.
eth_syncing
procedure needs to be implemented.
For the purpose of signing a transaction, ecdsa should not use nonce and nonce function
If JSON-RPC returns an error in JSON than network layer should throw an error with description
Account
represents public and private key for Ethereum network. Web3.eth.accounts
should have Account
related methods and AccountCollection
called Wallet
.
https://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#
http://web3py.readthedocs.io/en/stable/web3.eth.html?highlight=sign#web3.eth.Eth.sendRawTransaction
This is the same issue as described in #26
Use SimpleNetwork
object as an implementation of Network
protocol in MainnetInfuraNetwork
. Create SimpleNetwork
inside MainnetInfuraNetwork
instead of passing it as a dependency.
As per #61 (comment)
Let's create a new for swift lint that would allow us to prohibit the usage of test method without :description
.
I think we are missing a domain level Ethereum
interface. A service I am seeking from Ethereum
is getting a GasPrice
object.
I believe that we should restrict the test methods to use this method only:
XCTAssert(5 > 6, "Expected true, but false received.");
Relates to #24
Implement logic for transaction with сustom data
Implement transaction data builder for different parameter types
Implement string ABI function checking
Implement contract calling function and response deserialization
Implement contract deployment transaction
Implement contract deployment with non empty constructor
We should have a linter rule to prevent creating objects that end with ER
. This will encourage contributors to think OODD.
We need to clarify and document somewhere the framework for how we expect tests to be written.
FakeEthereumNetwork
is actually a mainnet. We should either make it actually fake (it shouldn't communicate to any ethereum network) or rename it to KovanEthereumNetwork
and make it point to the kovan testnet.
InvalidTypeError
should tell which type was expected and which was retrieved from JSON
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.