Skip to content
New issue

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

chore: reorganize contracts folder #123

Merged
merged 20 commits into from
Oct 2, 2023
Merged

chore: reorganize contracts folder #123

merged 20 commits into from
Oct 2, 2023

Conversation

leovct
Copy link
Member

@leovct leovct commented Sep 21, 2023

Description

  • Update ERC20 and ERC721 contracts to make them compile with the latest solidity version 0.8.21.
  • Move ERC20 and ERC721 contracts to their own package called tokens (along with their ABI and bytecode).
  • Move LoadTestercontract, ABI and bytecode to its own folder.
  • Add documentation on how to generate go bindings for those contract.
  • Provide a Makefile and a handy command to automate the go binding generation called make gen-go-bindings.

Jira / Linear Tickets

x

Testing

  • Generate go bindings
$ make gen-go-bindings
solc contracts/tokens/ERC20/ERC20.sol --abi --bin --output-dir contracts/tokens/ERC20 --overwrite --evm-version paris
Compiler run successful. Artifact(s) can be found in directory "contracts/tokens/ERC20".
abigen --abi contracts/tokens/ERC20/ERC20.abi --bin contracts/tokens/ERC20/ERC20.bin --pkg tokens --type ERC20 --out contracts/tokens/ERC20.go
solc contracts/tokens/ERC721/ERC721.sol --abi --bin --output-dir contracts/tokens/ERC721 --overwrite --evm-version paris
Compiler run successful. Artifact(s) can be found in directory "contracts/tokens/ERC721".
abigen --abi contracts/tokens/ERC721/ERC721.abi --bin contracts/tokens/ERC721/ERC721.bin --pkg tokens --type ERC721 --out contracts/tokens/ERC721.go
solc contracts/loadtester/LoadTester.sol --abi --bin --output-dir contracts/loadtester --overwrite --evm-version paris
Compiler run successful. Artifact(s) can be found in directory "contracts/loadtester".
abigen --abi contracts/loadtester/LoadTester.abi --bin contracts/loadtester/LoadTester.bin --pkg contracts --type LoadTester --out contracts/LoadTester.go
  • ERC20 transfers load test
$ go run main.go loadtest --mode 2 --requests 100 --verbosity 700  http://localhost:8545
...
11:42AM INF rough test summary (ignores errors) final rate limit=4 firstBlockTime=2023-09-21T11:41:47+02:00 lastBlockTime=2023-09-21T11:42:17+02:00 testDuration=30 tps=3.3333333333333335 transactionCount=100
11:42AM INF * Results
11:42AM INF Samples samples=100
11:42AM INF Start startTime=2023-09-21T11:41:48+02:00
11:42AM INF End endTime=2023-09-21T11:42:12+02:00
11:42AM INF Mean Wait meanWait=0.0063669408099999965
11:42AM INF Num errors numErrors=0
11:42AM INF Finished
  • ERC721 mints load test
$ go run main.go loadtest --mode 7 --requests 100 --verbosity 700  http://localhost:8545
...
11:41AM INF rough test summary (ignores errors) final rate limit=4 firstBlockTime=2023-09-21T11:40:53+02:00 lastBlockTime=2023-09-21T11:41:21+02:00 testDuration=28 tps=3.5714285714285716 transactionCount=100
11:41AM INF * Results
11:41AM INF Samples samples=100
11:41AM INF Start startTime=2023-09-21T11:40:53+02:00
11:41AM INF End endTime=2023-09-21T11:41:18+02:00
11:41AM INF Mean Wait meanWait=0.009857554539999999
11:41AM INF Num errors numErrors=0
11:41AM INF Finished
  • Random opcode calls load test
$ go run main.go loadtest --mode c --requests 100 --verbosity 700  http://localhost:8545
...
11:43AM INF rough test summary (ignores errors) final rate limit=4 firstBlockTime=2023-09-21T11:43:13+02:00 lastBlockTime=2023-09-21T11:43:41+02:00 testDuration=28 tps=3.5714285714285716 transactionCount=100
11:43AM INF * Results
11:43AM INF Samples samples=100
11:43AM INF Start startTime=2023-09-21T11:43:13+02:00
11:43AM INF End endTime=2023-09-21T11:43:38+02:00
11:43AM INF Mean Wait meanWait=0.007924913380000002
11:43AM INF Num errors numErrors=0
11:43AM INF Finished

@leovct
Copy link
Member Author

leovct commented Sep 22, 2023

Pipeline fails because of the issue mentioned in #125

@leovct leovct merged commit 65b8e00 into main Oct 2, 2023
5 checks passed
@leovct leovct deleted the leovct/refactor-contracts branch October 2, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants