Skip to content

Commit

Permalink
πŸ‘·πŸ»β€β™‚οΈ SMv3 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredBorders authored Feb 28, 2024
2 parents 0be4e7e + 3a8dd83 commit fca8f07
Show file tree
Hide file tree
Showing 17 changed files with 228 additions and 1,080 deletions.
8 changes: 4 additions & 4 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
MAINNET_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/KEY
OPTIMISM_RPC_URL=https://opt-mainnet.g.alchemy.com/v2/KEY
BASE_RPC_URL=https://base-mainnet.g.alchemy.com/v2/KEY
GOERLI_RPC_URL=https://eth-goerli.g.alchemy.com/v2/KEY
OPTIMISM_GOERLI_RPC_URL=https://opt-goerli.g.alchemy.com/v2/KEY
BASE_GOERLI_RPC_URL=https://base-goerli.g.alchemy.com/v2/KEY
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/v2/KEY
OPTIMISM_SEPOLIA_RPC_URL=https://opt-sepolia.g.alchemy.com/v2/KEY
BASE_SEPOLIA_RPC_URL=https://base-sepolia.g.alchemy.com/v2/KEY
PRIVATE_KEY=KEY
ETHERSCAN_API_KEY=KEY
OPTIMISM_ETHERSCAN_API_KEY=KEY
BASESCAN_API_KEY=KEY
BASESCAN_API_KEY=KEY
21 changes: 10 additions & 11 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
ValidateSessionParams:test_validateSessionParams() (gas: 29469)
ValidateSessionParams:test_validateSessionParams() (gas: 79125)
ValidateSessionParams:test_validateSessionParams_callValue_invalid(uint256) (runs: 256, ΞΌ: 109712, ~: 109712)
ValidateSessionParams:test_validateSessionParams() (gas: 31677)
ValidateSessionParams:test_validateSessionParams_destinationContract_invalid(address) (runs: 256, ΞΌ: 30633, ~: 30633)
ValidateSessionParams:test_validateSessionParams_destinationContract_invalid(address) (runs: 256, ΞΌ: 30641, ~: 30641)
ValidateSessionParams:test_validateSessionParams_destinationContract_invalid(address) (runs: 256, ΞΌ: 32812, ~: 32812)
ValidateSessionParams:test_validateSessionParams_funcCallData_invalid() (gas: 24048)
ValidateSessionParams:test_validateSessionParams_funcCallData_invalid() (gas: 37720)
ValidateSessionParams:test_validateSessionParams_funcCallData_invalid() (gas: 37716)
ValidateSessionParams:test_validateSessionParams_sessionKeyData_invalid(address,address) (runs: 256, ΞΌ: 31495, ~: 31495)
ValidateSessionParams:test_validateSessionParams_sessionKeyData_invalid(address,address) (runs: 256, ΞΌ: 31733, ~: 31733)
ValidateSessionUserOp:test_validateSessionUserOp() (gas: 311526)
ValidateSessionParams:test_validateSessionParams_sessionKeyData_invalid(address,address) (runs: 256, ΞΌ: 33879, ~: 33879)
ValidateSessionUserOp:test_validateSessionUserOp() (gas: 114403)
ValidateSessionUserOp:test_validateSessionUserOp() (gas: 71771)
ValidateSessionUserOp:test_validateSessionUserOp_op_callData_invalid(address) (runs: 256, ΞΌ: 114525, ~: 114525)
ValidateSessionUserOp:test_validateSessionUserOp_op_callData_invalid(address,uint256) (runs: 256, ΞΌ: 283271, ~: 284818)
ValidateSessionUserOp:test_validateSessionUserOp_sessionKeyData_invalid(address,address) (runs: 256, ΞΌ: 93040, ~: 93040)
ValidateSessionUserOp:test_validateSessionUserOp_sessionKeyData_invalid(address,address) (runs: 256, ΞΌ: 95241, ~: 95316)
ValidateSessionUserOp:test_validateSessionUserOp_op_callData_invalid(address,uint256) (runs: 256, ΞΌ: 121043, ~: 121043)
ValidateSessionUserOp:test_validateSessionUserOp_sessionKeyData_invalid(address,address) (runs: 256, ΞΌ: 93002, ~: 93040)
ValidateSessionUserOp:test_validateSessionUserOp_sessionKeyData_invalid(address,address) (runs: 256, ΞΌ: 97379, ~: 97436)
ValidateSessionUserOp:test_validateSessionUserOp_sessionKeySignature_invalid(uint256) (runs: 256, ΞΌ: 82818, ~: 82818)
ValidateSessionUserOp:test_validateSessionUserOp_sessionKeySignature_invalid(uint256) (runs: 256, ΞΌ: 83146, ~: 83146)
ValidateSessionUserOp:test_validateSessionUserOp_sessionKeySignature_invalid(uint256) (runs: 256, ΞΌ: 85220, ~: 85220)
ValidateSessionUserOp:test_validateSessionUserOp_userOpHash_invalid(bytes32) (runs: 256, ΞΌ: 74706, ~: 74706)
ValidateSessionUserOp:test_validateSessionUserOp_userOpHash_invalid(bytes32) (runs: 256, ΞΌ: 75034, ~: 75034)
ValidateSessionUserOp:test_validateSessionUserOp_userOpHash_invalid(bytes32) (runs: 256, ΞΌ: 76920, ~: 76920)
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Report Coverage
run: |
forge coverage --fork-url ${{ secrets.OPTIMISM_GOERLI_RPC_URL }} --report lcov
forge coverage --fork-url ${{ secrets.OPTIMISM_SEPOLIA_RPC_URL }} --report lcov
- name: Upload Coverage Report
uses: codecov/codecov-action@v3
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# scw-contracts

[![Github Actions][gha-badge]][gha]
[![Foundry][foundry-badge]][foundry]
[![Github Actions][gha-badge]][gha]
[![Foundry][foundry-badge]][foundry]
[![License: GPL-3.0][license-badge]][license]

[gha]: https://github.com/Kwenta/scw-contracts/actions
Expand Down Expand Up @@ -57,24 +57,24 @@ npm run test
```

4. Run specific test
> `OPTIMISM_GOERLI_RPC_URL` can be replaced with `OPTIMISM_RPC_URL` if a mainnet fork is desired
> `OPTIMISM_SEPOLIA_RPC_URL` can be replaced with `OPTIMISM_RPC_URL` if a mainnet fork is desired
```
forge test --fork-url $(grep OPTIMISM_GOERLI_RPC_URL .env | cut -d '=' -f2) --match-test TEST_NAME -vvv
forge test --fork-url $(grep OPTIMISM_SEPOLIA_RPC_URL .env | cut -d '=' -f2) --match-test TEST_NAME -vvv
```

## Deployment Addresses

> See `deployments/` folder
1. Optimism deployments found in `deployments/Optimism.json`
2. Optimism Goerli deployments found in `deployments/OptimismGoerli.json`
2. Optimism Sepolia deployments found in `deployments/OptimismSepolia.json`
3. Base deployments found in `deployments/Base.json`
4. Base Goerli deployments found in `deployments/BaseGoerli.json`
4. Base Sepolia deployments found in `deployments/BaseSepolia.json`

## Audits

> See `audits/` folder
1. Internal audits found in `audits/internal/`
2. External audits found in `audits/external/`
2. External audits found in `audits/external/`
14 changes: 7 additions & 7 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ line_length = 80
number_underscore = "thousands"

[rpc_endpoints]
mainnet = "${MAINNET_RPC_URL}"
mainnet = "${MAINNET_RPC_URL}"
optimism = "${OPTIMISM_RPC_URL}"
base = "${BASE_RPC_URL}"
goerli = "${GOERLI_RPC_URL}"
optimismGoerli = "${OPTIMISM_GOERLI_RPC_URL}"
baseGoerli = "${BASE_GOERLI_RPC_URL}"
sepolia = "${SEPOLIA_RPC_URL}"
optimismSepolia = "${OPTIMISM_SEPOLIA_RPC_URL}"
baseSepolia = "${BASE_SEPOLIA_RPC_URL}"

[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}" }
optimism = { key = "${OPTIMISM_ETHERSCAN_API_KEY}" }
base = { key = "${BASESCAN_API_KEY}" }
goerli = { key = "${ETHERSCAN_API_KEY}" }
optimismGoerli = { key = "${OPTIMISM_ETHERSCAN_API_KEY}" }
baseGoerli = { key = "${BASESCAN_API_KEY}" }
sepolia = { key = "${ETHERSCAN_API_KEY}" }
optimismSepolia = { key = "${OPTIMISM_ETHERSCAN_API_KEY}" }
baseSepolia = { key = "${BASESCAN_API_KEY}" }
Loading

0 comments on commit fca8f07

Please sign in to comment.