From d282d9224c706a4d1a1e1a328b87633d04611931 Mon Sep 17 00:00:00 2001 From: Kevin Halliday Date: Wed, 4 Sep 2024 08:57:39 -0400 Subject: [PATCH] feat(e2e): add gas pump deployments and tests (#1805) Adds gas pump / station deployments to e2e app / tests. issue: #1686 --- contracts/bindings/omnigaspump.go | 2 +- contracts/bindings/omnigasstation.go | 34 +-- contracts/core/.gas-snapshot | 6 +- contracts/core/src/token/OmniGasPump.sol | 2 +- contracts/core/src/token/OmniGasStation.sol | 26 +- .../core/test/token/OmniGasStation.t.sol | 6 +- e2e/app/gaspump.go | 228 ++++++++++++++++++ e2e/app/run.go | 8 + e2e/test/gaspump_test.go | 41 ++++ lib/contracts/gasstation/deploy.go | 32 ++- 10 files changed, 351 insertions(+), 34 deletions(-) create mode 100644 e2e/app/gaspump.go create mode 100644 e2e/test/gaspump_test.go diff --git a/contracts/bindings/omnigaspump.go b/contracts/bindings/omnigaspump.go index f79109328..a236b35cd 100644 --- a/contracts/bindings/omnigaspump.go +++ b/contracts/bindings/omnigaspump.go @@ -42,7 +42,7 @@ type OmniGasPumpInitParams struct { // OmniGasPumpMetaData contains all meta data concerning the OmniGasPump contract. var OmniGasPumpMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"SETTLE_GAS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"TOLL_DENOM\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"defaultConfLevel\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"dryFillUp\",\"inputs\":[{\"name\":\"amtETH\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"fillUp\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"gasStation\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"p\",\"type\":\"tuple\",\"internalType\":\"structOmniGasPump.InitParams\",\"components\":[{\"name\":\"gasStation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"oracle\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"portal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxSwap\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"toll\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"maxSwap\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"omni\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOmniPortal\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"oracle\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIConversionRateOracle\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owed\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"quote\",\"inputs\":[{\"name\":\"amtOMNI\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGasStation\",\"inputs\":[{\"name\":\"station\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMaxSwap\",\"inputs\":[{\"name\":\"max\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setOracle\",\"inputs\":[{\"name\":\"oracle_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setToll\",\"inputs\":[{\"name\":\"pct\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"toll\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"xfee\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"DefaultConfLevelSet\",\"inputs\":[{\"name\":\"conf\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"FilledUp\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"owed\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amtETH\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"fee\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"toll\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"amtOMNI\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GasStationSet\",\"inputs\":[{\"name\":\"station\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MaxSwapSet\",\"inputs\":[{\"name\":\"max\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OmniPortalSet\",\"inputs\":[{\"name\":\"omni\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OracleSet\",\"inputs\":[{\"name\":\"oracle\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TollSet\",\"inputs\":[{\"name\":\"pct\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EnforcedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ExpectedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x608060405234801561001057600080fd5b5061001961001e565b6100d0565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6117ef806100df6000396000f3fe6080604052600436106101665760003560e01c80637adbf973116100d1578063a67265b11161008a578063dbb602fd11610064578063dbb602fd14610440578063df18e04714610460578063ed1bd76c1461048d578063f2fde38b146104ad57600080fd5b8063a67265b1146103da578063c4918b4e146103fa578063ca48b20b1461041057600080fd5b80637adbf973146103135780637dc0d1d0146103335780638456cb59146103535780638aec67fe146103685780638da5cb5b1461037d578063a3dace5d146103ba57600080fd5b80634b260981116101235780634b2609811461023657806351cff8d91461024c57806355e0af6b1461026c5780635c975abb1461029b578063715018a6146102cb57806374eeb847146102e057600080fd5b806308a957a91461016b5780630e6e91d81461018d578063285aaa20146101ad57806339acf9f1146101d65780633f4ba83a1461020e5780634ae809ee14610223575b600080fd5b34801561017757600080fd5b5061018b610186366004611590565b6104cd565b005b34801561019957600080fd5b5061018b6101a83660046115b9565b6104e1565b3480156101b957600080fd5b506101c360355481565b6040519081526020015b60405180910390f35b3480156101e257600080fd5b506000546101f6906001600160a01b031681565b6040516001600160a01b0390911681526020016101cd565b34801561021a57600080fd5b5061018b6104f2565b6101c3610231366004611590565b610504565b34801561024257600080fd5b506101c36103e881565b34801561025857600080fd5b5061018b610267366004611590565b61071c565b34801561027857600080fd5b5061028c6102873660046115b9565b6107cb565b6040516101cd93929190611618565b3480156102a757600080fd5b5060008051602061179a8339815191525460ff1660405190151581526020016101cd565b3480156102d757600080fd5b5061018b6108ad565b3480156102ec57600080fd5b5060005461030190600160a01b900460ff1681565b60405160ff90911681526020016101cd565b34801561031f57600080fd5b5061018b61032e366004611590565b6108bf565b34801561033f57600080fd5b506032546101f6906001600160a01b031681565b34801561035f57600080fd5b5061018b6108d0565b34801561037457600080fd5b506101c36108e0565b34801561038957600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03166101f6565b3480156103c657600080fd5b5061018b6103d53660046115b9565b61094e565b3480156103e657600080fd5b5061018b6103f5366004611642565b61095f565b34801561040657600080fd5b506101c360345481565b34801561041c57600080fd5b50610427620186a081565b60405167ffffffffffffffff90911681526020016101cd565b34801561044c57600080fd5b506033546101f6906001600160a01b031681565b34801561046c57600080fd5b506101c361047b366004611590565b60366020526000908152604090205481565b34801561049957600080fd5b506101c36104a83660046115b9565b610adf565b3480156104b957600080fd5b5061018b6104c8366004611590565b610b38565b6104d5610b73565b6104de81610bce565b50565b6104e9610b73565b6104de81610c79565b6104fa610b73565b610502610cf6565b565b600061050e610d50565b60006105186108e0565b90508034101561056f5760405162461bcd60e51b815260206004820152601d60248201527f4f6d6e6947617350756d703a20696e73756666696369656e742066656500000060448201526064015b60405180910390fd5b600061057b8234611670565b90506034548111156105c75760405162461bcd60e51b815260206004820152601560248201527409edadcd28ec2e6a0eadae07440deeccae440dac2f605b1b6044820152606401610566565b60006103e8603554836105da9190611683565b6105e4919061169a565b90506105f08183611670565b915060006105fd83610d81565b6001600160a01b03871660009081526036602052604081208054929350839290919061062a9084906116bc565b909155506106a7905061063b610e97565b6033546001600160a01b038981166000818152603660205260409081902054905160248101929092526044820152600192919091169060640160408051601f198184030181529190526020810180516001600160e01b0316631decdcfb60e11b179052620186a0610f14565b506001600160a01b038616600081815260366020908152604091829020548251908152349181019190915290810186905260608101849052608081018390527f7737fe59897f758714c24688a6470bb05235f01af1f4293edd0c290e651dd8319060a00160405180910390a295945050505050565b610724610b73565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610771576040519150601f19603f3d011682016040523d82523d6000602084013e610776565b606091505b50509050806107c75760405162461bcd60e51b815260206004820152601c60248201527f4f6d6e6947617350756d703a207769746864726177206661696c6564000000006044820152606401610566565b5050565b600080606060006107da6108e0565b90508085101561081957505060408051808201909152601081526f696e73756666696369656e742066656560801b6020820152600092508291506108a6565b6108238186611670565b945060345485111561085c5750506040805180820190915260088152670deeccae440dac2f60c31b6020820152600092508291506108a6565b6103e86035548661086d9190611683565b610877919061169a565b6108819086611670565b945061088c85610d81565b600160405180602001604052806000815250935093509350505b9193909250565b6108b5610b73565b610502600061105e565b6108c7610b73565b6104de816110cf565b6108d8610b73565b610502611173565b60006001600160a01b036000196109476108f8610e97565b6040516001600160a01b03851660248201526044810184905260640160408051601f198184030181529190526020810180516001600160e01b0316631decdcfb60e11b179052620186a06111bc565b9250505090565b610956610b73565b6104de8161123a565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156109a55750825b905060008267ffffffffffffffff1660011480156109c25750303b155b9050811580156109d0575080155b156109ee5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a1857845460ff60401b1916600160401b1785555b610a30610a2b6040880160208901611590565b6110cf565b610a45610a406020880188611590565b610bce565b610a528660800135610c79565b610a5f8660a0013561123a565b610a79610a726060880160408901611590565b60016112c0565b610a91610a8c6080880160608901611590565b6112da565b8315610ad757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b600080610aeb836112eb565b90506035546103e8610afd9190611670565b610b096103e883611683565b610b13919061169a565b610b1d90826116bc565b9050610b276108e0565b610b3190826116bc565b9392505050565b610b40610b73565b6001600160a01b038116610b6a57604051631e4fbdf760e01b815260006004820152602401610566565b6104de8161105e565b33610ba57f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146105025760405163118cdaa760e01b8152336004820152602401610566565b6001600160a01b038116610c245760405162461bcd60e51b815260206004820152601960248201527f4f6d6e6947617350756d703a207a65726f2061646472657373000000000000006044820152606401610566565b603380546001600160a01b0319166001600160a01b0383169081179091556040519081527ffd263e3b7583e8397be8a61710d1105cf8c0f111bbac1014d0ec7dbcd1e422f1906020015b60405180910390a150565b60008111610cc15760405162461bcd60e51b815260206004820152601560248201527409edadcd28ec2e6a0eadae07440f4cae4de40dac2f605b1b6044820152606401610566565b60348190556040518181527f343ecf9262f8cafd2e9b0ffdab9f14bf18a17899eeef3e41133e84c354e5298390602001610c6e565b610cfe6113b7565b60008051602061179a833981519152805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b039091168152602001610c6e565b60008051602061179a8339815191525460ff16156105025760405163d93c066560e01b815260040160405180910390fd5b6032546000906001600160a01b0316638b7bfd70610d9d610e97565b6040516001600160e01b031960e084901b16815267ffffffffffffffff9091166004820152602401602060405180830381865afa158015610de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0691906116cf565b603260009054906101000a90046001600160a01b03166001600160a01b0316638f9d6ace6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7d91906116cf565b610e879084611683565b610e91919061169a565b92915050565b60008060009054906101000a90046001600160a01b03166001600160a01b031663110ff5f16040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0f91906116e8565b905090565b60008054604051632376548f60e21b815282916001600160a01b031690638dd9523c90610f49908a9088908890600401611712565b602060405180830381865afa158015610f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8a91906116cf565b90508047101580610f9b5750803410155b610fe75760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e73756666696369656e742066756e647300000000000000006044820152606401610566565b60005460405163c21dda4f60e01b81526001600160a01b039091169063c21dda4f908390611021908b908b908b908b908b90600401611749565b6000604051808303818588803b15801561103a57600080fd5b505af115801561104e573d6000803e3d6000fd5b50939a9950505050505050505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6001600160a01b0381166111255760405162461bcd60e51b815260206004820152601860248201527f4f6d6e6947617350756d703a207a65726f206f7261636c6500000000000000006044820152606401610566565b603280546001600160a01b0319166001600160a01b0383169081179091556040519081527f3f32684a32a11dabdbb8c0177de80aa3ae36a004d75210335b49e544e48cd0aa90602001610c6e565b61117b610d50565b60008051602061179a833981519152805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833610d38565b60008054604051632376548f60e21b81526001600160a01b0390911690638dd9523c906111f190879087908790600401611712565b602060405180830381865afa15801561120e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123291906116cf565b949350505050565b6103e8811061128b5760405162461bcd60e51b815260206004820152601960248201527f4f6d6e6947617350756d703a2070637420746f6f2068696768000000000000006044820152606401610566565b60358190556040518181527f0b3d400288f60ce0f5632cd941b5748faa91ebea844cbe78c5180b7838a0933f90602001610c6e565b6112c86113e7565b6112d182611430565b6107c7816114c9565b6112e26113e7565b6104de8161156c565b603254604080516347ceb56760e11b815290516000926001600160a01b031691638f9d6ace9160048083019260209291908290030181865afa158015611335573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135991906116cf565b6032546001600160a01b0316638b7bfd70611372610e97565b6040516001600160e01b031960e084901b16815267ffffffffffffffff9091166004820152602401602060405180830381865afa158015610e59573d6000803e3d6000fd5b60008051602061179a8339815191525460ff1661050257604051638dfc202b60e01b815260040160405180910390fd5b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661050257604051631afcd79f60e31b815260040160405180910390fd5b6001600160a01b03811661147b5760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b6044820152606401610566565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f4790602001610c6e565b6114d281611574565b61151e5760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e76616c696420636f6e66206c6576656c00000000000000006044820152606401610566565b6000805460ff60a01b1916600160a01b60ff8416908102919091179091556040519081527f8de08a798b4e50b4f351c1eaa91a11530043802be3ffac2df87db0c45a2e848390602001610c6e565b610b406113e7565b600060ff821660011480610e91575060ff821660041492915050565b6000602082840312156115a257600080fd5b81356001600160a01b0381168114610b3157600080fd5b6000602082840312156115cb57600080fd5b5035919050565b6000815180845260005b818110156115f8576020818501810151868301820152016115dc565b506000602082860101526020601f19601f83011685010191505092915050565b838152821515602082015260606040820152600061163960608301846115d2565b95945050505050565b600060c0828403121561165457600080fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e9157610e9161165a565b8082028115828204841417610e9157610e9161165a565b6000826116b757634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610e9157610e9161165a565b6000602082840312156116e157600080fd5b5051919050565b6000602082840312156116fa57600080fd5b815167ffffffffffffffff81168114610b3157600080fd5b600067ffffffffffffffff80861683526060602084015261173660608401866115d2565b9150808416604084015250949350505050565b600067ffffffffffffffff808816835260ff8716602084015260018060a01b038616604084015260a0606084015261178460a08401866115d2565b9150808416608084015250969550505050505056fecd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a2646970667358221220590150f42c4b3651dcceb7d1073c968bfa083fd836e37612833b815e8700ce4e64736f6c63430008180033", + Bin: "0x608060405234801561001057600080fd5b5061001961001e565b6100d0565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6117ef806100df6000396000f3fe6080604052600436106101665760003560e01c80637adbf973116100d1578063a67265b11161008a578063dbb602fd11610064578063dbb602fd14610440578063df18e04714610460578063ed1bd76c1461048d578063f2fde38b146104ad57600080fd5b8063a67265b1146103da578063c4918b4e146103fa578063ca48b20b1461041057600080fd5b80637adbf973146103135780637dc0d1d0146103335780638456cb59146103535780638aec67fe146103685780638da5cb5b1461037d578063a3dace5d146103ba57600080fd5b80634b260981116101235780634b2609811461023657806351cff8d91461024c57806355e0af6b1461026c5780635c975abb1461029b578063715018a6146102cb57806374eeb847146102e057600080fd5b806308a957a91461016b5780630e6e91d81461018d578063285aaa20146101ad57806339acf9f1146101d65780633f4ba83a1461020e5780634ae809ee14610223575b600080fd5b34801561017757600080fd5b5061018b610186366004611590565b6104cd565b005b34801561019957600080fd5b5061018b6101a83660046115b9565b6104e1565b3480156101b957600080fd5b506101c360355481565b6040519081526020015b60405180910390f35b3480156101e257600080fd5b506000546101f6906001600160a01b031681565b6040516001600160a01b0390911681526020016101cd565b34801561021a57600080fd5b5061018b6104f2565b6101c3610231366004611590565b610504565b34801561024257600080fd5b506101c36103e881565b34801561025857600080fd5b5061018b610267366004611590565b61071c565b34801561027857600080fd5b5061028c6102873660046115b9565b6107cb565b6040516101cd93929190611618565b3480156102a757600080fd5b5060008051602061179a8339815191525460ff1660405190151581526020016101cd565b3480156102d757600080fd5b5061018b6108ad565b3480156102ec57600080fd5b5060005461030190600160a01b900460ff1681565b60405160ff90911681526020016101cd565b34801561031f57600080fd5b5061018b61032e366004611590565b6108bf565b34801561033f57600080fd5b506032546101f6906001600160a01b031681565b34801561035f57600080fd5b5061018b6108d0565b34801561037457600080fd5b506101c36108e0565b34801561038957600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03166101f6565b3480156103c657600080fd5b5061018b6103d53660046115b9565b61094e565b3480156103e657600080fd5b5061018b6103f5366004611642565b61095f565b34801561040657600080fd5b506101c360345481565b34801561041c57600080fd5b50610427620222e081565b60405167ffffffffffffffff90911681526020016101cd565b34801561044c57600080fd5b506033546101f6906001600160a01b031681565b34801561046c57600080fd5b506101c361047b366004611590565b60366020526000908152604090205481565b34801561049957600080fd5b506101c36104a83660046115b9565b610adf565b3480156104b957600080fd5b5061018b6104c8366004611590565b610b38565b6104d5610b73565b6104de81610bce565b50565b6104e9610b73565b6104de81610c79565b6104fa610b73565b610502610cf6565b565b600061050e610d50565b60006105186108e0565b90508034101561056f5760405162461bcd60e51b815260206004820152601d60248201527f4f6d6e6947617350756d703a20696e73756666696369656e742066656500000060448201526064015b60405180910390fd5b600061057b8234611670565b90506034548111156105c75760405162461bcd60e51b815260206004820152601560248201527409edadcd28ec2e6a0eadae07440deeccae440dac2f605b1b6044820152606401610566565b60006103e8603554836105da9190611683565b6105e4919061169a565b90506105f08183611670565b915060006105fd83610d81565b6001600160a01b03871660009081526036602052604081208054929350839290919061062a9084906116bc565b909155506106a7905061063b610e97565b6033546001600160a01b038981166000818152603660205260409081902054905160248101929092526044820152600192919091169060640160408051601f198184030181529190526020810180516001600160e01b0316631decdcfb60e11b179052620222e0610f14565b506001600160a01b038616600081815260366020908152604091829020548251908152349181019190915290810186905260608101849052608081018390527f7737fe59897f758714c24688a6470bb05235f01af1f4293edd0c290e651dd8319060a00160405180910390a295945050505050565b610724610b73565b6000816001600160a01b03164760405160006040518083038185875af1925050503d8060008114610771576040519150601f19603f3d011682016040523d82523d6000602084013e610776565b606091505b50509050806107c75760405162461bcd60e51b815260206004820152601c60248201527f4f6d6e6947617350756d703a207769746864726177206661696c6564000000006044820152606401610566565b5050565b600080606060006107da6108e0565b90508085101561081957505060408051808201909152601081526f696e73756666696369656e742066656560801b6020820152600092508291506108a6565b6108238186611670565b945060345485111561085c5750506040805180820190915260088152670deeccae440dac2f60c31b6020820152600092508291506108a6565b6103e86035548661086d9190611683565b610877919061169a565b6108819086611670565b945061088c85610d81565b600160405180602001604052806000815250935093509350505b9193909250565b6108b5610b73565b610502600061105e565b6108c7610b73565b6104de816110cf565b6108d8610b73565b610502611173565b60006001600160a01b036000196109476108f8610e97565b6040516001600160a01b03851660248201526044810184905260640160408051601f198184030181529190526020810180516001600160e01b0316631decdcfb60e11b179052620222e06111bc565b9250505090565b610956610b73565b6104de8161123a565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156109a55750825b905060008267ffffffffffffffff1660011480156109c25750303b155b9050811580156109d0575080155b156109ee5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a1857845460ff60401b1916600160401b1785555b610a30610a2b6040880160208901611590565b6110cf565b610a45610a406020880188611590565b610bce565b610a528660800135610c79565b610a5f8660a0013561123a565b610a79610a726060880160408901611590565b60016112c0565b610a91610a8c6080880160608901611590565b6112da565b8315610ad757845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b600080610aeb836112eb565b90506035546103e8610afd9190611670565b610b096103e883611683565b610b13919061169a565b610b1d90826116bc565b9050610b276108e0565b610b3190826116bc565b9392505050565b610b40610b73565b6001600160a01b038116610b6a57604051631e4fbdf760e01b815260006004820152602401610566565b6104de8161105e565b33610ba57f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146105025760405163118cdaa760e01b8152336004820152602401610566565b6001600160a01b038116610c245760405162461bcd60e51b815260206004820152601960248201527f4f6d6e6947617350756d703a207a65726f2061646472657373000000000000006044820152606401610566565b603380546001600160a01b0319166001600160a01b0383169081179091556040519081527ffd263e3b7583e8397be8a61710d1105cf8c0f111bbac1014d0ec7dbcd1e422f1906020015b60405180910390a150565b60008111610cc15760405162461bcd60e51b815260206004820152601560248201527409edadcd28ec2e6a0eadae07440f4cae4de40dac2f605b1b6044820152606401610566565b60348190556040518181527f343ecf9262f8cafd2e9b0ffdab9f14bf18a17899eeef3e41133e84c354e5298390602001610c6e565b610cfe6113b7565b60008051602061179a833981519152805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b039091168152602001610c6e565b60008051602061179a8339815191525460ff16156105025760405163d93c066560e01b815260040160405180910390fd5b6032546000906001600160a01b0316638b7bfd70610d9d610e97565b6040516001600160e01b031960e084901b16815267ffffffffffffffff9091166004820152602401602060405180830381865afa158015610de2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0691906116cf565b603260009054906101000a90046001600160a01b03166001600160a01b0316638f9d6ace6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7d91906116cf565b610e879084611683565b610e91919061169a565b92915050565b60008060009054906101000a90046001600160a01b03166001600160a01b031663110ff5f16040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0f91906116e8565b905090565b60008054604051632376548f60e21b815282916001600160a01b031690638dd9523c90610f49908a9088908890600401611712565b602060405180830381865afa158015610f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8a91906116cf565b90508047101580610f9b5750803410155b610fe75760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e73756666696369656e742066756e647300000000000000006044820152606401610566565b60005460405163c21dda4f60e01b81526001600160a01b039091169063c21dda4f908390611021908b908b908b908b908b90600401611749565b6000604051808303818588803b15801561103a57600080fd5b505af115801561104e573d6000803e3d6000fd5b50939a9950505050505050505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6001600160a01b0381166111255760405162461bcd60e51b815260206004820152601860248201527f4f6d6e6947617350756d703a207a65726f206f7261636c6500000000000000006044820152606401610566565b603280546001600160a01b0319166001600160a01b0383169081179091556040519081527f3f32684a32a11dabdbb8c0177de80aa3ae36a004d75210335b49e544e48cd0aa90602001610c6e565b61117b610d50565b60008051602061179a833981519152805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833610d38565b60008054604051632376548f60e21b81526001600160a01b0390911690638dd9523c906111f190879087908790600401611712565b602060405180830381865afa15801561120e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123291906116cf565b949350505050565b6103e8811061128b5760405162461bcd60e51b815260206004820152601960248201527f4f6d6e6947617350756d703a2070637420746f6f2068696768000000000000006044820152606401610566565b60358190556040518181527f0b3d400288f60ce0f5632cd941b5748faa91ebea844cbe78c5180b7838a0933f90602001610c6e565b6112c86113e7565b6112d182611430565b6107c7816114c9565b6112e26113e7565b6104de8161156c565b603254604080516347ceb56760e11b815290516000926001600160a01b031691638f9d6ace9160048083019260209291908290030181865afa158015611335573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135991906116cf565b6032546001600160a01b0316638b7bfd70611372610e97565b6040516001600160e01b031960e084901b16815267ffffffffffffffff9091166004820152602401602060405180830381865afa158015610e59573d6000803e3d6000fd5b60008051602061179a8339815191525460ff1661050257604051638dfc202b60e01b815260040160405180910390fd5b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661050257604051631afcd79f60e31b815260040160405180910390fd5b6001600160a01b03811661147b5760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b6044820152606401610566565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f4790602001610c6e565b6114d281611574565b61151e5760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e76616c696420636f6e66206c6576656c00000000000000006044820152606401610566565b6000805460ff60a01b1916600160a01b60ff8416908102919091179091556040519081527f8de08a798b4e50b4f351c1eaa91a11530043802be3ffac2df87db0c45a2e848390602001610c6e565b610b406113e7565b600060ff821660011480610e91575060ff821660041492915050565b6000602082840312156115a257600080fd5b81356001600160a01b0381168114610b3157600080fd5b6000602082840312156115cb57600080fd5b5035919050565b6000815180845260005b818110156115f8576020818501810151868301820152016115dc565b506000602082860101526020601f19601f83011685010191505092915050565b838152821515602082015260606040820152600061163960608301846115d2565b95945050505050565b600060c0828403121561165457600080fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610e9157610e9161165a565b8082028115828204841417610e9157610e9161165a565b6000826116b757634e487b7160e01b600052601260045260246000fd5b500490565b80820180821115610e9157610e9161165a565b6000602082840312156116e157600080fd5b5051919050565b6000602082840312156116fa57600080fd5b815167ffffffffffffffff81168114610b3157600080fd5b600067ffffffffffffffff80861683526060602084015261173660608401866115d2565b9150808416604084015250949350505050565b600067ffffffffffffffff808816835260ff8716602084015260018060a01b038616604084015260a0606084015261178460a08401866115d2565b9150808416608084015250969550505050505056fecd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a264697066735822122011e9f8aff9b25471a057f220474258ee3e66a7283c37765a4c09c1b5ccba34e664736f6c63430008180033", } // OmniGasPumpABI is the input ABI used to generate the binding from. diff --git a/contracts/bindings/omnigasstation.go b/contracts/bindings/omnigasstation.go index f0c68ff18..3bfcb9a40 100644 --- a/contracts/bindings/omnigasstation.go +++ b/contracts/bindings/omnigasstation.go @@ -29,10 +29,16 @@ var ( _ = abi.ConvertType ) +// OmniGasStationGasPump is an auto generated low-level Go binding around an user-defined struct. +type OmniGasStationGasPump struct { + ChainID uint64 + Addr common.Address +} + // OmniGasStationMetaData contains all meta data concerning the OmniGasStation contract. var OmniGasStationMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"defaultConfLevel\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"fueled\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"portal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isPump\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"omni\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOmniPortal\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pumps\",\"inputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPump\",\"inputs\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"settleUp\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"owed\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"DefaultConfLevelSet\",\"inputs\":[{\"name\":\"conf\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GasPumpAdded\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OmniPortalSet\",\"inputs\":[{\"name\":\"omni\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SettledUp\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"chainID\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"owed\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"fueled\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"success\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EnforcedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ExpectedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", - Bin: "0x608060405234801561001057600080fd5b5061001961001e565b6100d0565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b610f51806100df6000396000f3fe6080604052600436106100e15760003560e01c8063715018a61161007f5780638da5cb5b116100595780638da5cb5b14610265578063bac34036146102a2578063ed116d08146102e8578063f2fde38b1461030857600080fd5b8063715018a61461020857806374eeb8471461021d5780638456cb591461025057600080fd5b8063485cc955116100bb578063485cc955146101615780634afa17dd146101815780634e0dc4f0146101a15780635c975abb146101d757600080fd5b806339acf9f1146100ed5780633bd9b9f61461012a5780633f4ba83a1461014c57600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5060005461010d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013657600080fd5b5061014a610145366004610d43565b610328565b005b34801561015857600080fd5b5061014a6105fa565b34801561016d57600080fd5b5061014a61017c366004610d6f565b61060c565b34801561018d57600080fd5b5061014a61019c366004610dbe565b610728565b3480156101ad57600080fd5b5061010d6101bc366004610ddc565b6032602052600090815260409020546001600160a01b031681565b3480156101e357600080fd5b50600080516020610efc8339815191525460ff165b6040519015158152602001610121565b34801561021457600080fd5b5061014a610845565b34801561022957600080fd5b5060005461023e90600160a01b900460ff1681565b60405160ff9091168152602001610121565b34801561025c57600080fd5b5061014a610857565b34801561027157600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031661010d565b3480156102ae57600080fd5b506102da6102bd366004610e00565b603360209081526000928352604080842090915290825290205481565b604051908152602001610121565b3480156102f457600080fd5b506101f8610303366004610dbe565b610867565b34801561031457600080fd5b5061014a610323366004610e2e565b6108ae565b60005460408051631799380760e11b815281516001600160a01b0390931692632f32700e926004808401939192918290030181865afa15801561036f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103939190610e4b565b8051600180546020909301516001600160a01b0316600160401b026001600160e01b031990931667ffffffffffffffff909216919091179190911790556103d86108ec565b6103e061091d565b801561040f575060015461040f9067ffffffffffffffff811690600160401b90046001600160a01b0316610867565b6104605760405162461bcd60e51b815260206004820152601860248201527f47617353746174696f6e3a20756e617574686f72697a6564000000000000000060448201526064015b60405180910390fd5b6001600160a01b038216600090815260336020908152604080832060015467ffffffffffffffff1684529091529020548082116104df5760405162461bcd60e51b815260206004820152601a60248201527f47617353746174696f6e3a20616c72656164792066756e6465640000000000006044820152606401610457565b60006001600160a01b0384166104f58385610eb8565b604051600081818185875af1925050503d8060008114610531576040519150601f19603f3d011682016040523d82523d6000602084013e610536565b606091505b505090508015610573576001600160a01b038416600090815260336020908152604080832060015467ffffffffffffffff16845290915290208390555b6001546001600160a01b038516600081815260336020908152604080832067ffffffffffffffff90951680845294825291829020548251888152918201528415158183015290517f4264b2d9471008d8513ddd06a5da387491ccaf43988f604f5eca833d30551c9d9181900360600190a35050600180546001600160e01b03191690555050565b6106026109b0565b61060a610a0b565b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156106525750825b905060008267ffffffffffffffff16600114801561066f5750303b155b90508115801561067d575080155b1561069b5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106c557845460ff60401b1916600160401b1785555b6106d0876004610a6c565b6106d986610a8a565b831561071f57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50505050505050565b6107306109b0565b6001600160a01b03811661077e5760405162461bcd60e51b815260206004820152601560248201527423b0b9a9ba30ba34b7b71d103d32b9379030b2323960591b6044820152606401610457565b8167ffffffffffffffff166000036107d85760405162461bcd60e51b815260206004820152601860248201527f47617353746174696f6e3a207a65726f20636861696e496400000000000000006044820152606401610457565b67ffffffffffffffff821660008181526032602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915591519182527f193d7693e9edcedc2357451dd62125041be2c877aa64852b126906cd438f08f5910160405180910390a25050565b61084d6109b0565b61060a6000610a9b565b61085f6109b0565b61060a610b0c565b60006001600160a01b038216158015906108a5575067ffffffffffffffff83166000908152603260205260409020546001600160a01b038381169116145b90505b92915050565b6108b66109b0565b6001600160a01b0381166108e057604051631e4fbdf760e01b815260006004820152602401610457565b6108e981610a9b565b50565b600080516020610efc8339815191525460ff161561060a5760405163d93c066560e01b815260040160405180910390fd5b60008060009054906101000a90046001600160a01b03166001600160a01b03166355e2448e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610971573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109959190610ed9565b80156109ab57506000546001600160a01b031633145b905090565b336109e27f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b03161461060a5760405163118cdaa760e01b8152336004820152602401610457565b610a13610b55565b600080516020610efc833981519152805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b0390911681526020015b60405180910390a150565b610a74610b85565b610a7d82610bce565b610a8681610c67565b5050565b610a92610b85565b6108e981610d0a565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b610b146108ec565b600080516020610efc833981519152805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833610a4d565b600080516020610efc8339815191525460ff1661060a57604051638dfc202b60e01b815260040160405180910390fd5b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661060a57604051631afcd79f60e31b815260040160405180910390fd5b6001600160a01b038116610c195760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b6044820152606401610457565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f4790602001610a61565b610c7081610d12565b610cbc5760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e76616c696420636f6e66206c6576656c00000000000000006044820152606401610457565b6000805460ff60a01b1916600160a01b60ff8416908102919091179091556040519081527f8de08a798b4e50b4f351c1eaa91a11530043802be3ffac2df87db0c45a2e848390602001610a61565b6108b6610b85565b600060ff8216600114806108a8575060ff821660041492915050565b6001600160a01b03811681146108e957600080fd5b60008060408385031215610d5657600080fd5b8235610d6181610d2e565b946020939093013593505050565b60008060408385031215610d8257600080fd5b8235610d8d81610d2e565b91506020830135610d9d81610d2e565b809150509250929050565b67ffffffffffffffff811681146108e957600080fd5b60008060408385031215610dd157600080fd5b8235610d8d81610da8565b600060208284031215610dee57600080fd5b8135610df981610da8565b9392505050565b60008060408385031215610e1357600080fd5b8235610e1e81610d2e565b91506020830135610d9d81610da8565b600060208284031215610e4057600080fd5b8135610df981610d2e565b600060408284031215610e5d57600080fd5b6040516040810181811067ffffffffffffffff82111715610e8e57634e487b7160e01b600052604160045260246000fd5b6040528251610e9c81610da8565b81526020830151610eac81610d2e565b60208201529392505050565b818103818111156108a857634e487b7160e01b600052601160045260246000fd5b600060208284031215610eeb57600080fd5b81518015158114610df957600080fdfecd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a26469706673582212202d5369240f79872eaef65c5e8d85e9e49629973c27f8f6db7c069cfc8e7aa45764736f6c63430008180033", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"receive\",\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"defaultConfLevel\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"fueled\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"portal\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"pumps_\",\"type\":\"tuple[]\",\"internalType\":\"structOmniGasStation.GasPump[]\",\"components\":[{\"name\":\"chainID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"isPump\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"omni\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOmniPortal\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"paused\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"pumps\",\"inputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setPump\",\"inputs\":[{\"name\":\"chainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"settleUp\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"owed\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"unpause\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"DefaultConfLevelSet\",\"inputs\":[{\"name\":\"conf\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GasPumpAdded\",\"inputs\":[{\"name\":\"chainID\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"addr\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OmniPortalSet\",\"inputs\":[{\"name\":\"omni\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Paused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"SettledUp\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"chainID\",\"type\":\"uint64\",\"indexed\":true,\"internalType\":\"uint64\"},{\"name\":\"owed\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"fueled\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"success\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Unpaused\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"EnforcedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ExpectedPause\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]}]", + Bin: "0x608060405234801561001057600080fd5b5061001961001e565b6100d0565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161561006e5760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b03908116146100cd5780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b61104b806100df6000396000f3fe6080604052600436106100e15760003560e01c806374eeb8471161007f578063a04feb8611610059578063a04feb8614610282578063bac34036146102a2578063ed116d08146102e8578063f2fde38b1461030857600080fd5b806374eeb847146101fd5780638456cb59146102305780638da5cb5b1461024557600080fd5b80634afa17dd116100bb5780634afa17dd146101615780634e0dc4f0146101815780635c975abb146101b7578063715018a6146101e857600080fd5b806339acf9f1146100ed5780633bd9b9f61461012a5780633f4ba83a1461014c57600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5060005461010d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013657600080fd5b5061014a610145366004610db3565b610328565b005b34801561015857600080fd5b5061014a6105f5565b34801561016d57600080fd5b5061014a61017c366004610df4565b610607565b34801561018d57600080fd5b5061010d61019c366004610e2d565b6032602052600090815260409020546001600160a01b031681565b3480156101c357600080fd5b50600080516020610ff68339815191525460ff165b6040519015158152602001610121565b3480156101f457600080fd5b5061014a61061d565b34801561020957600080fd5b5060005461021e90600160a01b900460ff1681565b60405160ff9091168152602001610121565b34801561023c57600080fd5b5061014a61062f565b34801561025157600080fd5b507f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031661010d565b34801561028e57600080fd5b5061014a61029d366004610e51565b61063f565b3480156102ae57600080fd5b506102da6102bd366004610ee5565b603360209081526000928352604080842090915290825290205481565b604051908152602001610121565b3480156102f457600080fd5b506101d8610303366004610df4565b6107c9565b34801561031457600080fd5b5061014a610323366004610f13565b61080f565b60005460408051631799380760e11b815281516001600160a01b0390931692632f32700e926004808401939192918290030181865afa15801561036f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103939190610f30565b8051600180546020909301516001600160a01b0316600160401b026001600160e01b03199093166001600160401b03909216919091179190911790556103d761084d565b6103df61087e565b801561040d575060015461040d906001600160401b03811690600160401b90046001600160a01b03166107c9565b61045e5760405162461bcd60e51b815260206004820152601860248201527f47617353746174696f6e3a20756e617574686f72697a6564000000000000000060448201526064015b60405180910390fd5b6001600160a01b03821660009081526033602090815260408083206001546001600160401b031684529091529020548082116104dc5760405162461bcd60e51b815260206004820152601a60248201527f47617353746174696f6e3a20616c72656164792066756e6465640000000000006044820152606401610455565b60006001600160a01b0384166104f28385610f9c565b604051600081818185875af1925050503d806000811461052e576040519150601f19603f3d011682016040523d82523d6000602084013e610533565b606091505b50509050801561056f576001600160a01b03841660009081526033602090815260408083206001546001600160401b0316845290915290208390555b6001546001600160a01b03851660008181526033602090815260408083206001600160401b0390951680845294825291829020548251888152918201528415158183015290517f4264b2d9471008d8513ddd06a5da387491ccaf43988f604f5eca833d30551c9d9181900360600190a35050600180546001600160e01b03191690555050565b6105fd610911565b61060561096c565b565b61060f610911565b61061982826109cd565b5050565b610625610911565b6106056000610ae0565b610637610911565b610605610b51565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff1615906001600160401b03166000811580156106845750825b90506000826001600160401b031660011480156106a05750303b155b9050811580156106ae575080155b156106cc5760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156106f657845460ff60401b1916600160401b1785555b610701896004610b9a565b61070a88610bb4565b60005b868110156107775761076f88888381811061072a5761072a610fbd565b6107409260206040909202019081019150610e2d565b89898481811061075257610752610fbd565b905060400201602001602081019061076a9190610f13565b6109cd565b60010161070d565b5083156107be57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050505050565b60006001600160a01b0382161580159061080657506001600160401b0383166000908152603260205260409020546001600160a01b038381169116145b90505b92915050565b610817610911565b6001600160a01b03811661084157604051631e4fbdf760e01b815260006004820152602401610455565b61084a81610ae0565b50565b600080516020610ff68339815191525460ff16156106055760405163d93c066560e01b815260040160405180910390fd5b60008060009054906101000a90046001600160a01b03166001600160a01b03166355e2448e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f69190610fd3565b801561090c57506000546001600160a01b031633145b905090565b336109437f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146106055760405163118cdaa760e01b8152336004820152602401610455565b610974610bc5565b600080516020610ff6833981519152805460ff191681557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b0390911681526020015b60405180910390a150565b6001600160a01b038116610a1b5760405162461bcd60e51b815260206004820152601560248201527423b0b9a9ba30ba34b7b71d103d32b9379030b2323960591b6044820152606401610455565b816001600160401b0316600003610a745760405162461bcd60e51b815260206004820152601860248201527f47617353746174696f6e3a207a65726f20636861696e496400000000000000006044820152606401610455565b6001600160401b03821660008181526032602090815260409182902080546001600160a01b0319166001600160a01b03861690811790915591519182527f193d7693e9edcedc2357451dd62125041be2c877aa64852b126906cd438f08f5910160405180910390a25050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b610b5961084d565b600080516020610ff6833981519152805460ff191660011781557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258336109ae565b610ba2610bf5565b610bab82610c3e565b61061981610cd7565b610bbc610bf5565b61084a81610d7a565b600080516020610ff68339815191525460ff1661060557604051638dfc202b60e01b815260040160405180910390fd5b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661060557604051631afcd79f60e31b815260040160405180910390fd5b6001600160a01b038116610c895760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b6044820152606401610455565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f47906020016109c2565b610ce081610d82565b610d2c5760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e76616c696420636f6e66206c6576656c00000000000000006044820152606401610455565b6000805460ff60a01b1916600160a01b60ff8416908102919091179091556040519081527f8de08a798b4e50b4f351c1eaa91a11530043802be3ffac2df87db0c45a2e8483906020016109c2565b610817610bf5565b600060ff821660011480610809575060ff821660041492915050565b6001600160a01b038116811461084a57600080fd5b60008060408385031215610dc657600080fd5b8235610dd181610d9e565b946020939093013593505050565b6001600160401b038116811461084a57600080fd5b60008060408385031215610e0757600080fd5b8235610e1281610ddf565b91506020830135610e2281610d9e565b809150509250929050565b600060208284031215610e3f57600080fd5b8135610e4a81610ddf565b9392505050565b60008060008060608587031215610e6757600080fd5b8435610e7281610d9e565b93506020850135610e8281610d9e565b925060408501356001600160401b0380821115610e9e57600080fd5b818701915087601f830112610eb257600080fd5b813581811115610ec157600080fd5b8860208260061b8501011115610ed657600080fd5b95989497505060200194505050565b60008060408385031215610ef857600080fd5b8235610f0381610d9e565b91506020830135610e2281610ddf565b600060208284031215610f2557600080fd5b8135610e4a81610d9e565b600060408284031215610f4257600080fd5b604051604081018181106001600160401b0382111715610f7257634e487b7160e01b600052604160045260246000fd5b6040528251610f8081610ddf565b81526020830151610f9081610d9e565b60208201529392505050565b8181038181111561080957634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060208284031215610fe557600080fd5b81518015158114610e4a57600080fdfecd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300a2646970667358221220ae000d69cf0be09dffc729ba0e26912e2fe632b4ec13c1676906ae618c4deeec64736f6c63430008180033", } // OmniGasStationABI is the input ABI used to generate the binding from. @@ -419,25 +425,25 @@ func (_OmniGasStation *OmniGasStationCallerSession) Pumps(arg0 uint64) (common.A return _OmniGasStation.Contract.Pumps(&_OmniGasStation.CallOpts, arg0) } -// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// Initialize is a paid mutator transaction binding the contract method 0xa04feb86. // -// Solidity: function initialize(address portal, address owner) returns() -func (_OmniGasStation *OmniGasStationTransactor) Initialize(opts *bind.TransactOpts, portal common.Address, owner common.Address) (*types.Transaction, error) { - return _OmniGasStation.contract.Transact(opts, "initialize", portal, owner) +// Solidity: function initialize(address portal, address owner, (uint64,address)[] pumps_) returns() +func (_OmniGasStation *OmniGasStationTransactor) Initialize(opts *bind.TransactOpts, portal common.Address, owner common.Address, pumps_ []OmniGasStationGasPump) (*types.Transaction, error) { + return _OmniGasStation.contract.Transact(opts, "initialize", portal, owner, pumps_) } -// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// Initialize is a paid mutator transaction binding the contract method 0xa04feb86. // -// Solidity: function initialize(address portal, address owner) returns() -func (_OmniGasStation *OmniGasStationSession) Initialize(portal common.Address, owner common.Address) (*types.Transaction, error) { - return _OmniGasStation.Contract.Initialize(&_OmniGasStation.TransactOpts, portal, owner) +// Solidity: function initialize(address portal, address owner, (uint64,address)[] pumps_) returns() +func (_OmniGasStation *OmniGasStationSession) Initialize(portal common.Address, owner common.Address, pumps_ []OmniGasStationGasPump) (*types.Transaction, error) { + return _OmniGasStation.Contract.Initialize(&_OmniGasStation.TransactOpts, portal, owner, pumps_) } -// Initialize is a paid mutator transaction binding the contract method 0x485cc955. +// Initialize is a paid mutator transaction binding the contract method 0xa04feb86. // -// Solidity: function initialize(address portal, address owner) returns() -func (_OmniGasStation *OmniGasStationTransactorSession) Initialize(portal common.Address, owner common.Address) (*types.Transaction, error) { - return _OmniGasStation.Contract.Initialize(&_OmniGasStation.TransactOpts, portal, owner) +// Solidity: function initialize(address portal, address owner, (uint64,address)[] pumps_) returns() +func (_OmniGasStation *OmniGasStationTransactorSession) Initialize(portal common.Address, owner common.Address, pumps_ []OmniGasStationGasPump) (*types.Transaction, error) { + return _OmniGasStation.Contract.Initialize(&_OmniGasStation.TransactOpts, portal, owner, pumps_) } // Pause is a paid mutator transaction binding the contract method 0x8456cb59. diff --git a/contracts/core/.gas-snapshot b/contracts/core/.gas-snapshot index bac18e8ca..7e6170a6a 100644 --- a/contracts/core/.gas-snapshot +++ b/contracts/core/.gas-snapshot @@ -30,9 +30,9 @@ OmniGasPump_Test:test_setMaxSwap() (gas: 34771) OmniGasPump_Test:test_setOmniGasStation() (gas: 36697) OmniGasPump_Test:test_setOracle() (gas: 35014) OmniGasPump_Test:test_setToll() (gas: 34880) -OmniGasStation_Test:test_pause() (gas: 65258) -OmniGasStation_Test:test_setPump() (gas: 83832) -OmniGasStation_Test:test_settleUp() (gas: 364838) +OmniGasStation_Test:test_pause() (gas: 65220) +OmniGasStation_Test:test_setPump() (gas: 83966) +OmniGasStation_Test:test_settleUp() (gas: 365260) OmniPortal_admin_Test:test_pauseAll() (gas: 66009349) OmniPortal_admin_Test:test_pauseXCall() (gas: 269828) OmniPortal_admin_Test:test_pauseXSubmit() (gas: 231714) diff --git a/contracts/core/src/token/OmniGasPump.sol b/contracts/core/src/token/OmniGasPump.sol index 685b1bc6a..fc8543144 100644 --- a/contracts/core/src/token/OmniGasPump.sol +++ b/contracts/core/src/token/OmniGasPump.sol @@ -37,7 +37,7 @@ contract OmniGasPump is XAppUpgradeable, OwnableUpgradeable, PausableUpgradeable event FilledUp(address indexed recipient, uint256 owed, uint256 amtETH, uint256 fee, uint256 toll, uint256 amtOMNI); /// @notice Gas limit passed to OmniGasStation.settleUp xcall - uint64 public constant SETTLE_GAS = 100_000; + uint64 public constant SETTLE_GAS = 140_000; /// @notice Denominator for toll percentage calculations uint256 public constant TOLL_DENOM = 1000; diff --git a/contracts/core/src/token/OmniGasStation.sol b/contracts/core/src/token/OmniGasStation.sol index 581ef10ad..3871c4b49 100644 --- a/contracts/core/src/token/OmniGasStation.sol +++ b/contracts/core/src/token/OmniGasStation.sol @@ -34,9 +34,19 @@ contract OmniGasStation is XAppUpgradeable, OwnableUpgradeable, PausableUpgradea _disableInitializers(); } - function initialize(address portal, address owner) external initializer { + /// @dev GasPump struct, just used in initialize params + struct GasPump { + uint64 chainID; + address addr; + } + + function initialize(address portal, address owner, GasPump[] calldata pumps_) external initializer { __XApp_init(portal, ConfLevel.Finalized); __Ownable_init(owner); + + for (uint256 i = 0; i < pumps_.length; i++) { + _setPump(pumps_[i].chainID, pumps_[i].addr); + } } /** @@ -63,11 +73,7 @@ contract OmniGasStation is XAppUpgradeable, OwnableUpgradeable, PausableUpgradea /// @notice Set the pump addr for a chain function setPump(uint64 chainId, address addr) external onlyOwner { - require(addr != address(0), "GasStation: zero addr"); - require(chainId != 0, "GasStation: zero chainId"); - - pumps[chainId] = addr; - emit GasPumpAdded(chainId, addr); + _setPump(chainId, addr); } /// @notice Return true if `chainID` has a registered pump at `addr` @@ -85,5 +91,13 @@ contract OmniGasStation is XAppUpgradeable, OwnableUpgradeable, PausableUpgradea _unpause(); } + function _setPump(uint64 chainId, address addr) internal { + require(addr != address(0), "GasStation: zero addr"); + require(chainId != 0, "GasStation: zero chainId"); + + pumps[chainId] = addr; + emit GasPumpAdded(chainId, addr); + } + receive() external payable { } } diff --git a/contracts/core/test/token/OmniGasStation.t.sol b/contracts/core/test/token/OmniGasStation.t.sol index 85c6db604..023280e4b 100644 --- a/contracts/core/test/token/OmniGasStation.t.sol +++ b/contracts/core/test/token/OmniGasStation.t.sol @@ -28,7 +28,11 @@ contract OmniGasStation_Test is Test { payable( address( new TransparentUpgradeableProxy( - impl, makeAddr("admin"), abi.encodeCall(OmniGasStation.initialize, (address(portal), owner)) + impl, + makeAddr("admin"), + abi.encodeCall( + OmniGasStation.initialize, (address(portal), owner, new OmniGasStation.GasPump[](0)) + ) ) ) ) diff --git a/e2e/app/gaspump.go b/e2e/app/gaspump.go new file mode 100644 index 000000000..7e2b9931f --- /dev/null +++ b/e2e/app/gaspump.go @@ -0,0 +1,228 @@ +package app + +import ( + "context" + "math/big" + + "github.com/omni-network/omni/contracts/bindings" + "github.com/omni-network/omni/e2e/app/eoa" + "github.com/omni-network/omni/lib/anvil" + "github.com/omni-network/omni/lib/contracts" + "github.com/omni-network/omni/lib/contracts/gaspump" + "github.com/omni-network/omni/lib/contracts/gasstation" + "github.com/omni-network/omni/lib/errors" + "github.com/omni-network/omni/lib/log" + "github.com/omni-network/omni/lib/txmgr" + + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/params" +) + +// deployGasApp deploys OmniGasPump and OmniGasStation contracts. +func DeployGasApp(ctx context.Context, def Definition) error { + if err := deployGasPumps(ctx, def); err != nil { + return errors.Wrap(err, "deploy gas pumps") + } + + if err := deployGasStation(ctx, def); err != nil { + return errors.Wrap(err, "deploy gas station") + } + + if err := fundGasStation(ctx, def); err != nil { + return errors.Wrap(err, "fund gas station") + } + + return nil +} + +// deployGasPumps deploys OmniGasPump contracts to all chains except Omni's EVM. +func deployGasPumps(ctx context.Context, def Definition) error { + network := networkFromDef(def) + omniEVM, ok := network.OmniEVMChain() + if !ok { + return errors.New("no omni evm chain") + } + + for _, chain := range network.EVMChains() { + // GasPump not deployed on OmniEVM + if chain.ID == omniEVM.ID { + continue + } + + backend, err := def.Backends().Backend(chain.ID) + if err != nil { + return errors.Wrap(err, "backend", "chain", chain.Name) + } + + addr, receipt, err := gaspump.DeployIfNeeded(ctx, def.Testnet.Network, backend) + if err != nil { + return errors.Wrap(err, "deploy", "chain", chain.Name, "tx", maybeTxHash(receipt)) + } + + log.Info(ctx, "Gas pump deployed", "chain", chain.Name, "address", addr.Hex(), "tx", maybeTxHash(receipt)) + } + + return nil +} + +// deployGasStation deploys OmniGasStation contract to Omni's EVM. +func deployGasStation(ctx context.Context, def Definition) error { + network := networkFromDef(def) + omniEVM, ok := network.OmniEVMChain() + if !ok { + return errors.New("no omni evm chain") + } + + backend, err := def.Backends().Backend(omniEVM.ID) + if err != nil { + return errors.Wrap(err, "backend") + } + + gasPumps := make([]bindings.OmniGasStationGasPump, 0, len(network.EVMChains())-1) + for _, chain := range network.EVMChains() { + if chain.ID == omniEVM.ID { + continue + } + + gasPumps = append(gasPumps, bindings.OmniGasStationGasPump{ + ChainID: chain.ID, + Addr: contracts.GasPump(network.ID), + }) + } + + addr, receipt, err := gasstation.DeployIfNeeded(ctx, def.Testnet.Network, backend, gasPumps) + if err != nil { + return errors.Wrap(err, "deploy", "tx", maybeTxHash(receipt)) + } + + log.Info(ctx, "Gas station deployed", "address", addr.Hex(), "tx", maybeTxHash(receipt)) + + return nil +} + +// fundGasStation funds a network's OmniGasStation contract on Omni's EVM. +// +// TODO: handle funding / monitoring properly. +// consider joining with e2e/app/eoa, or introduce something similar for contracts. +func fundGasStation(ctx context.Context, def Definition) error { + network := networkFromDef(def) + omniEVM, ok := network.OmniEVMChain() + if !ok { + return errors.New("no omni evm chain") + } + + backend, err := def.Backends().Backend(omniEVM.ID) + if err != nil { + return errors.Wrap(err, "backend") + } + + funder := eoa.Funder() + + // use dev account for ephemeral networks + if network.ID.IsEphemeral() { + funder = anvil.DevAccount8() + } + + addr := contracts.GasStation(network.ID) + + // 1000 OMNI + amt := new(big.Int).Mul(big.NewInt(1000), big.NewInt(params.Ether)) + + tx, rec, err := backend.Send(ctx, funder, txmgr.TxCandidate{ + To: &addr, + GasLimit: 0, + Value: amt, + }) + if err != nil { + return errors.Wrap(err, "send tx") + } else if rec.Status != ethtypes.ReceiptStatusSuccessful { + return errors.New("fund tx failed", "tx", tx.Hash()) + } + + log.Info(ctx, "Funded gas station", "tx", tx.Hash(), "amount", amt) + + return nil +} + +func maybeTxHash(receipt *ethtypes.Receipt) string { + if receipt != nil { + return receipt.TxHash.Hex() + } + + return "nil" +} + +type GasPumpTest struct { + Recipient common.Address + AmountETH *big.Int +} + +var ( + GasPumpTests = []GasPumpTest{ + { + Recipient: common.HexToAddress("0x0000000000000000000000000000000000001111"), + AmountETH: big.NewInt(5000000000000000), // 0.005 ETH + }, + { + Recipient: common.HexToAddress("0x0000000000000000000000000000000000002222"), + AmountETH: big.NewInt(10000000000000000), // 0.01 ETH + }, + { + Recipient: common.HexToAddress("0x0000000000000000000000000000000000003333"), + AmountETH: big.NewInt(15000000000000000), // 0.015 ETH + }, + } +) + +func testGasPumps(ctx context.Context, def Definition) error { + networkID := def.Testnet.Network + network := networkFromDef(def) + pumpAddr := contracts.GasPump(networkID) + + omniEVM, ok := network.OmniEVMChain() + if !ok { + return errors.New("no omni evm chain") + } + + if !networkID.IsEphemeral() { + log.Warn(ctx, "Skipping bridge test", errors.New("only ephemeral networks")) + return nil + } + + // just need an account with funds on ephemeral network chains + payor := anvil.DevAccount7() + + for _, chain := range network.EVMChains() { + if chain.ID == omniEVM.ID { + continue + } + + backend, err := def.Backends().Backend(chain.ID) + if err != nil { + return errors.Wrap(err, "backend", "chain", chain.Name) + } + + gasPump, err := bindings.NewOmniGasPump(pumpAddr, backend) + if err != nil { + return errors.Wrap(err, "new gas pump") + } + + txOpts, err := backend.BindOpts(ctx, payor) + if err != nil { + return errors.Wrap(err, "bind opts") + } + + for _, test := range GasPumpTests { + txOpts.Value = test.AmountETH + tx, err := gasPump.FillUp(txOpts, test.Recipient) + if err != nil { + return errors.Wrap(err, "pump", "chain", chain.Name) + } + + log.Info(ctx, "Pumped gas", "chain", chain.Name, "tx", tx.Hash(), "recipient", test.Recipient.Hex(), "amount", test.AmountETH) + } + } + + return nil +} diff --git a/e2e/app/run.go b/e2e/app/run.go index 7eecb4c88..4877cd098 100644 --- a/e2e/app/run.go +++ b/e2e/app/run.go @@ -109,6 +109,10 @@ func Deploy(ctx context.Context, def Definition, cfg DeployConfig) (*pingpong.XD return nil, err } + if err := DeployGasApp(ctx, def); err != nil { + return nil, err + } + if err := setupTokenBridge(ctx, def); err != nil { return nil, errors.Wrap(err, "setup token bridge") } @@ -170,6 +174,10 @@ func E2ETest(ctx context.Context, def Definition, cfg E2ETestConfig) error { return err } + if err := testGasPumps(ctx, def); err != nil { + return errors.Wrap(err, "test gas app") + } + if err := testBridge(ctx, def); err != nil { return errors.Wrap(err, "test bridge") } diff --git a/e2e/test/gaspump_test.go b/e2e/test/gaspump_test.go new file mode 100644 index 000000000..6e1621f41 --- /dev/null +++ b/e2e/test/gaspump_test.go @@ -0,0 +1,41 @@ +package e2e_test + +import ( + "context" + "testing" + + "github.com/omni-network/omni/e2e/app" + "github.com/omni-network/omni/lib/ethclient" + "github.com/omni-network/omni/lib/netconf" + "github.com/omni-network/omni/lib/xchain" + + "github.com/stretchr/testify/require" +) + +// TestGasPumps ensures that bridge tests cases defined in e2e/app/gaspump.go were successful. +func TestGasPumps(t *testing.T) { + t.Parallel() + testNetwork(t, func(t *testing.T, network netconf.Network, endpoints xchain.RPCEndpoints) { + t.Helper() + ctx := context.Background() + + omniEVM, ok := network.OmniEVMChain() + require.True(t, ok) + + omniRPC, err := endpoints.ByNameOrID(omniEVM.Name, omniEVM.ID) + require.NoError(t, err) + + omniClient, err := ethclient.Dial(omniEVM.Name, omniRPC) + require.NoError(t, err) + + for _, test := range app.GasPumpTests { + balance, err := omniClient.BalanceAt(ctx, test.Recipient, nil) + require.NoError(t, err) + + // Just test that balance > 0 for now + // TODO: assert that amount is equal to sum of AmountETH spent converted to OMNI + // Should account for the xcall fee, gas pump toll, and fee oracle conversion rates + require.Positive(t, balance.Uint64(), "recipient: %s", test.Recipient) + } + }) +} diff --git a/lib/contracts/gasstation/deploy.go b/lib/contracts/gasstation/deploy.go index 28179bca8..dbf61e8fb 100644 --- a/lib/contracts/gasstation/deploy.go +++ b/lib/contracts/gasstation/deploy.go @@ -73,7 +73,12 @@ func isDeployed(ctx context.Context, network netconf.ID, backend *ethbackend.Bac // DeployIfNeeded deploys a new token contract if it is not already deployed. // If the contract is already deployed, the receipt is nil. -func DeployIfNeeded(ctx context.Context, network netconf.ID, backend *ethbackend.Backend) (common.Address, *ethtypes.Receipt, error) { +func DeployIfNeeded( + ctx context.Context, + network netconf.ID, + backend *ethbackend.Backend, + gasPumps []bindings.OmniGasStationGasPump, +) (common.Address, *ethtypes.Receipt, error) { deployed, addr, err := isDeployed(ctx, network, backend) if err != nil { return common.Address{}, nil, errors.Wrap(err, "is deployed") @@ -82,11 +87,16 @@ func DeployIfNeeded(ctx context.Context, network netconf.ID, backend *ethbackend return addr, nil, nil } - return Deploy(ctx, network, backend) + return Deploy(ctx, network, backend, gasPumps) } // Deploy deploys a new L1Bridge contract and returns the address and receipt. -func Deploy(ctx context.Context, network netconf.ID, backend *ethbackend.Backend) (common.Address, *ethtypes.Receipt, error) { +func Deploy( + ctx context.Context, + network netconf.ID, + backend *ethbackend.Backend, + gasPumps []bindings.OmniGasStationGasPump, +) (common.Address, *ethtypes.Receipt, error) { cfg := DeploymentConfig{ Create3Factory: contracts.Create3Factory(network), Create3Salt: contracts.GasStationSalt(network), @@ -97,10 +107,16 @@ func Deploy(ctx context.Context, network netconf.ID, backend *ethbackend.Backend ExpectedAddr: contracts.GasStation(network), } - return deploy(ctx, network, cfg, backend) + return deploy(ctx, network, cfg, backend, gasPumps) } -func deploy(ctx context.Context, network netconf.ID, cfg DeploymentConfig, backend *ethbackend.Backend) (common.Address, *ethtypes.Receipt, error) { +func deploy( + ctx context.Context, + network netconf.ID, + cfg DeploymentConfig, + backend *ethbackend.Backend, + gasPumps []bindings.OmniGasStationGasPump, +) (common.Address, *ethtypes.Receipt, error) { if err := cfg.Validate(); err != nil { return common.Address{}, nil, errors.Wrap(err, "validate config") } @@ -143,7 +159,7 @@ func deploy(ctx context.Context, network netconf.ID, cfg DeploymentConfig, backe return common.Address{}, nil, errors.Wrap(err, "wait mined impl") } - initCode, err := packInitCode(cfg, impl) + initCode, err := packInitCode(cfg, impl, gasPumps) if err != nil { return common.Address{}, nil, errors.Wrap(err, "pack init code") } @@ -161,7 +177,7 @@ func deploy(ctx context.Context, network netconf.ID, cfg DeploymentConfig, backe return addr, receipt, nil } -func packInitCode(cfg DeploymentConfig, impl common.Address) ([]byte, error) { +func packInitCode(cfg DeploymentConfig, impl common.Address, gasPumps []bindings.OmniGasStationGasPump) ([]byte, error) { gasStationAbi, err := bindings.OmniGasStationMetaData.GetAbi() if err != nil { return nil, errors.Wrap(err, "get abi") @@ -172,7 +188,7 @@ func packInitCode(cfg DeploymentConfig, impl common.Address) ([]byte, error) { return nil, errors.Wrap(err, "get proxy abi") } - initializer, err := gasStationAbi.Pack("initialize", cfg.Portal, cfg.Owner) + initializer, err := gasStationAbi.Pack("initialize", cfg.Portal, cfg.Owner, gasPumps) if err != nil { return nil, errors.Wrap(err, "encode initializer") }