Skip to content

Commit 4633ab0

Browse files
committed
feat(add remix introduction): add remix introduction
add remix introduction
1 parent dc5f406 commit 4633ab0

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed

README.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,52 @@ func Transfer(client *ethclient.Client, sender common.Address,
191191
fmt.Printf("tx send: %s\n", signedTx.Hash().Hex())
192192
return nil
193193
}
194-
```
194+
```
195+
196+
## use remix.ethereum.org as IDE
197+
198+
https://remix.ethereum.org/#lang=en&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.26+commit.8a97fa7a.js
199+
200+
create solidity
201+
202+
```solidity
203+
pragma solidity >=0.8.2 <0.9.0;
204+
205+
contract Todo {
206+
Task[] tasks;
207+
struct Task {
208+
string content;
209+
bool status;
210+
}
211+
constructor() {
212+
213+
}
214+
function add(string memory _content) public {
215+
tasks.push(Task(_content, false));
216+
}
217+
function get(uint _id) public view returns (Task memory) {
218+
return tasks[_id];
219+
}
220+
function list() public view returns (Task[] memory) {
221+
return tasks;
222+
}
223+
function update(uint _id, string memory _content) public {
224+
tasks[_id].content = _content;
225+
}
226+
function remove(uint _id) public {
227+
delete tasks[_id];
228+
}
229+
}
230+
```
231+
232+
test with remix vm
233+
234+
![deploy-contract-to-vm](./deploy-contract-to-vm.png)
235+
236+
## interact contract with public function
237+
238+
![interact-with-public-function](./interact-with-public-function.png)
239+
240+
## check execution log of vm on console
241+
242+
![execution-console-log](./execution-console-log.png)

deploy-contract-to-vm.png

38.2 KB
Loading

execution-console-log.png

56.1 KB
Loading

interact-with-public-function.png

27.3 KB
Loading

0 commit comments

Comments
 (0)