Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enabled contract upgrades and used namespaced storage #187

Merged
merged 32 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
26992d3
feat: starting new test
srdtrk Dec 19, 2024
4bbb577
imp: added initializer
srdtrk Dec 20, 2024
880d0dc
imp: added initializer to icscore
srdtrk Dec 20, 2024
e41e4b2
imp: added initialize to all relevant contracts
srdtrk Dec 20, 2024
9d2417f
imp: attempt to fix
srdtrk Dec 20, 2024
0f635da
imp: fixed more tests
srdtrk Dec 20, 2024
ef8b4af
imp: removed migration test
srdtrk Dec 20, 2024
df3d872
Merge branch 'main' into serdar/12-migrations
srdtrk Dec 20, 2024
557b090
test: improved deployment for tests
srdtrk Dec 20, 2024
066d0b9
imp: fixed deployment script
srdtrk Dec 20, 2024
92e40a2
style: ran forge fmt
srdtrk Dec 20, 2024
94c41f6
style
srdtrk Dec 20, 2024
6664398
imp: fix linter complaint
srdtrk Dec 20, 2024
a7c246c
imp: regenerated abi
srdtrk Dec 20, 2024
7afb5d5
imp: added missing event
srdtrk Dec 20, 2024
cbb2a86
imp: added foundation of new test
srdtrk Dec 20, 2024
8379462
imp: added foundations for new tests
srdtrk Dec 20, 2024
35da1fd
test: passing
srdtrk Dec 23, 2024
b4f91ac
test: added test case
srdtrk Dec 23, 2024
12f5db7
style: ran forge fmt
srdtrk Dec 23, 2024
c485d31
lint: fix
srdtrk Dec 23, 2024
e5d9918
feat: moved storage to erc7201
srdtrk Dec 23, 2024
e9db812
feat: renamed storage variables
srdtrk Dec 23, 2024
74df2fc
feat: using erc7201 in icsCore
srdtrk Dec 23, 2024
50a8e45
feat: using new storage in ics20
srdtrk Dec 23, 2024
b1ebd53
style: ran forge fmt
srdtrk Dec 23, 2024
47c20e7
imp: refactor
srdtrk Dec 23, 2024
75903fa
imp: replace cosmos with ibc in storage namespace
srdtrk Dec 23, 2024
e3d26d6
test: removed unneccessary stuff
srdtrk Dec 23, 2024
2557f15
imp: added gas logs
srdtrk Dec 24, 2024
cbde624
docs: updated benchmarks
srdtrk Dec 24, 2024
21e437c
lint
srdtrk Dec 24, 2024
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ The following benchmarks are for a single packet transfer without aggregation.

| **Contract** | **Method** | **Description** | **Gas (groth16)** | **Gas (plonk)** |
|:---:|:---:|:---:|:---:|:---:|
| `ICS26Router.sol` | `sendPacket` | Initiating an IBC transfer with an `ERC20`. | ~198,798 | ~198,798 |
| `ICS26Router.sol` | `recvPacket` | Receiving _back_ an `ERC20` token. | ~518,409 | ~602,503 |
| `ICS26Router.sol` | `recvPacket` | Receiving a _new_ Cosmos token for the first time. (Deploying an `ERC20` contract) | ~1,414,262 | ~1,497,617 |
| `ICS26Router.sol` | `ackPacket` | Acknowledging an ICS20 packet. | ~397,928 | ~428,009 |
| `ICS26Router.sol` | `timeoutPacket` | Timing out an ICS20 packet | ~449,137 | ~532,397 |
| `ICS26Router.sol` | `sendPacket` | Initiating an IBC transfer with an `ERC20`. | ~186,808 | ~186,808 |
| `ICS26Router.sol` | `recvPacket` | Receiving _back_ an `ERC20` token. | ~541,800 | ~626,140 |
| `ICS26Router.sol` | `recvPacket` | Receiving a _new_ Cosmos token for the first time. (Deploying an `ERC20` contract) | ~1,436,748 | ~1,520,226 |
| `ICS26Router.sol` | `ackPacket` | Acknowledging an ICS20 packet. | ~419,121 | ~502,895 |
| `ICS26Router.sol` | `timeoutPacket` | Timing out an ICS20 packet | ~471,313 | ~554,696 |

### Aggregated Packet Benchmarks

Expand All @@ -175,8 +175,8 @@ Since there is no meaningful difference in gas costs between plonk and groth16 i

| **ICS26Router Method** | **Description** | **Avg Gas (25 packets)** | **Avg Gas (50 packets)** |
|:---:|:---:|:---:|:---:|
| `multicall/recvPacket` | Receiving _back_ an `ERC20` token. | ~194,375 | ~187,866 |
| `multicall/ackPacket` | Acknowledging an ICS20 packet. | ~101,630 | ~95,815 |
| `multicall/recvPacket` | Receiving _back_ an `ERC20` token. | ~198,341 | ~191,618 |
| `multicall/ackPacket` | Acknowledging an ICS20 packet. | ~105,336 | ~99,365 |

Note: These gas benchmarks are with Groth16.

Expand Down
44 changes: 37 additions & 7 deletions abi/ICS20Transfer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
[
{
"type": "constructor",
"inputs": [
{
"name": "owner_",
"type": "address",
"internalType": "address"
}
],
"inputs": [],
"stateMutability": "nonpayable"
},
{
Expand Down Expand Up @@ -42,6 +36,19 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "initialize",
"inputs": [
{
"name": "ics26Router",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "multicall",
Expand Down Expand Up @@ -534,6 +541,19 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "event",
"name": "Initialized",
"inputs": [
{
"name": "version",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipTransferred",
Expand Down Expand Up @@ -693,6 +713,16 @@
}
]
},
{
"type": "error",
"name": "InvalidInitialization",
"inputs": []
},
{
"type": "error",
"name": "NotInitializing",
"inputs": []
},
{
"type": "error",
"name": "OwnableInvalidOwner",
Expand Down
49 changes: 42 additions & 7 deletions abi/ICS26Router.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
[
{
"type": "constructor",
"inputs": [
{
"name": "owner",
"type": "address",
"internalType": "address"
}
],
"inputs": [],
"stateMutability": "nonpayable"
},
{
Expand Down Expand Up @@ -187,6 +181,24 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "initialize",
"inputs": [
{
"name": "owner_",
"type": "address",
"internalType": "address"
},
{
"name": "icsCore",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "multicall",
Expand Down Expand Up @@ -586,6 +598,19 @@
],
"anonymous": false
},
{
"type": "event",
"name": "Initialized",
"inputs": [
{
"name": "version",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
}
],
"anonymous": false
},
{
"type": "event",
"name": "Noop",
Expand Down Expand Up @@ -992,6 +1017,11 @@
}
]
},
{
"type": "error",
"name": "InvalidInitialization",
"inputs": []
},
{
"type": "error",
"name": "InvalidMerklePrefix",
Expand All @@ -1003,6 +1033,11 @@
}
]
},
{
"type": "error",
"name": "NotInitializing",
"inputs": []
},
{
"type": "error",
"name": "OwnableInvalidOwner",
Expand Down
44 changes: 37 additions & 7 deletions abi/ICSCore.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
[
{
"type": "constructor",
"inputs": [
{
"name": "owner_",
"type": "address",
"internalType": "address"
}
],
"inputs": [],
"stateMutability": "nonpayable"
},
{
Expand Down Expand Up @@ -101,6 +95,19 @@
],
"stateMutability": "view"
},
{
"type": "function",
"name": "initialize",
"inputs": [
{
"name": "owner_",
"type": "address",
"internalType": "address"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "migrateClient",
Expand Down Expand Up @@ -243,6 +250,19 @@
],
"anonymous": false
},
{
"type": "event",
"name": "Initialized",
"inputs": [
{
"name": "version",
"type": "uint64",
"indexed": false,
"internalType": "uint64"
}
],
"anonymous": false
},
{
"type": "event",
"name": "OwnershipTransferred",
Expand Down Expand Up @@ -295,6 +315,16 @@
}
]
},
{
"type": "error",
"name": "InvalidInitialization",
"inputs": []
},
{
"type": "error",
"name": "NotInitializing",
"inputs": []
},
{
"type": "error",
"name": "OwnableInvalidOwner",
Expand Down
157 changes: 156 additions & 1 deletion abigen/ics20transfer/contract.go

Large diffs are not rendered by default.

Loading
Loading