diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..cb006f2e --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @ermyas @wcgcyx @Benjimmutable \ No newline at end of file diff --git a/README.md b/README.md index c650a66d..3bf1a1d1 100644 --- a/README.md +++ b/README.md @@ -83,18 +83,12 @@ $ forge build ``` ### Testing -To run all tests (unit, integration, and fork tests), run the following command: +To run unit, integration and fuzz tests execute the following command: ```shell -$ forge test +$ forge test --no-match-path "test/{fork,invariant}/**" ``` -This requires setting the relevant environment variables as described in the "Fork Test" section below. -**Unit and Integration Tests Only** -```shell -$ forge test --no-match-path "test/fork/**" -``` - -**Fork Tests Only** +**Fork Tests** The fork tests run a suite of tests against one or more deployments of the bridge. To run these tests copy [`.env.example`](.env.example) file to a `.env` file and set the `MAINNET_RPC_URL` and `TESTNET_RPC_URL` environment variables. Set or update any other environment variables as required. diff --git a/deployments/mainnet/.env.mainnet b/deployments/mainnet/.env.mainnet index bd9f9a1c..133e62b9 100644 --- a/deployments/mainnet/.env.mainnet +++ b/deployments/mainnet/.env.mainnet @@ -69,11 +69,11 @@ RATE_LIMIT_ETH_LARGE_THRESHOLD=5.04 ## https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 ## The address of USDC token to set rate limit policy. RATE_LIMIT_USDC_ADDR=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 -## The capacity of the rate limit policy of USDC token, unit is in 10^18. +## The capacity of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_CAPACITY=20016 -## The refill rate of the rate limit policy of USDC token, unit is in 10^18. +## The refill rate of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_REFILL_RATE=5.56 -## The large threshold of the rate limit policy of USDC token, unit is in 10^18. +## The large threshold of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_LARGE_THRESHOLD=10008 # Set prior to 2_deployment_validation.js diff --git a/deployments/testnet/.env.testnet b/deployments/testnet/.env.testnet index 78821b5c..aedf825d 100644 --- a/deployments/testnet/.env.testnet +++ b/deployments/testnet/.env.testnet @@ -65,11 +65,11 @@ RATE_LIMIT_ETH_REFILL_RATE=0.0028 RATE_LIMIT_ETH_LARGE_THRESHOLD=5.04 ## The address of USDC token to set rate limit policy. RATE_LIMIT_USDC_ADDR=0xca6c31cc71fb8f00dc2c465299f605039e0e1f4b -## The capacity of the rate limit policy of USDC token, unit is in 10^18. +## The capacity of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_CAPACITY=20016 -## The refill rate of the rate limit policy of USDC token, unit is in 10^18. +## The refill rate of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_REFILL_RATE=5.56 -## The large threshold of the rate limit policy of USDC token, unit is in 10^18. +## The large threshold of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_LARGE_THRESHOLD=10008 ## The address of GU token to set rate limit policy. RATE_LIMIT_GU_ADDR=0x5c9f1680bb6a4b4fc698e0cf702e0cc34aed91b7 diff --git a/foundry.toml b/foundry.toml index ed9b61af..6c372780 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,5 +3,6 @@ src = "src" out = "out" libs = ["lib"] solc-version = "0.8.19" - +# Reason for why this flag is required can be found here: https://github.com/foundry-rs/foundry/issues/7607 +unchecked_cheatcode_artifacts = true # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/scripts/bootstrap/.env.example b/scripts/bootstrap/.env.example index a8ed55a2..db50e489 100644 --- a/scripts/bootstrap/.env.example +++ b/scripts/bootstrap/.env.example @@ -65,11 +65,11 @@ RATE_LIMIT_ETH_REFILL_RATE= RATE_LIMIT_ETH_LARGE_THRESHOLD= ## The address of USDC token to set rate limit policy. RATE_LIMIT_USDC_ADDR= -## The capacity of the rate limit policy of USDC token, unit is in 10^18. +## The capacity of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_CAPACITY= -## The refill rate of the rate limit policy of USDC token, unit is in 10^18. +## The refill rate of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_REFILL_RATE= -## The large threshold of the rate limit policy of USDC token, unit is in 10^18. +## The large threshold of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_LARGE_THRESHOLD= ## The address of GU token to set rate limit policy. RATE_LIMIT_GU_ADDR= diff --git a/scripts/bootstrap/README.md b/scripts/bootstrap/README.md index e510bb20..34407de3 100644 --- a/scripts/bootstrap/README.md +++ b/scripts/bootstrap/README.md @@ -89,11 +89,11 @@ RATE_LIMIT_ETH_REFILL_RATE= RATE_LIMIT_ETH_LARGE_THRESHOLD= ## The address of USDC token to set rate limit policy. RATE_LIMIT_USDC_ADDR= -## The capacity of the rate limit policy of USDC token, unit is in 10^18. +## The capacity of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_CAPACITY= -## The refill rate of the rate limit policy of USDC token, unit is in 10^18. +## The refill rate of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_REFILL_RATE= -## The large threshold of the rate limit policy of USDC token, unit is in 10^18. +## The large threshold of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_LARGE_THRESHOLD= ## The address of GU token to set rate limit policy. RATE_LIMIT_GU_ADDR= diff --git a/scripts/deploy/.env.example b/scripts/deploy/.env.example index 3e5f83a2..503bc27a 100644 --- a/scripts/deploy/.env.example +++ b/scripts/deploy/.env.example @@ -64,11 +64,11 @@ RATE_LIMIT_ETH_REFILL_RATE= RATE_LIMIT_ETH_LARGE_THRESHOLD= ## The address of USDC token to set rate limit policy. RATE_LIMIT_USDC_ADDR= -## The capacity of the rate limit policy of USDC token, unit is in 10^18. +## The capacity of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_CAPACITY= -## The refill rate of the rate limit policy of USDC token, unit is in 10^18. +## The refill rate of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_REFILL_RATE= -## The large threshold of the rate limit policy of USDC token, unit is in 10^18. +## The large threshold of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_LARGE_THRESHOLD= ## The address of GU token to set rate limit policy. RATE_LIMIT_GU_ADDR= diff --git a/scripts/deploy/README.md b/scripts/deploy/README.md index 6884186f..f579c10d 100644 --- a/scripts/deploy/README.md +++ b/scripts/deploy/README.md @@ -78,11 +78,11 @@ RATE_LIMIT_ETH_REFILL_RATE= RATE_LIMIT_ETH_LARGE_THRESHOLD= ## The address of USDC token to set rate limit policy. RATE_LIMIT_USDC_ADDR= -## The capacity of the rate limit policy of USDC token, unit is in 10^18. +## The capacity of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_CAPACITY= -## The refill rate of the rate limit policy of USDC token, unit is in 10^18. +## The refill rate of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_REFILL_RATE= -## The large threshold of the rate limit policy of USDC token, unit is in 10^18. +## The large threshold of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_LARGE_THRESHOLD= ## The address of GU token to set rate limit policy. RATE_LIMIT_GU_ADDR= diff --git a/scripts/localdev/.env.local b/scripts/localdev/.env.local index da8b99ad..2a3feb2a 100644 --- a/scripts/localdev/.env.local +++ b/scripts/localdev/.env.local @@ -65,11 +65,11 @@ RATE_LIMIT_ETH_REFILL_RATE=0.0028 RATE_LIMIT_ETH_LARGE_THRESHOLD=5.04 ## The address of USDC token to set rate limit policy. RATE_LIMIT_USDC_ADDR=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 -## The capacity of the rate limit policy of USDC token, unit is in 10^18. +## The capacity of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_CAPACITY=20016 -## The refill rate of the rate limit policy of USDC token, unit is in 10^18. +## The refill rate of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_REFILL_RATE=5.56 -## The large threshold of the rate limit policy of USDC token, unit is in 10^18. +## The large threshold of the rate limit policy of USDC token, unit is in 10^6. RATE_LIMIT_USDC_LARGE_THRESHOLD=10008 ## The address of GU token to set rate limit policy. RATE_LIMIT_GU_ADDR=0xccC8cb5229B0ac8069C51fd58367Fd1e622aFD97