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: transform contracts repository into forge repository and fix the ERC20 bytecode deployment issue #162

Merged
merged 21 commits into from
Nov 20, 2023

Conversation

leovct
Copy link
Member

@leovct leovct commented Nov 20, 2023

Description

Fix

  • Generate a new version of the ERC20 bytecode. It was always reverting during the deployment.

Chore

  • The contracts/ folder is now a foundry project which makes it easier to handle dependencies.
  • ERC20.sol and ERC721.sol have been rewritten to use openzeppelin standards.
  • Move tester contracts (LoadTester.sol and ConformanceTester), as well as go files used to test precompiles and other stuff, to the tester package.
  • Add new CI job to make sure abi, bytecode and go binding files are up to date (it'll also test if the contracts can be built using forge)

Jira / Linear Tickets

  • DVT-1075 fix: ERC20 bytecode deployment
  • DVT-1117 chore: transform the contracts repository into a forge repository

Testing

  • Deploy ERC20 smart contract from bytecode.
# previously
$ cast send \
    --from 0x85dA99c8a7C2C95964c8EfD687E95E632Fc533D6 \
    --private-key 0x42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa \
    --rpc-url localhost:8545 \
    --json \
    --create \
    "$(cat ./contracts/tokens/ERC20/ERC20.bin)" | jq
Error: 
(code: -32000, message: execution reverted, data: None)

# now
$ cast send \
    --from 0x85dA99c8a7C2C95964c8EfD687E95E632Fc533D6 \
    --private-key 0x42b6e34dc21598a807dc19d7784c71b2a7a01f6480dc6f58258f78e539f1a1fa \
    --rpc-url localhost:8545 \
    --json \
    --create \
    "$(cat ./contracts/src/tokens/ERC20.bin)" | jq
✅
  • go run main.go loadtest --mode erc20 --verbosity 600 --requests 100 --rate-limit 100
  • go run main.go loadtest --mode erc721 --verbosity 600 --requests 100 --rate-limit 100
  • go run main.go loadtest uniswapv3 --verbosity 600 --requests 100 --rate-limit 100
  • go run main.go rpcfuzz --verbosity 600
  • go run main.go loadtest --mode random --verbosity 600 --requests 100 --rate-limit 100

@leovct leovct mentioned this pull request Nov 20, 2023
5 tasks
@leovct leovct changed the title feat: transform the contracts repository into a forge repository chore: transform the contracts repository into a forge repository Nov 20, 2023
@leovct leovct changed the title chore: transform the contracts repository into a forge repository chore: transform the contracts repository into a forge repository and fix the ERC20 bytecode Nov 20, 2023
Copy link
Member

@praetoriansentry praetoriansentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely seems a little odd to see src in a package name, but I think overall this is fine.

@leovct leovct changed the title chore: transform the contracts repository into a forge repository and fix the ERC20 bytecode chore: transform contracts repository into forge repository and fix the ERC20 bytecode deployment issue Nov 20, 2023
@leovct leovct merged commit 96089ed into main Nov 20, 2023
7 checks passed
@leovct leovct deleted the feat/forge-repository branch November 20, 2023 16:08
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