Skip to content

Commit

Permalink
feat: switched to UUPS proxy pattern with admin management (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
srdtrk authored Jan 30, 2025
1 parent 864be6d commit 0448c0c
Show file tree
Hide file tree
Showing 19 changed files with 1,184 additions and 165 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ 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`. | ~160,500 | ~160,500 |
| `ICS26Router.sol` | `recvPacket` | Receiving _back_ an `ERC20` token. | ~514,011 | ~597,875 |
| `ICS26Router.sol` | `recvPacket` | Receiving a _new_ Cosmos token for the first time. (Deploying an `ERC20` contract) | ~1,364,451 | ~1,448,027 |
| `ICS26Router.sol` | `ackPacket` | Acknowledging an ICS20 packet. | ~395,232 | ~478,997 |
| `ICS26Router.sol` | `timeoutPacket` | Timing out an ICS20 packet | ~452,661 | ~536,368 |
| `ICS26Router.sol` | `recvPacket` | Receiving _back_ an `ERC20` token. | ~514,404 | ~598,268 |
| `ICS26Router.sol` | `recvPacket` | Receiving a _new_ Cosmos token for the first time. (Deploying an `ERC20` contract) | ~1,364,844 | ~1,448,420 |
| `ICS26Router.sol` | `ackPacket` | Acknowledging an ICS20 packet. | ~395,625 | ~479,390 |
| `ICS26Router.sol` | `timeoutPacket` | Timing out an ICS20 packet | ~452,966 | ~536,673 |
### Aggregated Packet Benchmarks
Expand All @@ -174,8 +174,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. | ~185,583 | ~179,324 |
| `multicall/ackPacket` | Acknowledging an ICS20 packet. | ~96,148 | ~90,485 |
| `multicall/recvPacket` | Receiving _back_ an `ERC20` token. | ~185,876 | ~179,615 |
| `multicall/ackPacket` | Acknowledging an ICS20 packet. | ~96,436 | ~90,776 |
Note: These gas benchmarks are with Groth16.
Expand Down
89 changes: 89 additions & 0 deletions abi/ICS20Transfer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
"inputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "UPGRADE_INTERFACE_VERSION",
"inputs": [],
"outputs": [
{
"name": "",
"type": "string",
"internalType": "string"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "escrow",
Expand Down Expand Up @@ -452,6 +465,19 @@
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "proxiableUUID",
"inputs": [],
"outputs": [
{
"name": "",
"type": "bytes32",
"internalType": "bytes32"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "sendTransfer",
Expand Down Expand Up @@ -508,6 +534,24 @@
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "upgradeToAndCall",
"inputs": [
{
"name": "newImplementation",
"type": "address",
"internalType": "address"
},
{
"name": "data",
"type": "bytes",
"internalType": "bytes"
}
],
"outputs": [],
"stateMutability": "payable"
},
{
"type": "event",
"name": "Initialized",
Expand All @@ -521,6 +565,19 @@
],
"anonymous": false
},
{
"type": "event",
"name": "Upgraded",
"inputs": [
{
"name": "implementation",
"type": "address",
"indexed": true,
"internalType": "address"
}
],
"anonymous": false
},
{
"type": "error",
"name": "AddressEmptyCode",
Expand All @@ -532,6 +589,22 @@
}
]
},
{
"type": "error",
"name": "ERC1967InvalidImplementation",
"inputs": [
{
"name": "implementation",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "ERC1967NonPayable",
"inputs": []
},
{
"type": "error",
"name": "FailedCall",
Expand Down Expand Up @@ -665,5 +738,21 @@
"internalType": "address"
}
]
},
{
"type": "error",
"name": "UUPSUnauthorizedCallContext",
"inputs": []
},
{
"type": "error",
"name": "UUPSUnsupportedProxiableUUID",
"inputs": [
{
"name": "slot",
"type": "bytes32",
"internalType": "bytes32"
}
]
}
]
Loading

0 comments on commit 0448c0c

Please sign in to comment.