Giter Club home page Giter Club logo

web3swift's Issues

Missing defensive decorators for checking signed transaction

See EthereumTransaction in bankex web3 for reference

let originalPublicKey = SECP256K1.privateToPublic(privateKey: privateKey)
        let recoveredPublicKey = self.recoverPublicKey()
        if (originalPublicKey != recoveredPublicKey) {
            return false
        }

Bad design - BlockChainState

BlockChainState is a DTO

We should probably develop 3 decorators for remote procedures instead of having 3 implementations of BlockChainState.

Missing folder structure verification

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

Missing documentation

We need to decide upon the documentation format, find the tool to automate documentation and document the existing instances.

Transaction signing and sending

https://github.com/ethereum/wiki/wiki/RLP

Transaction creation flow:

  1. We need to get transaction request hash from its encoded form by encoding its:
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)

  1. We use transaction hash in
SECP256K1.signForRecovery(hash: hash, privateKey: privateKey)

we receive a compressed version of signature from transaction hash (an array of bytes).
See #10 for reference

  1. We need to create r and s from compressed signature
SECP256K1.unmarshalSignature(signatureData: compressedSignature)
  1. Now we need to create v from last byte of compressed signature + BigInt(35)(how does that convert to Array?) + chainId + chainId

  2. 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

  1. How we convert RLPed transaction request to hex and it to node then node return transaction id (hash)

Prohibit empty lines in method bodies

I suggest that we abstain from having empty lines in method bodies. We should enforce this rule through SwiftLint.

Info about why we should do this.

We could utilize this to create this rule.

1. Missing sending value to Account

Relates to #1 and #13
Implement transaction sending logic from Account (private key) to any address.
Implement different strategies for transaction parameters settlement.

Missing MainnetInfuraNetwork

Use SimpleNetwork object as an implementation of Network protocol in MainnetInfuraNetwork. Create SimpleNetwork inside MainnetInfuraNetwork instead of passing it as a dependency.

Missing Ethereum object

I think we are missing a domain level Ethereum interface. A service I am seeking from Ethereum is getting a GasPrice object.

2. Implement Account -> Address ERC20 tokens sending

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

FakeEthereumNetwork is not actually a fake

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.