Skip to content

Commit

Permalink
Merge pull request #55 from base-org/jack/contract-bug-fixes
Browse files Browse the repository at this point in the history
fix attribute handler bugs, re-deploy contracts, simplify makefile
  • Loading branch information
jackchuma authored Dec 21, 2024
2 parents bef64ae + 1ebf3d1 commit 23afa6e
Show file tree
Hide file tree
Showing 41 changed files with 3,285 additions and 225 deletions.
40 changes: 7 additions & 33 deletions contracts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ CHAIN_A_URL=http://localhost:8546
CHAIN_B_URL=http://localhost:8547

ARBITRUM_RPC = $(ARBITRUM_SEPOLIA_RPC)
OPTIMISM_RPC = $(CHAIN_B_URL)
BASE_RPC = $(CHAIN_A_URL)
OPTIMISM_RPC = $(OPTIMISM_SEPOLIA_RPC)
BASE_RPC = $(BASE_SEPOLIA_RPC)

SUBMIT_REQUEST_RPC = $(ARBITRUM_SEPOLIA_RPC)
SUBMIT_REQUEST_RPC = $(OPTIMISM_RPC)
OP_STACK_RPC = $(OPTIMISM_RPC)

test:
forge fmt
Expand All @@ -32,47 +33,20 @@ coverage:
deploy-mock:
forge create --rpc-url $(ARBITRUM_RPC) --private-key $(PRIVATE_KEY) test/mocks/MockVerifier.sol:MockVerifier

deploy-mock-opt-sep:
forge create --rpc-url $(OPTIMISM_RPC) --private-key $(PRIVATE_KEY) test/mocks/MockVerifier.sol:MockVerifier

deploy-mock-chiado:
forge create --rpc-url $(CHIADO_RPC) --private-key $(PRIVATE_KEY) test/mocks/MockVerifier.sol:MockVerifier

read-mock:
cast call $(MOCK_VERIFIER_ADDRESS) "getFulfillmentInfo(bytes32)(uint96,address)" $(ARBITRUM_REQUEST_HASH) --rpc-url $(ARBITRUM_RPC)

set-mock:
cast send $(MOCK_VERIFIER_ADDRESS) "storeFulfillmentInfo(bytes32,address)" $(ARBITRUM_REQUEST_HASH) $(FULFILLER_ADDRESS) --rpc-url $(ARBITRUM_RPC) --private-key $(PRIVATE_KEY)

read-mock-op:
cast call $(MOCK_VERIFIER_ADDRESS) "getFulfillmentInfo(bytes32)(uint96,address)" $(OPTIMISM_REQUEST_HASH) --rpc-url $(OPTIMISM_RPC)

set-mock-op:
cast send $(MOCK_VERIFIER_ADDRESS) "storeFulfillmentInfo(bytes32,address)" $(OPTIMISM_REQUEST_HASH) $(FULFILLER_ADDRESS) --rpc-url $(OPTIMISM_RPC) --private-key $(PRIVATE_KEY)

read-mock-chiado:
cast call 0xdA7D9c8C3eBd2F0A790b1AbCFcdA3d309379B4d8 "getFulfillmentInfo(bytes32)(uint96,address)" 0x44d313e0c91083225689fc582c66e76e3653a588daa2b5cffbcd3b9158cb6078 --rpc-url $(CHIADO_RPC)

set-mock-chiado:
cast send 0xdA7D9c8C3eBd2F0A790b1AbCFcdA3d309379B4d8 "storeFulfillmentInfo(bytes32,address)" 0x44d313e0c91083225689fc582c66e76e3653a588daa2b5cffbcd3b9158cb6078 0x23214a0864fc0014cab6030267738f01affdd547 --rpc-url $(CHIADO_RPC) --private-key $(PRIVATE_KEY)

deploy-arbitrum-sepolia:
forge script script/chains/DeployArbitrum.s.sol:DeployArbitrum --rpc-url $(ARBITRUM_RPC) --broadcast -vvvv

deploy-optimism-sepolia:
PRIVATE_KEY=$(PRIVATE_KEY) forge script script/chains/DeployBase.s.sol:DeployBase --rpc-url $(OPTIMISM_RPC) --broadcast -vvvv

deploy-base-sepolia:
forge script script/chains/DeployBase.s.sol:DeployBase --rpc-url $(BASE_RPC) --private-key $(PRIVATE_KEY) --broadcast -vvvv

verify-arb-sepolia:
forge verify-contract 0xeE962eD1671F655a806cB22623eEA8A7cCc233bC src/RIP7755Inbox.sol:RIP7755Inbox --rpc-url $(ARBITRUM_RPC) --etherscan-api-key $(ARBISCAN_API_KEY)

verify-base-sepolia:
forge verify-contract 0xB482b292878FDe64691d028A2237B34e91c7c7ea src/RIP7755Inbox.sol:RIP7755Inbox --rpc-url $(BASE_RPC) --etherscan-api-key $(BASESCAN_API_KEY)
deploy-op-stack:
PRIVATE_KEY=$(PRIVATE_KEY) forge script script/chains/DeployBase.s.sol:DeployBase --rpc-url $(OP_STACK_RPC) --broadcast -vvvv

submit-request:
forge script script/actions/SubmitRequest.s.sol:SubmitRequest --rpc-url $(SUBMIT_REQUEST_RPC) --broadcast -vvvv
PRIVATE_KEY=$(PRIVATE_KEY) forge script script/actions/SubmitRequest.s.sol:SubmitRequest --rpc-url $(SUBMIT_REQUEST_RPC) --broadcast -vvvv

fulfill-request:
PRIVATE_KEY=$(PRIVATE_KEY) forge script script/actions/SubmitToInbox.s.sol:SubmitToInbox --rpc-url $(OPTIMISM_RPC) --broadcast -vvvv
22 changes: 11 additions & 11 deletions contracts/addresses.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"arbitrumSepolia": {
"RIP7755Inbox": "0xCdadDE9005974Fbd3385184d1C1C34ef455Cb2Be",
"RIP7755OutboxToOPStack": "0x3eD4f0892020a9C57586c33554032be00fE379E4",
"RIP7755OutboxToHashi": "0x539cE371fcb2AF97FfEF3C013b760d9e87B5dE34"
"RIP7755Inbox": "0x5873D69cd7Cd6f1040AA87E6107eB6516E9F5359",
"RIP7755OutboxToOPStack": "0x70133C8D5b8fAcd20EAb47D609611009f39ae2D8",
"RIP7755OutboxToHashi": "0xF648758260bfA7A9dBe1B69f471b23AfFf1cBa6E"
},
"baseSepolia": {
"RIP7755Inbox": "0xFce77110df39c54681a0769EB515cCE862d074d9",
"RIP7755OutboxToArbitrum": "0xcDdCD048d3AbdE4c917391f65fE296B64841619C",
"RIP7755OutboxToOPStack": "0x558D42DFD77B6E0aD643F63C23aaba426359cd75",
"RIP7755OutboxToHashi": "0x3365567988f788F7e878377CF211CC98A3505E15"
"RIP7755Inbox": "0x4C1e8c60c3f07AD8A0d08FCD5Cf93f6b73dFeB76",
"RIP7755OutboxToArbitrum": "0x3D52b08C3B7Bf624eAD9A79b2e689eA93b80A270",
"RIP7755OutboxToOPStack": "0x887f1Bf9F66DFc92901daCcC3d88462b17251B75",
"RIP7755OutboxToHashi": "0x61B4C289F10f77713C0f1fb38B70741E404Be347"
},
"optimismSepolia": {
"RIP7755Inbox": "0xaC60fCC226899F14016d14CfCC955598D4cbe10F",
"RIP7755OutboxToArbitrum": "0xD7a5A114A07cC4B5ebd9C5e1cD1136a99fFA3d68",
"RIP7755OutboxToOPStack": "0xB482b292878FDe64691d028A2237B34e91c7c7ea",
"RIP7755OutboxToHashi": "0x089581Fef0ea7ef36Ba252B295E8d172CeEf0dF3"
"RIP7755Inbox": "0xcDdCD048d3AbdE4c917391f65fE296B64841619C",
"RIP7755OutboxToArbitrum": "0x558D42DFD77B6E0aD643F63C23aaba426359cd75",
"RIP7755OutboxToOPStack": "0xb0524e2D930A46b4B7Eea9fb1E586d00823f66D9",
"RIP7755OutboxToHashi": "0x3365567988f788F7e878377CF211CC98A3505E15"
}
}
120 changes: 120 additions & 0 deletions contracts/broadcast/DeployArbitrum.s.sol/421614/run-1734794603.json

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions contracts/broadcast/DeployArbitrum.s.sol/421614/run-1734796272.json

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions contracts/broadcast/DeployArbitrum.s.sol/421614/run-1734814238.json

Large diffs are not rendered by default.

94 changes: 65 additions & 29 deletions contracts/broadcast/DeployArbitrum.s.sol/421614/run-latest.json

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions contracts/broadcast/DeployBase.s.sol/11155420/run-1734794906.json

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions contracts/broadcast/DeployBase.s.sol/11155420/run-1734796393.json

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions contracts/broadcast/DeployBase.s.sol/11155420/run-1734814391.json

Large diffs are not rendered by default.

140 changes: 90 additions & 50 deletions contracts/broadcast/DeployBase.s.sol/11155420/run-latest.json

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions contracts/broadcast/DeployBase.s.sol/84532/run-1734794710.json

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions contracts/broadcast/DeployBase.s.sol/84532/run-1734796342.json

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions contracts/broadcast/DeployBase.s.sol/84532/run-1734814329.json

Large diffs are not rendered by default.

140 changes: 90 additions & 50 deletions contracts/broadcast/DeployBase.s.sol/84532/run-latest.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"transactions": [
{
"hash": "0x7d0d3867061ed0a40f15001d824fb0de85ebefff4e917e249aa154983c272865",
"transactionType": "CALL",
"contractName": null,
"contractAddress": "0x558d42dfd77b6e0ad643f63c23aaba426359cd75",
"function": "sendMessage(string,string,bytes,bytes[])",
"arguments": [
"eip155:421614",
"0x5873D69cd7Cd6f1040AA87E6107eB6516E9F5359",
"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000008c1a617bdb47342f9c17ac8750e0b070c372c721000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000000",
"[0xa362e5db000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000b5e620f48000, 0x84f550e00000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000000000000000000000000000000000006779a6f6, 0x7ff7245a000000000000000000000000042b2e6c5e99d4c521bd49beed5e99651d9b0cf4]"
],
"transaction": {
"from": "0x8c1a617bdb47342f9c17ac8750e0b070c372c721",
"to": "0x558d42dfd77b6e0ad643f63c23aaba426359cd75",
"gas": "0x2b2ab",
"value": "0xb5e620f48000",
"input": "0x7cfd9bdc000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000000d6569703135353a34323136313400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002a3078353837334436396364374364366631303430414138374536313037654236353136453946353335390000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000008c1a617bdb47342f9c17ac8750e0b070c372c721000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000000000000044a362e5db000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000b5e620f4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004484f550e00000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000000000000000000000000000000000006779a6f60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000247ff7245a000000000000000000000000042b2e6c5e99d4c521bd49beed5e99651d9b0cf400000000000000000000000000000000000000000000000000000000",
"nonce": "0x18",
"chainId": "0xaa37dc"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x12482d",
"logs": [
{
"address": "0x558d42dfd77b6e0ad643f63c23aaba426359cd75",
"topics": [
"0xa37ff6d366884aabcbf069aa27b0e52078eea55e90ad8fc2349cd0a2aac08298",
"0xa8ce7a032f4f8d4643db997a82f9889ac8d41bcdebba322b05a92bff267adedf"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001600000000000000000000000000000000000000000000000000000b5e620f480000000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000003a6569703135353a31313135353432303a30783535384434324446443737423645306144363433463633433233616162613432363335396364373500000000000000000000000000000000000000000000000000000000000000000000000000386569703135353a3432313631343a307835383733443639636437436436663130343041413837453631303765423635313645394635333539000000000000000000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000008c1a617bdb47342f9c17ac8750e0b070c372c721000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000044a362e5db000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0000000000000000000000000000000000000000000000000000b5e620f4800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004484f550e00000000000000000000000000000000000000000000000000000000000093a80000000000000000000000000000000000000000000000000000000006779a6f60000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000247ff7245a000000000000000000000000042b2e6c5e99d4c521bd49beed5e99651d9b0cf4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024ce03fdab00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000243bd94e4c0000000000000000000000008c1a617bdb47342f9c17ac8750e0b070c372c72100000000000000000000000000000000000000000000000000000000",
"blockHash": "0xaa06ad6ad9ba77620c2e0b061d5cf5845c6acc237087e0b91f3dde2e261d6845",
"blockNumber": "0x1482b29",
"transactionHash": "0x7d0d3867061ed0a40f15001d824fb0de85ebefff4e917e249aa154983c272865",
"transactionIndex": "0xc",
"logIndex": "0x18",
"removed": false
}
],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000040000000000000000000000000000000000000000040000400000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000004000000000000000000000000000800000",
"type": "0x2",
"transactionHash": "0x7d0d3867061ed0a40f15001d824fb0de85ebefff4e917e249aa154983c272865",
"transactionIndex": "0xc",
"blockHash": "0xaa06ad6ad9ba77620c2e0b061d5cf5845c6acc237087e0b91f3dde2e261d6845",
"blockNumber": "0x1482b29",
"gasUsed": "0x1d841",
"effectiveGasPrice": "0xf1ba3",
"from": "0x8c1a617bdb47342f9c17ac8750e0b070c372c721",
"to": "0x558d42dfd77b6e0ad643f63c23aaba426359cd75",
"contractAddress": null,
"l1BaseFeeScalar": "0x1db0",
"l1BlobBaseFee": "0x1",
"l1BlobBaseFeeScalar": "0xd2730",
"l1Fee": "0x1721e0bbe7",
"l1GasPrice": "0xa9b01bbc",
"l1GasUsed": "0x11ef"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1734816255,
"chain": 11155420,
"commit": "7c9068b"
}
Loading

0 comments on commit 23afa6e

Please sign in to comment.