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: switched to UUPS proxy pattern with admin management #247

Merged
merged 24 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading