Replies: 7 comments 3 replies
-
|
https://eth.build/build#a4e9f4195c3cecdcf2e35d87ff10ad75a883c6e94d1da657f0f88e9285ef5092 |
Beta Was this translation helpful? Give feedback.
-
|
https://sandbox.eth.build/build#9c3c19c01a30e0360023ddb02d860571cdce450671b5ed0171e8ad1a9afe3ced |
Beta Was this translation helpful? Give feedback.
-
|
1.1 新建智能合约 contract HelloWorld { 这里应该是少了个s |
Beta Was this translation helpful? Give feedback.
-
|
https://eth.build/build#af21b53b906d5919695bd28264ccf2d88133c4b4fb0af4f74dfb839375e82c5c |
Beta Was this translation helpful? Give feedback.
-
|
完成 https://eth.build/build#4fdc377ef370249148f573d0f7d10b316252acd8b9b639f4c37c8804a4228ae2 |
Beta Was this translation helpful? Give feedback.
-
|
https://eth.build/build#0c5bd5b982b27257e606d45700a52673228f8face9888c8353a1de94c307a6f4 |
Beta Was this translation helpful? Give feedback.
-
|
https://eth.build/build#2ebf77df7b27bcddeadfdb6a7c36d140c5594e69da0a2ef9a9365a6a2a81a90c |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
在上一个例子里,我们使用
eth.build学习了如何发送 ETH,同时借助辅助资料了解到 ETH 中的基础 —— Transaction。在今天的 Project 0x02 中,我们来实践如何通过
eth.build来进行智能合约的调取!0x01 智能合约的部署
Remix 是和 Eth.build 并行的代码沙盒工具,Eth.build 主要职能是帮助我们通过无代码的形式理解以太坊的原理,Remix 则可以让我们编写与调用智能合约!
1.1 新建智能合约
打开
Remix,新建智能合约:1.2 部署智能合约
切换到
Deploy标签,选择Injected Web3环境,连接 Metamask(注意 Metamask选择 Ropsten 测试网络)。如果没有
Ropsten的测试币,通过下述水龙头地址拿币:部署合约后拿到合约地址:
这是一个已经在
Ropsten上部署好的合约地址:0x02 通过 eth.build 调用智能合约
这是写好的一个例子:
这里我们可以填写我们在0x01中部署好的智能合约。
要注意 Chain 中的网络要和我们所部署的智能合约网络一致,此处都是 Ropsten 网络即可。
Abi通过Compile组件(
web3->compile)生成。compile使用 0x01 中部署的智能合约及合约名字作为输入。
使用compile输出的abi作为contract的abi输入,此时我们可以通过test()方法获取智能合约中变量的值。
0x03 补充资料
本 Projects 的资料主要是智能合约相关:
0x04 挑战
试试其他智能合约吧?可以从网络上找找有什么可以玩的简单合约!
Beta Was this translation helpful? Give feedback.
All reactions