Skip to content

Commit

Permalink
feat: Deployed SponsorPaymaster on Testnets
Browse files Browse the repository at this point in the history
Created deployment script. Deployed using script on arb sepolia. Created cmd and verification json. Deployed using cast send on matic amoy and eth sepolia.
  • Loading branch information
stigter-circle committed Sep 25, 2024
1 parent 1d2d26c commit 863e8a1
Show file tree
Hide file tree
Showing 10 changed files with 325 additions and 0 deletions.
3 changes: 3 additions & 0 deletions broadcast/012_DeploySponsorPaymaster.s.sol/11155111/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- This chain used cast send to deploy so there's no corresponding run json
- Ran command in `script/cmd/DeploySponsorPaymaster` and `script/cmd/DeploySponsorPaymasterProxy`
- tx hash: 0x491d547fd404d78e1dbc5205942ea9b404c99b8443d7538fc1c114900007b8db, 0x916f34178d7a8522a932c46c4e0829c4210058969be0f7a2837d4fa1c4784763

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"transactions": [
{
"hash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionType": "CREATE2",
"contractName": "ERC1967Proxy",
"contractAddress": "0x03df76c8c30a88f424cf3cbbc36a1ca02763103b",
"function": null,
"arguments": [
"0x36058Cc257967db1912FC276F9CBEC072CD572cb",
"0x946d92040000000000000000000000007e99c7725463a858c34d0fd69a09b11fd75087cc00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000"
],
"transaction": {
"from": "0x74cbcd3857aab24977b6ab6212f34eb381fcd976",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"gas": "0x43eff",
"value": "0x0",
"input": "0x000000000000000000000000000000000000000000000000000000000000000060806040526102d38038038061001481610194565b92833981019060408183031261018f5780516001600160a01b03811680820361018f5760208381015190936001600160401b03821161018f570184601f8201121561018f5780519061006d610068836101cf565b610194565b9582875285838301011161018f57849060005b83811061017b57505060009186010152813b15610163577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b03191682179055604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28351156101455750600080848461012c96519101845af4903d1561013c573d61011c610068826101cf565b908152600081943d92013e6101ea565b505b6040516085908161024e8239f35b606092506101ea565b9250505034610154575061012e565b63b398979f60e01b8152600490fd5b60249060405190634c9c8ce360e01b82526004820152fd5b818101830151888201840152869201610080565b600080fd5b6040519190601f01601f191682016001600160401b038111838210176101b957604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116101b957601f01601f191660200190565b9061021157508051156101ff57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580610244575b610222575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561021a56fe60806040527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e15604b573d90f35b3d90fdfea26469706673582212202b867e05fada64e8389ea34fca4e9048d8dde9af33f4fdd783dd16f9ba5fcf9c64736f6c6343000818003300000000000000000000000036058cc257967db1912fc276f9cbec072cd572cb00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064946d92040000000000000000000000007e99c7725463a858c34d0fd69a09b11fd75087cc0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x5",
"chainId": "0x66eee"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x3f4d3",
"logs": [
{
"address": "0x03df76c8c30a88f424cf3cbbc36a1ca02763103b",
"topics": [
"0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b",
"0x00000000000000000000000036058cc257967db1912fc276f9cbec072cd572cb"
],
"data": "0x",
"blockHash": "0x0ce37c294e74f38aa98f3e00ccfee25599ca133100c96d1109fc0251e106ac43",
"blockNumber": "0x4f9c4c8",
"transactionHash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionIndex": "0x2",
"logIndex": "0x1",
"removed": false
},
{
"address": "0x03df76c8c30a88f424cf3cbbc36a1ca02763103b",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000007e99c7725463a858c34d0fd69a09b11fd75087cc"
],
"data": "0x",
"blockHash": "0x0ce37c294e74f38aa98f3e00ccfee25599ca133100c96d1109fc0251e106ac43",
"blockNumber": "0x4f9c4c8",
"transactionHash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionIndex": "0x2",
"logIndex": "0x2",
"removed": false
},
{
"address": "0x03df76c8c30a88f424cf3cbbc36a1ca02763103b",
"topics": [
"0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"blockHash": "0x0ce37c294e74f38aa98f3e00ccfee25599ca133100c96d1109fc0251e106ac43",
"blockNumber": "0x4f9c4c8",
"transactionHash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionIndex": "0x2",
"logIndex": "0x3",
"removed": false
}
],
"logsBloom": "0x0000000000000000000000000000000040000000000000000080000040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000200000100000000000000000400000000000000000002000000000000000000080000000000000000000000000000000040000000000000000000080000000000000000000000008000000000000000000000000000000000000000000000000400000000000000000000000000000000000000002008000000000000000000000000020000000c000000000000000020000000000008000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionIndex": "0x2",
"blockHash": "0x0ce37c294e74f38aa98f3e00ccfee25599ca133100c96d1109fc0251e106ac43",
"blockNumber": "0x4f9c4c8",
"gasUsed": "0x32448",
"effectiveGasPrice": "0x5f5e100",
"from": "0x74cbcd3857aab24977b6ab6212f34eb381fcd976",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"contractAddress": null,
"gasUsedForL1": "0x82fc",
"l1BlockNumber": "0x66f304"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1727120414,
"chain": 421614,
"commit": "e53fec2"
}
95 changes: 95 additions & 0 deletions broadcast/012_DeploySponsorPaymaster.s.sol/421614/run-latest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"transactions": [
{
"hash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionType": "CREATE2",
"contractName": "ERC1967Proxy",
"contractAddress": "0x03df76c8c30a88f424cf3cbbc36a1ca02763103b",
"function": null,
"arguments": [
"0x36058Cc257967db1912FC276F9CBEC072CD572cb",
"0x946d92040000000000000000000000007e99c7725463a858c34d0fd69a09b11fd75087cc00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000"
],
"transaction": {
"from": "0x74cbcd3857aab24977b6ab6212f34eb381fcd976",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"gas": "0x43eff",
"value": "0x0",
"input": "0x000000000000000000000000000000000000000000000000000000000000000060806040526102d38038038061001481610194565b92833981019060408183031261018f5780516001600160a01b03811680820361018f5760208381015190936001600160401b03821161018f570184601f8201121561018f5780519061006d610068836101cf565b610194565b9582875285838301011161018f57849060005b83811061017b57505060009186010152813b15610163577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b03191682179055604051907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28351156101455750600080848461012c96519101845af4903d1561013c573d61011c610068826101cf565b908152600081943d92013e6101ea565b505b6040516085908161024e8239f35b606092506101ea565b9250505034610154575061012e565b63b398979f60e01b8152600490fd5b60249060405190634c9c8ce360e01b82526004820152fd5b818101830151888201840152869201610080565b600080fd5b6040519190601f01601f191682016001600160401b038111838210176101b957604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b0381116101b957601f01601f191660200190565b9061021157508051156101ff57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580610244575b610222575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b1561021a56fe60806040527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc54600090819081906001600160a01b0316368280378136915af43d82803e15604b573d90f35b3d90fdfea26469706673582212202b867e05fada64e8389ea34fca4e9048d8dde9af33f4fdd783dd16f9ba5fcf9c64736f6c6343000818003300000000000000000000000036058cc257967db1912fc276f9cbec072cd572cb00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000064946d92040000000000000000000000007e99c7725463a858c34d0fd69a09b11fd75087cc0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x5",
"chainId": "0x66eee"
},
"additionalContracts": [],
"isFixedGasLimit": false
}
],
"receipts": [
{
"status": "0x1",
"cumulativeGasUsed": "0x3f4d3",
"logs": [
{
"address": "0x03df76c8c30a88f424cf3cbbc36a1ca02763103b",
"topics": [
"0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b",
"0x00000000000000000000000036058cc257967db1912fc276f9cbec072cd572cb"
],
"data": "0x",
"blockHash": "0x0ce37c294e74f38aa98f3e00ccfee25599ca133100c96d1109fc0251e106ac43",
"blockNumber": "0x4f9c4c8",
"transactionHash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionIndex": "0x2",
"logIndex": "0x1",
"removed": false
},
{
"address": "0x03df76c8c30a88f424cf3cbbc36a1ca02763103b",
"topics": [
"0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0000000000000000000000007e99c7725463a858c34d0fd69a09b11fd75087cc"
],
"data": "0x",
"blockHash": "0x0ce37c294e74f38aa98f3e00ccfee25599ca133100c96d1109fc0251e106ac43",
"blockNumber": "0x4f9c4c8",
"transactionHash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionIndex": "0x2",
"logIndex": "0x2",
"removed": false
},
{
"address": "0x03df76c8c30a88f424cf3cbbc36a1ca02763103b",
"topics": [
"0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000001",
"blockHash": "0x0ce37c294e74f38aa98f3e00ccfee25599ca133100c96d1109fc0251e106ac43",
"blockNumber": "0x4f9c4c8",
"transactionHash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionIndex": "0x2",
"logIndex": "0x3",
"removed": false
}
],
"logsBloom": "0x0000000000000000000000000000000040000000000000000080000040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000200000100000000000000000400000000000000000002000000000000000000080000000000000000000000000000000040000000000000000000080000000000000000000000008000000000000000000000000000000000000000000000000400000000000000000000000000000000000000002008000000000000000000000000020000000c000000000000000020000000000008000000000000000000000000000000000000000000000000000000",
"type": "0x2",
"transactionHash": "0x318a1a912cc7de29777cadb9b951410f96deb304500e32231e13dbcb37a1fbb3",
"transactionIndex": "0x2",
"blockHash": "0x0ce37c294e74f38aa98f3e00ccfee25599ca133100c96d1109fc0251e106ac43",
"blockNumber": "0x4f9c4c8",
"gasUsed": "0x32448",
"effectiveGasPrice": "0x5f5e100",
"from": "0x74cbcd3857aab24977b6ab6212f34eb381fcd976",
"to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
"contractAddress": null,
"gasUsedForL1": "0x82fc",
"l1BlockNumber": "0x66f304"
}
],
"libraries": [],
"pending": [],
"returns": {},
"timestamp": 1727120414,
"chain": 421614,
"commit": "e53fec2"
}
3 changes: 3 additions & 0 deletions broadcast/012_DeploySponsorPaymaster.s.sol/80002/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- This chain used cast send to deploy so there's no corresponding run json
- Ran command in `script/cmd/DeploySponsorPaymaster` and `script/cmd/DeploySponsorPaymasterProxy`
- tx hash: 0x4a6b2a5517a8c765e3edc51a4eea363eef99b8c320bcd01042cd176118a8026b, 0xbe739f09f80df75fd48805d15bfb604da724234d0c8d35008ab014643235ccc9
60 changes: 60 additions & 0 deletions script/012_DeploySponsorPaymaster.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright 2024 Circle Internet Group, Inc. All rights reserved.
* SPDX-License-Identifier: GPL-3.0-or-later
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
pragma solidity 0.8.24;

import {SponsorPaymaster} from "../src/paymaster/v1/permissioned/SponsorPaymaster.sol";

import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol";
import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
import {Script} from "forge-std/src/Script.sol";
import {console} from "forge-std/src/console.sol";

contract DeploySponsorPaymaster is Script {
address payable constant EXPECTED_PAYMASTER_ADDRESS = payable(address(0x36058Cc257967db1912FC276F9CBEC072CD572cb));
address payable constant EXPECTED_PAYMASTER_PROXY_ADDRESS =
payable(address(0x03dF76C8c30A88f424CF3CBBC36A1Ca02763103b));

function run() public {
address entryPoint = vm.envAddress("ENTRY_POINT");

vm.startBroadcast(vm.envUint("DEPLOYER_PRIVATE_KEY"));

SponsorPaymaster paymaster;
if (EXPECTED_PAYMASTER_ADDRESS.code.length == 0) {
paymaster = new SponsorPaymaster{salt: 0}(IEntryPoint(entryPoint));
} else {
paymaster = SponsorPaymaster(EXPECTED_PAYMASTER_ADDRESS);
}
console.log("Paymaster address: %s", address(paymaster));

ERC1967Proxy proxy;
if (EXPECTED_PAYMASTER_PROXY_ADDRESS.code.length == 0) {
address[] memory verifySigners = new address[](0);
address paymasterOwner = vm.envAddress("PAYMASTER_OWNER");
bytes memory data = abi.encodeCall(paymaster.initialize, (paymasterOwner, verifySigners));

proxy = new ERC1967Proxy{salt: 0}(address(paymaster), data);
} else {
proxy = ERC1967Proxy(EXPECTED_PAYMASTER_PROXY_ADDRESS);
}
console.log("Proxy address: %s", address(proxy));

vm.stopBroadcast();
}
}
Loading

0 comments on commit 863e8a1

Please sign in to comment.