We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there! Great library, love it.
Feature request: I want to be able to deploy contracts from Swift code. PR #196.
Something like:
struct BokkyTokenConstructor: ABIConstructor { static let bytecode: Data = {bytecodeHex}.web3.hexData! let gasPrice: BigUInt? = nil let gasLimit: BigUInt? = 4712388 let contract: EthereumAddress = EthereumAddress("0x") let from: EthereumAddress? let name: String let symbol: String let decimals: UInt8 init( name: String, symbol: String, decimals: UInt8, from: EthereumAddress? = nil ) { self.name = name self.symbol = symbol self.decimals = decimals self.from = from } func encode(to encoder: ABIConstructorEncoder) throws { try encoder.encode(name) try encoder.encode(symbol) try encoder.encode(decimals) } }
And finally:
let transaction = BokkyTokenConstructor(name: "BokkyPooBah Test Token", symbol: "BOKKY", decimals: UInt8(18)) let txHash = try await transaction.execute(withClient: client, account: account) print(EthereumAddress(txHash))
where {bytecodeHex} is contract bytecode.
This code should deploy new Bokky Token contract.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi there! Great library, love it.
Feature request: I want to be able to deploy contracts from Swift code. PR #196.
Something like:
And finally:
where {bytecodeHex} is contract bytecode.
This code should deploy new Bokky Token contract.
The text was updated successfully, but these errors were encountered: