Skip to content

Commit

Permalink
add the l1 proxy code
Browse files Browse the repository at this point in the history
  • Loading branch information
moodysalem committed Jan 9, 2025
1 parent 8f1c9c4 commit ccc1890
Show file tree
Hide file tree
Showing 12 changed files with 458 additions and 2 deletions.
43 changes: 41 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ on:
pull_request:
branches:
- main
workflow_dispatch:

env:
FOUNDRY_PROFILE: ci

jobs:
main:
cairo:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -20,4 +24,39 @@ jobs:

- name: Test the code
run: |
scarb test
scarb test
solidity:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Show Forge version
run: |
forge --version
- name: Run Forge fmt
run: |
forge fmt --check
id: fmt

- name: Run Forge build
run: |
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "l1_proxy/lib/forge-std"]
path = l1_proxy/lib/forge-std
url = https://github.com/foundry-rs/forge-std
19 changes: 19 additions & 0 deletions l1_proxy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.vscode
.codegpt

# Compiler files
cache/
out/

# Ignores development broadcast logs
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/

# Docs
docs/

# Dotenv file
.env

.codegpt
49 changes: 49 additions & 0 deletions l1_proxy/broadcast/Deploy.s.sol/1/run-1736266757.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"transactions": [
{
"hash": "0x58d886795afd7ff428175030088865eb35fbe30eae5e963c32a39246904a721f",
"transactionType": "CREATE",
"contractName": "StarknetOwnerProxy",
"contractAddress": "0xd2f72213a2d1f9d95f10bf4afe2ba8a2fb4868f2",
"function": null,
"arguments": [
"0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4",
"2354502934501836923955011505963489193673442986857363336683304411560511969997"
],
"transaction": {
"from": "0xf94e5cdf41247e268d4847c30a0dc2893b33e85d",
"gas": "0x79996",
"value": "0x0",
"input": "0x60c060405234801561000f575f5ffd5b5060405161069638038061069683398101604081905261002e91610044565b6001600160a01b0390911660805260a05261007b565b5f5f60408385031215610055575f5ffd5b82516001600160a01b038116811461006b575f5ffd5b6020939093015192949293505050565b60805160a0516105ed6100a95f395f818161010901526102d001525f8181609201526102a101526105ed5ff3fe608060405260043610610041575f3560e01c80635add2f701461004c5780637fab394d14610081578063b61d27f6146100cc578063f003a0c5146100f8575f5ffd5b3661004857005b5f5ffd5b348015610057575f5ffd5b5061006b6100663660046103ed565b610139565b60405161007891906104b7565b60405180910390f35b34801561008c575f5ffd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610078565b3480156100d7575f5ffd5b506100eb6100e63660046103ed565b610240565b60405161007891906104d0565b348015610103575f5ffd5b5061012b7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610078565b60605f601f61014984601e610505565b610153919061052a565b90505f610161826003610505565b67ffffffffffffffff81111561017957610179610549565b6040519080825280602002602001820160405280156101a2578160200160208202803683370190505b509050866001600160a01b0316815f815181106101c1576101c161055d565b60200260200101818152505085816001815181106101e1576101e161055d565b60200260200101818152505084849050816002815181106102045761020461055d565b60209081029190910101525f5b8281101561023557601f810286013560081c60048201602002830152600101610211565b509695505050505050565b60606001600160a01b038516158061026057506001600160a01b03851630145b1561027e5760405163416aebb560e11b815260040160405180910390fd5b8347101561029f57604051631e9acf1760e31b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632c9dd5c07f00000000000000000000000000000000000000000000000000000000000000006102fb88888888610139565b6040518363ffffffff1660e01b8152600401610318929190610571565b6020604051808303815f875af1158015610334573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103589190610591565b505f5f866001600160a01b03168686866040516103769291906105a8565b5f6040518083038185875af1925050503d805f81146103b0576040519150601f19603f3d011682016040523d82523d5f602084013e6103b5565b606091505b5091509150816103e3578060405163a5fa8d2b60e01b81526004016103da91906104d0565b60405180910390fd5b9695505050505050565b5f5f5f5f60608587031215610400575f5ffd5b84356001600160a01b0381168114610416575f5ffd5b935060208501359250604085013567ffffffffffffffff811115610438575f5ffd5b8501601f81018713610448575f5ffd5b803567ffffffffffffffff81111561045e575f5ffd5b87602082840101111561046f575f5ffd5b949793965060200194505050565b5f8151808452602084019350602083015f5b828110156104ad57815186526020958601959091019060010161048f565b5093949350505050565b602081525f6104c9602083018461047d565b9392505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b8082018082111561052457634e487b7160e01b5f52601160045260245ffd5b92915050565b5f8261054457634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b828152604060208201525f610589604083018461047d565b949350505050565b5f602082840312156105a1575f5ffd5b5051919050565b818382375f910190815291905056fea26469706673582212208e39481fc28d11c7a6da7706c50f24f8b563dca7188a2df30970b65ec546b9ac64736f6c634300081c0033000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c4053499f7aa2706395060fe72d00388803fb2dcc111429891ad7b2d9dcea29acd",
"nonce": "0x235",
"chainId": "0x1"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x9666a8",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0x58d886795afd7ff428175030088865eb35fbe30eae5e963c32a39246904a721f",
"transactionIndex": "0x6e",
"blockHash": "0x39d47bd69be96c71a6b498346659f3099234e962279466f55339fbe2be7772f0",
"blockNumber": "0x149306d",
"gasUsed": "0x5d89b",
"effectiveGasPrice": "0x57a2bad5f",
"from": "0xf94e5cdf41247e268d4847c30a0dc2893b33e85d",
"to": null,
"contractAddress": "0xd2f72213a2d1f9d95f10bf4afe2ba8a2fb4868f2"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1736266757,
"chain": 1,
"commit": "27ce525"
}
49 changes: 49 additions & 0 deletions l1_proxy/broadcast/Deploy.s.sol/1/run-latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"transactions": [
{
"hash": "0x58d886795afd7ff428175030088865eb35fbe30eae5e963c32a39246904a721f",
"transactionType": "CREATE",
"contractName": "StarknetOwnerProxy",
"contractAddress": "0xd2f72213a2d1f9d95f10bf4afe2ba8a2fb4868f2",
"function": null,
"arguments": [
"0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4",
"2354502934501836923955011505963489193673442986857363336683304411560511969997"
],
"transaction": {
"from": "0xf94e5cdf41247e268d4847c30a0dc2893b33e85d",
"gas": "0x79996",
"value": "0x0",
"input": "0x60c060405234801561000f575f5ffd5b5060405161069638038061069683398101604081905261002e91610044565b6001600160a01b0390911660805260a05261007b565b5f5f60408385031215610055575f5ffd5b82516001600160a01b038116811461006b575f5ffd5b6020939093015192949293505050565b60805160a0516105ed6100a95f395f818161010901526102d001525f8181609201526102a101526105ed5ff3fe608060405260043610610041575f3560e01c80635add2f701461004c5780637fab394d14610081578063b61d27f6146100cc578063f003a0c5146100f8575f5ffd5b3661004857005b5f5ffd5b348015610057575f5ffd5b5061006b6100663660046103ed565b610139565b60405161007891906104b7565b60405180910390f35b34801561008c575f5ffd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610078565b3480156100d7575f5ffd5b506100eb6100e63660046103ed565b610240565b60405161007891906104d0565b348015610103575f5ffd5b5061012b7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610078565b60605f601f61014984601e610505565b610153919061052a565b90505f610161826003610505565b67ffffffffffffffff81111561017957610179610549565b6040519080825280602002602001820160405280156101a2578160200160208202803683370190505b509050866001600160a01b0316815f815181106101c1576101c161055d565b60200260200101818152505085816001815181106101e1576101e161055d565b60200260200101818152505084849050816002815181106102045761020461055d565b60209081029190910101525f5b8281101561023557601f810286013560081c60048201602002830152600101610211565b509695505050505050565b60606001600160a01b038516158061026057506001600160a01b03851630145b1561027e5760405163416aebb560e11b815260040160405180910390fd5b8347101561029f57604051631e9acf1760e31b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632c9dd5c07f00000000000000000000000000000000000000000000000000000000000000006102fb88888888610139565b6040518363ffffffff1660e01b8152600401610318929190610571565b6020604051808303815f875af1158015610334573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103589190610591565b505f5f866001600160a01b03168686866040516103769291906105a8565b5f6040518083038185875af1925050503d805f81146103b0576040519150601f19603f3d011682016040523d82523d5f602084013e6103b5565b606091505b5091509150816103e3578060405163a5fa8d2b60e01b81526004016103da91906104d0565b60405180910390fd5b9695505050505050565b5f5f5f5f60608587031215610400575f5ffd5b84356001600160a01b0381168114610416575f5ffd5b935060208501359250604085013567ffffffffffffffff811115610438575f5ffd5b8501601f81018713610448575f5ffd5b803567ffffffffffffffff81111561045e575f5ffd5b87602082840101111561046f575f5ffd5b949793965060200194505050565b5f8151808452602084019350602083015f5b828110156104ad57815186526020958601959091019060010161048f565b5093949350505050565b602081525f6104c9602083018461047d565b9392505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b8082018082111561052457634e487b7160e01b5f52601160045260245ffd5b92915050565b5f8261054457634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b828152604060208201525f610589604083018461047d565b949350505050565b5f602082840312156105a1575f5ffd5b5051919050565b818382375f910190815291905056fea26469706673582212208e39481fc28d11c7a6da7706c50f24f8b563dca7188a2df30970b65ec546b9ac64736f6c634300081c0033000000000000000000000000c662c410c0ecf747543f5ba90660f6abebd9c8c4053499f7aa2706395060fe72d00388803fb2dcc111429891ad7b2d9dcea29acd",
"nonce": "0x235",
"chainId": "0x1"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x9666a8",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0x58d886795afd7ff428175030088865eb35fbe30eae5e963c32a39246904a721f",
"transactionIndex": "0x6e",
"blockHash": "0x39d47bd69be96c71a6b498346659f3099234e962279466f55339fbe2be7772f0",
"blockNumber": "0x149306d",
"gasUsed": "0x5d89b",
"effectiveGasPrice": "0x57a2bad5f",
"from": "0xf94e5cdf41247e268d4847c30a0dc2893b33e85d",
"to": null,
"contractAddress": "0xd2f72213a2d1f9d95f10bf4afe2ba8a2fb4868f2"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1736266757,
"chain": 1,
"commit": "27ce525"
}
49 changes: 49 additions & 0 deletions l1_proxy/broadcast/Deploy.s.sol/11155111/run-1736266524.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"transactions": [
{
"hash": "0xea670257d53449d27fcd44127d13f0a2c2e44fad2e0727a96055bbc6e6e5a215",
"transactionType": "CREATE",
"contractName": "StarknetOwnerProxy",
"contractAddress": "0x04e99d8f63d325fcea9b36913879bba4732b99af",
"function": null,
"arguments": [
"0xE2Bb56ee936fd6433DC0F6e7e3b8365C906AA057",
"2056114384263610425007312686792758172158354636787877809965121556469642730868"
],
"transaction": {
"from": "0xf94e5cdf41247e268d4847c30a0dc2893b33e85d",
"gas": "0x79996",
"value": "0x0",
"input": "0x60c060405234801561000f575f5ffd5b5060405161069638038061069683398101604081905261002e91610044565b6001600160a01b0390911660805260a05261007b565b5f5f60408385031215610055575f5ffd5b82516001600160a01b038116811461006b575f5ffd5b6020939093015192949293505050565b60805160a0516105ed6100a95f395f818161010901526102d001525f8181609201526102a101526105ed5ff3fe608060405260043610610041575f3560e01c80635add2f701461004c5780637fab394d14610081578063b61d27f6146100cc578063f003a0c5146100f8575f5ffd5b3661004857005b5f5ffd5b348015610057575f5ffd5b5061006b6100663660046103ed565b610139565b60405161007891906104b7565b60405180910390f35b34801561008c575f5ffd5b506100b47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610078565b3480156100d7575f5ffd5b506100eb6100e63660046103ed565b610240565b60405161007891906104d0565b348015610103575f5ffd5b5061012b7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610078565b60605f601f61014984601e610505565b610153919061052a565b90505f610161826003610505565b67ffffffffffffffff81111561017957610179610549565b6040519080825280602002602001820160405280156101a2578160200160208202803683370190505b509050866001600160a01b0316815f815181106101c1576101c161055d565b60200260200101818152505085816001815181106101e1576101e161055d565b60200260200101818152505084849050816002815181106102045761020461055d565b60209081029190910101525f5b8281101561023557601f810286013560081c60048201602002830152600101610211565b509695505050505050565b60606001600160a01b038516158061026057506001600160a01b03851630145b1561027e5760405163416aebb560e11b815260040160405180910390fd5b8347101561029f57604051631e9acf1760e31b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632c9dd5c07f00000000000000000000000000000000000000000000000000000000000000006102fb88888888610139565b6040518363ffffffff1660e01b8152600401610318929190610571565b6020604051808303815f875af1158015610334573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103589190610591565b505f5f866001600160a01b03168686866040516103769291906105a8565b5f6040518083038185875af1925050503d805f81146103b0576040519150601f19603f3d011682016040523d82523d5f602084013e6103b5565b606091505b5091509150816103e3578060405163a5fa8d2b60e01b81526004016103da91906104d0565b60405180910390fd5b9695505050505050565b5f5f5f5f60608587031215610400575f5ffd5b84356001600160a01b0381168114610416575f5ffd5b935060208501359250604085013567ffffffffffffffff811115610438575f5ffd5b8501601f81018713610448575f5ffd5b803567ffffffffffffffff81111561045e575f5ffd5b87602082840101111561046f575f5ffd5b949793965060200194505050565b5f8151808452602084019350602083015f5b828110156104ad57815186526020958601959091019060010161048f565b5093949350505050565b602081525f6104c9602083018461047d565b9392505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b8082018082111561052457634e487b7160e01b5f52601160045260245ffd5b92915050565b5f8261054457634e487b7160e01b5f52601260045260245ffd5b500490565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b828152604060208201525f610589604083018461047d565b949350505050565b5f602082840312156105a1575f5ffd5b5051919050565b818382375f910190815291905056fea26469706673582212208e39481fc28d11c7a6da7706c50f24f8b563dca7188a2df30970b65ec546b9ac64736f6c634300081c0033000000000000000000000000e2bb56ee936fd6433dc0f6e7e3b8365c906aa057048bb83134ce6a312d1b41b0b3deccc4ce9a9d280e6c68c0eb1c517259c89d74",
"nonce": "0x10",
"chainId": "0xaa36a7"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0xeb149f",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0xea670257d53449d27fcd44127d13f0a2c2e44fad2e0727a96055bbc6e6e5a215",
"transactionIndex": "0x71",
"blockHash": "0xa253bacd02af40e9479dd58ccecd6bc4eb450f481eeaa64408ec0b1ff6076ea6",
"blockNumber": "0x718a56",
"gasUsed": "0x5d89b",
"effectiveGasPrice": "0x68d7fd1b9",
"from": "0xf94e5cdf41247e268d4847c30a0dc2893b33e85d",
"to": null,
"contractAddress": "0x04e99d8f63d325fcea9b36913879bba4732b99af"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1736266524,
"chain": 11155111,
"commit": "27ce525"
}
Loading

0 comments on commit ccc1890

Please sign in to comment.