Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c63dc45
wip: use create2 for factory deployment
godzillaba Jun 24, 2025
0040293
remove key from config
godzillaba Jun 24, 2025
40b97dd
fmt
godzillaba Jun 24, 2025
22ad2fa
fix signatures
godzillaba Jun 24, 2025
9b38201
Merge branch 'develop' into deterministic-factory-deployments
godzillaba Jun 24, 2025
17be158
inline up exec deployment
godzillaba Jun 25, 2025
8aed0c3
salt length check
godzillaba Jun 30, 2025
7c0fd72
update tests
godzillaba Jun 30, 2025
4412691
Merge branch 'develop' into deterministic-factory-deployments
godzillaba Jun 30, 2025
1a12320
fmt
godzillaba Jun 30, 2025
64a519a
Merge branch 'deterministic-factory-deployments' of https://github.co…
godzillaba Jun 30, 2025
c4887b3
remove SetTemplatesArgs struct
godzillaba Jul 1, 2025
f4ba76f
remove ownership from bridge creator
godzillaba Jul 1, 2025
5953155
add CREATE2_FACTORY env and deployment instructions
godzillaba Jul 1, 2025
9429824
fix signatures
godzillaba Jul 1, 2025
d164f5e
disable CBOR
godzillaba Jul 1, 2025
f760491
factory owner as deployAllContracts arg
godzillaba Jul 1, 2025
bd06fb1
set deployer as owner in local deployment
godzillaba Jul 1, 2025
8ddbd58
chore: remove entries for removed files
gzeoneth Jul 2, 2025
8ac925f
refactor: commonSetting
gzeoneth Jul 2, 2025
7d5f4b3
feat: foundry override
gzeoneth Jul 2, 2025
7e2a20e
fix: test
gzeoneth Jul 2, 2025
fae9bb8
Merge branch 'deterministic-factory-deployments' into disable-cbor
godzillaba Jul 2, 2025
2c35c5d
chore: default profile
gzeoneth Jul 3, 2025
edb05eb
feat: solc 0.8.30 and prague
gzeoneth Jul 3, 2025
cb46359
format: yarn format
gzeoneth Jul 3, 2025
a27fd28
ci: comapre bytecodes
gzeoneth Jul 3, 2025
6aa282a
Merge branch 'disable-cbor' into solc-830
gzeoneth Jul 3, 2025
b02705b
fix: slither db
gzeoneth Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env-sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ L1_PRIV_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
CONFIG_NETWORK_NAME="custom"
DEPLOYED_CONTRACTS_DIR="./scripts/files/"
DISABLE_VERIFICATION=true
FACTORY_OWNER=0x000000000000000000000000000000000000dead

CREATE2_FACTORY=0x4e59b44847b379578588920cA78FbF26c0B4956C

# to use the 'custom' hardhat network, set the following variables
CUSTOM_RPC_URL="http://127.0.0.1:8545"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ jobs:
- name: Lint Test Scripts
run: yarn lint:test

- name: Compare bytecodes
run: yarn test:bytecodes

- name: Build
run: yarn build:all

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ out/
.env
.DS_Store
lcov.info
output_directory
output_directory
coverage
23 changes: 22 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ cache_path = 'forge-cache/sol'
optimizer = true
optimizer_runs = 2000
via_ir = false
evm_version = 'cancun'
evm_version = 'prague'
solc_version = '0.8.30'
bytecode_hash = 'none'
remappings = ['ds-test/=lib/forge-std/lib/ds-test/src/',
'forge-std/=lib/forge-std/src/',
'@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/',
Expand All @@ -16,14 +18,33 @@ remappings = ['ds-test/=lib/forge-std/lib/ds-test/src/',
'@uniswap/v2-core/=node_modules/@uniswap/v2-core/contracts',
'@uniswap/lib/=node_modules/@uniswap/lib/contracts']
fs_permissions = [{ access = "read", path = "./"}]
additional_compiler_profiles = [
{ name = "20_runs", optimizer_runs = 20 },
{ name = "200_runs", optimizer_runs = 200 },
{ name = "default", optimizer_runs = 2000 }
]
compilation_restrictions = [
{ paths = "src/rollup/RollupUserLogic.sol", optimizer_runs = 20 },
{ paths = "src/challengeV2/EdgeChallengeManager.sol", optimizer_runs = 200 },
]
skip = ['test/*']

[profile.test]
inherit = "default"
optimizer = false
additional_compiler_profiles = []
compilation_restrictions = []
skip = []

[profile.yul]
inherit = "default"
src = 'yul'
out = 'out/yul'
libs = ['node_modules', 'lib']
cache_path = 'forge-cache/yul'
remappings = []
auto_detect_remappings = false
skip = ['*.sol', 'test/*']

[fmt]
line_length = 100
Expand Down
81 changes: 24 additions & 57 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,64 +8,51 @@ import 'hardhat-gas-reporter'
import 'hardhat-contract-sizer'
import 'hardhat-ignore-warnings'
import dotenv from 'dotenv'
import { SolidityConfig } from 'hardhat/types'

dotenv.config()

const solidity = {
const commonSetting = {
metadata: {
bytecodeHash: 'none',
},
optimizer: {
enabled: true,
runs: 2000, // default value, can be overridden
},
evmVersion: 'prague',
}

const solidity: SolidityConfig = {
compilers: [
{
version: '0.8.17',
settings: {
optimizer: {
enabled: true,
runs: 2000,
},
},
version: '0.8.30',
settings: { ...commonSetting },
},
],
overrides: {
'src/rollup/RollupUserLogic.sol': {
version: '0.8.17',
version: '0.8.30',
settings: {
optimizer: {
enabled: true,
runs: 20,
},
...commonSetting,
optimizer: { ...commonSetting.optimizer, runs: 20 },
},
},
'src/challengeV2/EdgeChallengeManager.sol': {
version: '0.8.17',
settings: {
optimizer: {
enabled: true,
runs: 200,
},
},
},
'src/mocks/HostioTest.sol': {
version: '0.8.24',
settings: {
optimizer: {
enabled: true,
runs: 100,
},
evmVersion: 'cancun',
},
},
'src/mocks/ArbOS11To32UpgradeTest.sol': {
version: '0.8.24',
settings: {
optimizer: {
enabled: true,
runs: 100,
},
evmVersion: 'cancun',
...commonSetting,
optimizer: { ...commonSetting.optimizer, runs: 200 },
},
},
},
}

if (process.env['INTERFACE_TESTER_SOLC_VERSION']) {
console.log(
'Running in interface tester mode with solc version',
process.env['INTERFACE_TESTER_SOLC_VERSION']
)
solidity.compilers.push({
version: process.env['INTERFACE_TESTER_SOLC_VERSION'],
settings: {
Expand All @@ -88,26 +75,6 @@ if (process.env['INTERFACE_TESTER_SOLC_VERSION']) {
},
},
},
'src/mocks/HostioTest.sol': {
version: '0.8.24',
settings: {
optimizer: {
enabled: true,
runs: 100,
},
evmVersion: 'cancun',
},
},
'src/mocks/ArbOS11To32UpgradeTest.sol': {
version: '0.8.24',
settings: {
optimizer: {
enabled: true,
runs: 100,
},
evmVersion: 'cancun',
},
},
}
}

Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"audit:ci": "audit-ci --config ./audit-ci.jsonc",
"audit:fix": "yarn-audit-fix",
"prepublishOnly": "hardhat clean && forge clean && hardhat compile && yarn build:forge:yul",
"coverage": "forge coverage --report lcov --ir-minimum && lcov --remove lcov.info 'node_modules/*' 'test/*' 'script/*' 'src/test-helpers/*' 'challenge/*' --ignore-errors unused -o lcov.info && genhtml lcov.info --branch-coverage --output-dir coverage",
"coverage": "FOUNDRY_PROFILE=test forge coverage --report lcov --ir-minimum && lcov --remove lcov.info 'node_modules/*' 'test/*' 'script/*' 'src/test-helpers/*' 'challenge/*' --ignore-errors unused -o lcov.info && genhtml lcov.info --branch-coverage --output-dir coverage",
"build:all": "yarn build && yarn build:forge",
"build": "hardhat compile",
"build:forge:sol": "forge build --skip *.yul",
"build:forge:yul": "FOUNDRY_PROFILE=yul forge build --skip *.sol",
"build:forge:yul": "FOUNDRY_PROFILE=yul forge build",
"build:forge": "yarn build:forge:sol && yarn build:forge:yul",
"contract:size": "hardhat size-contracts",
"lint:test": "eslint ./test",
Expand All @@ -44,8 +44,9 @@
"test:e2e": "hardhat test test/e2e/*.ts",
"test:e2e:stylus": "hardhat test test/e2e/stylusDeployer.ts",
"test:upgrade": "./scripts/testUpgrade.bash",
"test:foundry": "forge test --gas-limit 10000000000",
"test:foundry": "FOUNDRY_PROFILE=test forge test --gas-limit 10000000000",
"test:update": "yarn run test:signatures || yarn run test:storage",
"test:bytecodes": "hardhat clean && forge clean && hardhat run scripts/compareBytecodes.ts",
"metadatahash": "yarn build:all && hardhat run scripts/printMetadataHashes.ts",
"upload-4bytes": "forge build && find ./out -type f -name \"*.json\" -exec cast upload-signature {} + | grep -v Duplicated:",
"postinstall": "patch-package",
Expand Down
Loading
Loading