-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
117 changed files
with
2,676 additions
and
2,416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[submodule "contracts/lib/forge-std"] | ||
path = contracts/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
|
||
[submodule "contracts/lib/openzeppelin-contracts"] | ||
path = contracts/lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/**/dry-run/ | ||
|
||
# Docs | ||
docs/ | ||
|
||
# Dotenv file | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Contracts | ||
|
||
Smart contracts used to perform different types of tests: | ||
|
||
- `LoadTester` to call various opcodes, precompiles, and store random data. | ||
- `Tokens` to perform ERC20 transfers or ERC721 mints for example. | ||
- `UniswapV3` to deploy the full UniswapV3 contract suite and perform some swaps. | ||
- Other: `asm` and `yul`, contracts written in other languages than Solidity. | ||
|
||
## LoadTester | ||
|
||
Generate go bindings for the `LoadTester` contract. | ||
|
||
```sh | ||
$ FOUNDRY_PROFILE=lite forge build --contracts ./src/loadtester/LoadTester.sol \ | ||
&& cat ./out/LoadTester.sol/LoadTester.json| jq -r '.abi' > ./src/loadtester/LoadTester.abi \ | ||
&& cat ./out/LoadTester.sol/LoadTester.json| jq -r '.bytecode.object' > ./src/loadtester/LoadTester.bin \ | ||
&& abigen \ | ||
--abi ./src/loadtester/LoadTester.abi \ | ||
--bin ./src/loadtester/LoadTester.bin \ | ||
--pkg loadtester \ | ||
--type loadTester \ | ||
--out ./src/loadtester/loadTester.go | ||
``` | ||
|
||
## Tokens | ||
|
||
Generate go bindings for the `ERC20` contract. | ||
|
||
```sh | ||
$ forge build --contracts ./src/tokens/ERC20.sol \ | ||
&& cat ./out/ERC20.sol/ERC20.json| jq -r '.abi' > ./src/tokens/ERC20.abi \ | ||
&& cat ./out/ERC20.sol/ERC20.json| jq -r '.bytecode.object' > ./src/tokens/ERC20.bin \ | ||
&& abigen \ | ||
--abi ./src/tokens/ERC20.abi \ | ||
--bin ./src/tokens/ERC20.bin \ | ||
--pkg tokens \ | ||
--type ERC20 \ | ||
--out ./src/tokens/ERC20.go | ||
``` | ||
|
||
Generate go bindings for the `ERC721` contract. | ||
|
||
```sh | ||
$ forge build --contracts ./src/tokens/ERC721.sol \ | ||
&& cat ./out/ERC721.sol/ERC721.json| jq -r '.abi' > ./src/tokens/ERC721.abi \ | ||
&& cat ./out/ERC721.sol/ERC721.json| jq -r '.bytecode.object' > ./src/tokens/ERC721.bin \ | ||
&& abigen \ | ||
--abi ./src/tokens/ERC721.abi \ | ||
--bin ./src/tokens/ERC721.bin \ | ||
--pkg tokens \ | ||
--type ERC721 \ | ||
--out ./src/tokens/ERC721.go | ||
``` | ||
|
||
## UniswapV3 | ||
|
||
The UniswapV3 go bindings have been generated in a certain way. Check `uniswapv3/README.org` for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[profile.default] | ||
src = "src" | ||
out = "out" | ||
libs = ["lib"] | ||
remappings = [ | ||
'@openzeppelin/=lib/openzeppelin-contracts/contracts', | ||
] | ||
|
||
# Lite profile with Yul optimizer disabled. | ||
[profile.lite.optimizer_details] | ||
yul = false | ||
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options |
Submodule openzeppelin-contracts
added at
932fdd
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.