Creating Ethereum Agreements (go ethereum)

Trying to follow the wiki example for go ethereum to create a basic contract: https://github.com/ethereum/go-ethereum/wiki/Contracts-and-Transactions

Everything seems to work until I go down to the last line:

source = "contract test { function multiply(uint a) returns(uint d) { return a * 7; } }"
contract = eth.compile.solidity(source).test
primaryAddress = eth.accounts[0]

# **Problems start here **
MyContract = eth.contract(abi);
contact = MyContract.new(arg1, arg2, ...,{from: primaryAddress, data: evmCode})

What is the "abi" argument for eth.contract method? Also, what would I put in the evmCode argument? In this particular example, it seems that I would add an integer for "arg1", but I'm not sure what the full example should look like.

+5
source share
3 answers

ABI is the interface that your contract provides. "evmCode" is the Ethereum byte code for your contract.

, https://chriseth.imtqy.com/browser-solidity/ Solidity. Bytecode "evmCode" Interface ABI.

" Web3" .

+10

ABI - , , . - https://remix.ethereum.org. "". , , ABI json

. , API contracts.Introduction.interface web3 abi.

+1

You can try using tools like Etherlime shape or Truffle boxes to get a whole example project with contract, tests and usage in js. From here you can start moving forward.

0
source

Source: https://habr.com/ru/post/1617526/


All Articles