diff --git a/go.mod b/go.mod index 54639053..64bb65d8 100644 --- a/go.mod +++ b/go.mod @@ -51,6 +51,7 @@ require ( github.com/ethereum/c-kzg-4844 v0.4.0 // indirect github.com/flynn/noise v1.0.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-ole/go-ole v1.2.5 // indirect github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect @@ -60,6 +61,7 @@ require ( github.com/google/cel-go v0.19.0 // indirect github.com/google/gopacket v1.1.19 // indirect github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b // indirect + github.com/google/uuid v1.3.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/holiman/uint256 v1.2.4 // indirect github.com/huin/goupnp v1.3.0 // indirect diff --git a/go.sum b/go.sum index cbd1f7e7..9317f256 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtyd github.com/bufbuild/protovalidate-go v0.5.0 h1:xFery2RlLh07FQTvB7hlasKqPrDK2ug+uw6DUiuadjo= github.com/bufbuild/protovalidate-go v0.5.0/go.mod h1:3XAwFeJ2x9sXyPLgkxufH9sts1tQRk8fdt1AW93NiUU= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= @@ -529,6 +531,7 @@ golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/pkg/abi/abi.go b/pkg/abi/abi.go deleted file mode 100644 index acbeec3c..00000000 --- a/pkg/abi/abi.go +++ /dev/null @@ -1,1701 +0,0 @@ -package node - -var ProviderRegistryJson = ` -[ - { - "type": "constructor", - "inputs": [ - { - "name": "_minStake", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_feeRecipient", - "type": "address", - "internalType": "address" - }, - { - "name": "_feePercent", - "type": "uint16", - "internalType": "uint16" - }, - { - "name": "_owner", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "fallback", - "stateMutability": "payable" - }, - { - "type": "receive", - "stateMutability": "payable" - }, - { - "type": "function", - "name": "bidderAmount", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "checkStake", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "depositFunds", - "inputs": [], - "outputs": [], - "stateMutability": "payable" - }, - { - "type": "function", - "name": "feePercent", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint16", - "internalType": "uint16" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "feeRecipient", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "feeRecipientAmount", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "minStake", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "preConfirmationsContract", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "providerRegistered", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "providerStakes", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "registerAndStake", - "inputs": [], - "outputs": [], - "stateMutability": "payable" - }, - { - "type": "function", - "name": "renounceOwnership", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setNewFeePercent", - "inputs": [ - { - "name": "newFeePercent", - "type": "uint16", - "internalType": "uint16" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setNewFeeRecipient", - "inputs": [ - { - "name": "newFeeRecipient", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setPreconfirmationsContract", - "inputs": [ - { - "name": "contractAddress", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "slash", - "inputs": [ - { - "name": "amt", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "provider", - "type": "address", - "internalType": "address" - }, - { - "name": "bidder", - "type": "address", - "internalType": "address payable" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "transferOwnership", - "inputs": [ - { - "name": "newOwner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawBidderAmount", - "inputs": [ - { - "name": "bidder", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawFeeRecipientAmount", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawStakedAmount", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address payable" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "event", - "name": "FundsDeposited", - "inputs": [ - { - "name": "provider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "FundsRewarded", - "inputs": [ - { - "name": "provider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "FundsSlashed", - "inputs": [ - { - "name": "provider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "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": "ProviderRegistered", - "inputs": [ - { - "name": "provider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "stakedAmount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - } -] -` - -var PreConfJson = ` -[ - { - "type": "constructor", - "inputs": [ - { - "name": "_providerRegistry", - "type": "address", - "internalType": "address" - }, - { - "name": "_bidderRegistry", - "type": "address", - "internalType": "address" - }, - { - "name": "_oracle", - "type": "address", - "internalType": "address" - }, - { - "name": "_owner", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "fallback", - "stateMutability": "payable" - }, - { - "type": "receive", - "stateMutability": "payable" - }, - { - "type": "function", - "name": "DOMAIN_SEPARATOR_BID", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "DOMAIN_SEPARATOR_PRECONF", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "EIP712_COMMITMENT_TYPEHASH", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "EIP712_MESSAGE_TYPEHASH", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "_bytesToHexString", - "inputs": [ - { - "name": "_bytes", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "bidderRegistry", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IBidderRegistry" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "blockCommitments", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "commitmentCount", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "commitments", - "inputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, - { - "name": "bidder", - "type": "address", - "internalType": "address" - }, - { - "name": "commiter", - "type": "address", - "internalType": "address" - }, - { - "name": "bid", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "bidHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "commitmentHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "bidSignature", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "commitmentSignature", - "type": "bytes", - "internalType": "bytes" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "commitmentsCount", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getBidHash", - "inputs": [ - { - "name": "_txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "_bid", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "_blockNumber", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getCommitment", - "inputs": [ - { - "name": "commitmentIndex", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct PreConfCommitmentStore.PreConfCommitment", - "components": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, - { - "name": "bidder", - "type": "address", - "internalType": "address" - }, - { - "name": "commiter", - "type": "address", - "internalType": "address" - }, - { - "name": "bid", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "bidHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "commitmentHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "bidSignature", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "commitmentSignature", - "type": "bytes", - "internalType": "bytes" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getCommitmentIndex", - "inputs": [ - { - "name": "commitment", - "type": "tuple", - "internalType": "struct PreConfCommitmentStore.PreConfCommitment", - "components": [ - { - "name": "commitmentUsed", - "type": "bool", - "internalType": "bool" - }, - { - "name": "bidder", - "type": "address", - "internalType": "address" - }, - { - "name": "commiter", - "type": "address", - "internalType": "address" - }, - { - "name": "bid", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "bidHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "commitmentHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "bidSignature", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "commitmentSignature", - "type": "bytes", - "internalType": "bytes" - } - ] - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "getCommitmentsByBlockNumber", - "inputs": [ - { - "name": "blockNumber", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getCommitmentsByCommitter", - "inputs": [ - { - "name": "commiter", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32[]", - "internalType": "bytes32[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getPreConfHash", - "inputs": [ - { - "name": "_txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "_bid", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "_blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "_bidHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "_bidSignature", - "type": "string", - "internalType": "string" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getTxnHashFromCommitment", - "inputs": [ - { - "name": "commitmentIndex", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "txnHash", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "initateReward", - "inputs": [ - { - "name": "commitmentIndex", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "initiateSlash", - "inputs": [ - { - "name": "commitmentIndex", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "lastProcessedBlock", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "oracle", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "providerCommitments", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "providerRegistry", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IProviderRegistry" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "renounceOwnership", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "storeCommitment", - "inputs": [ - { - "name": "bid", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "bidSignature", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "commitmentSignature", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "commitmentIndex", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "transferOwnership", - "inputs": [ - { - "name": "newOwner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "updateBidderRegistry", - "inputs": [ - { - "name": "newBidderRegistry", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "updateOracle", - "inputs": [ - { - "name": "newOracle", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "updateProviderRegistry", - "inputs": [ - { - "name": "newProviderRegistry", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "verifyBid", - "inputs": [ - { - "name": "bid", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "bidSignature", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "messageDigest", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "recoveredAddress", - "type": "address", - "internalType": "address" - }, - { - "name": "stake", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "verifyPreConfCommitment", - "inputs": [ - { - "name": "txnHash", - "type": "string", - "internalType": "string" - }, - { - "name": "bid", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "blockNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "bidHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "bidSignature", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "commitmentSignature", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "preConfHash", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "commiterAddress", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "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": "SignatureVerified", - "inputs": [ - { - "name": "signer", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "txnHash", - "type": "string", - "indexed": false, - "internalType": "string" - }, - { - "name": "bid", - "type": "uint64", - "indexed": true, - "internalType": "uint64" - }, - { - "name": "blockNumber", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - } -] -` - -var BidderRegistryJson = ` -[ - { - "type": "constructor", - "inputs": [ - { - "name": "_minAllowance", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "_feeRecipient", - "type": "address", - "internalType": "address" - }, - { - "name": "_feePercent", - "type": "uint16", - "internalType": "uint16" - }, - { - "name": "_owner", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "fallback", - "stateMutability": "payable" - }, - { - "type": "receive", - "stateMutability": "payable" - }, - { - "type": "function", - "name": "bidderPrepaidBalances", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "bidderRegistered", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "feePercent", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint16", - "internalType": "uint16" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "feeRecipient", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "feeRecipientAmount", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getAllowance", - "inputs": [ - { - "name": "bidder", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getFeeRecipientAmount", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getProviderAmount", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "minAllowance", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "preConfirmationsContract", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "prepay", - "inputs": [], - "outputs": [], - "stateMutability": "payable" - }, - { - "type": "function", - "name": "protocolFeeAmount", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "providerAmount", - "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "renounceOwnership", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "retrieveFunds", - "inputs": [ - { - "name": "bidder", - "type": "address", - "internalType": "address" - }, - { - "name": "amt", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "provider", - "type": "address", - "internalType": "address payable" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setNewFeePercent", - "inputs": [ - { - "name": "newFeePercent", - "type": "uint16", - "internalType": "uint16" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setNewFeeRecipient", - "inputs": [ - { - "name": "newFeeRecipient", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setPreconfirmationsContract", - "inputs": [ - { - "name": "contractAddress", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "transferOwnership", - "inputs": [ - { - "name": "newOwner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawFeeRecipientAmount", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawPrepaidAmount", - "inputs": [ - { - "name": "bidder", - "type": "address", - "internalType": "address payable" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawProtocolFee", - "inputs": [ - { - "name": "bidder", - "type": "address", - "internalType": "address payable" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawProviderAmount", - "inputs": [ - { - "name": "provider", - "type": "address", - "internalType": "address payable" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "event", - "name": "BidderRegistered", - "inputs": [ - { - "name": "bidder", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "prepaidAmount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "FundsRetrieved", - "inputs": [ - { - "name": "bidder", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "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 - } -] -` diff --git a/pkg/contracts/bidder_registry/bidder_registry.go b/pkg/contracts/bidder_registry/bidder_registry.go index c96fd853..a25f4971 100644 --- a/pkg/contracts/bidder_registry/bidder_registry.go +++ b/pkg/contracts/bidder_registry/bidder_registry.go @@ -9,12 +9,12 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - contractsabi "github.com/primevprotocol/mev-commit/pkg/abi" + "github.com/primevprotocol/contracts-abi/clients/BidderRegistry" "github.com/primevprotocol/mev-commit/pkg/evmclient" ) var bidderRegistryABI = func() abi.ABI { - abi, err := abi.JSON(strings.NewReader(contractsabi.BidderRegistryJson)) + abi, err := abi.JSON(strings.NewReader(bidderregistry.BidderregistryMetaData.ABI)) if err != nil { panic(err) } diff --git a/pkg/contracts/preconf/preconf.go b/pkg/contracts/preconf/preconf.go index 0cf721c6..e0d17b81 100644 --- a/pkg/contracts/preconf/preconf.go +++ b/pkg/contracts/preconf/preconf.go @@ -9,12 +9,12 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" - contractsabi "github.com/primevprotocol/mev-commit/pkg/abi" + "github.com/primevprotocol/contracts-abi/clients/PreConfCommitmentStore" "github.com/primevprotocol/mev-commit/pkg/evmclient" ) var preconfABI = func() abi.ABI { - abi, err := abi.JSON(strings.NewReader(contractsabi.PreConfJson)) + abi, err := abi.JSON(strings.NewReader(preconfcommitmentstore.PreconfcommitmentstoreMetaData.ABI)) if err != nil { panic(err) } diff --git a/pkg/contracts/provider_registry/registry.go b/pkg/contracts/provider_registry/registry.go index 1af9390b..9c37ecdf 100644 --- a/pkg/contracts/provider_registry/registry.go +++ b/pkg/contracts/provider_registry/registry.go @@ -9,12 +9,12 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - contractsabi "github.com/primevprotocol/mev-commit/pkg/abi" + "github.com/primevprotocol/contracts-abi/clients/ProviderRegistry" "github.com/primevprotocol/mev-commit/pkg/evmclient" ) var registryABI = func() abi.ABI { - abi, err := abi.JSON(strings.NewReader(contractsabi.ProviderRegistryJson)) + abi, err := abi.JSON(strings.NewReader(providerregistry.ProviderregistryMetaData.ABI)) if err != nil { panic(err) }