diff --git a/pkg/bindings/BN254CertificateVerifier/binding.go b/pkg/bindings/BN254CertificateVerifier/binding.go index 3f5767de31..c0b6198efc 100644 --- a/pkg/bindings/BN254CertificateVerifier/binding.go +++ b/pkg/bindings/BN254CertificateVerifier/binding.go @@ -86,7 +86,7 @@ type OperatorSet struct { // BN254CertificateVerifierMetaData contains all meta data concerning the BN254CertificateVerifier contract. var BN254CertificateVerifierMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_operatorTableUpdater\",\"type\":\"address\",\"internalType\":\"contractIOperatorTableUpdater\"},{\"name\":\"_version\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getNonsignerOperatorInfo\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetInfo\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorSetInfo\",\"components\":[{\"name\":\"operatorInfoTreeRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"numOperators\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"aggregatePubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"totalWeights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetOwner\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"isNonsignerCached\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorIndex\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestReferenceTimestamp\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxOperatorTableStaleness\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorTableUpdater\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOperatorTableUpdater\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"trySignatureVerification\",\"inputs\":[{\"name\":\"msgHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"aggPubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"apkG2\",\"type\":\"tuple\",\"internalType\":\"structBN254.G2Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"},{\"name\":\"Y\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"}]},{\"name\":\"signature\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"pairingSuccessful\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"signatureValid\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateOperatorTable\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorSetInfo\",\"type\":\"tuple\",\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorSetInfo\",\"components\":[{\"name\":\"operatorInfoTreeRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"numOperators\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"aggregatePubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"totalWeights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"operatorSetConfig\",\"type\":\"tuple\",\"internalType\":\"structICrossChainRegistryTypes.OperatorSetConfig\",\"components\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificate\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIBN254CertificateVerifierTypes.BN254Certificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"signature\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"apk\",\"type\":\"tuple\",\"internalType\":\"structBN254.G2Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"},{\"name\":\"Y\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"}]},{\"name\":\"nonSignerWitnesses\",\"type\":\"tuple[]\",\"internalType\":\"structIBN254CertificateVerifierTypes.BN254OperatorInfoWitness[]\",\"components\":[{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfoProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operatorInfo\",\"type\":\"tuple\",\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}]}]}],\"outputs\":[{\"name\":\"signedStakes\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateNominal\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIBN254CertificateVerifierTypes.BN254Certificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"signature\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"apk\",\"type\":\"tuple\",\"internalType\":\"structBN254.G2Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"},{\"name\":\"Y\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"}]},{\"name\":\"nonSignerWitnesses\",\"type\":\"tuple[]\",\"internalType\":\"structIBN254CertificateVerifierTypes.BN254OperatorInfoWitness[]\",\"components\":[{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfoProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operatorInfo\",\"type\":\"tuple\",\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}]}]},{\"name\":\"totalStakeNominalThresholds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateProportion\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIBN254CertificateVerifierTypes.BN254Certificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"signature\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"apk\",\"type\":\"tuple\",\"internalType\":\"structBN254.G2Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"},{\"name\":\"Y\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"}]},{\"name\":\"nonSignerWitnesses\",\"type\":\"tuple[]\",\"internalType\":\"structIBN254CertificateVerifierTypes.BN254OperatorInfoWitness[]\",\"components\":[{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfoProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operatorInfo\",\"type\":\"tuple\",\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}]}]},{\"name\":\"totalStakeProportionThresholds\",\"type\":\"uint16[]\",\"internalType\":\"uint16[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MaxStalenessPeriodUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetOwnerUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TableUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"operatorSetInfo\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorSetInfo\",\"components\":[{\"name\":\"operatorInfoTreeRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"numOperators\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"aggregatePubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"totalWeights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CertificateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ECAddFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ECMulFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ECPairingFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ExpModFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidOperatorIndex\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidProofLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidShortString\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyTableUpdater\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReferenceTimestampDoesNotExist\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StringTooLong\",\"inputs\":[{\"name\":\"str\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"TableUpdateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VerificationFailed\",\"inputs\":[]}]", - Bin: "0x60c060405234801561000f575f5ffd5b5060405161293738038061293783398101604081905261002e9161016a565b6001600160a01b0382166080528061004581610058565b60a0525061005161009e565b5050610294565b5f5f829050601f8151111561008b578260405163305a27a960e01b81526004016100829190610239565b60405180910390fd5b80516100968261026e565b179392505050565b5f54610100900460ff16156101055760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401610082565b5f5460ff90811614610154575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b634e487b7160e01b5f52604160045260245ffd5b5f5f6040838503121561017b575f5ffd5b82516001600160a01b0381168114610191575f5ffd5b60208401519092506001600160401b038111156101ac575f5ffd5b8301601f810185136101bc575f5ffd5b80516001600160401b038111156101d5576101d5610156565b604051601f8201601f19908116603f011681016001600160401b038111828210171561020357610203610156565b60405281815282820160200187101561021a575f5ffd5b8160208401602083015e5f602083830101528093505050509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b8051602080830151919081101561028e575f198160200360031b1b821691505b50919050565b60805160a05161267b6102bc5f395f6104e401525f81816101de015261062f015261267b5ff3fe608060405234801561000f575f5ffd5b50600436106100cb575f3560e01c80635ddb9b5b1161008857806368d6e0811161006357806368d6e081146101d95780638481892014610218578063dd2ae1b91461022b578063eb39e68f1461023e575f5ffd5b80635ddb9b5b146101895780636141879e146101b15780636738c40b146101c4575f5ffd5b8063017d7974146100cf578063080b7150146100f75780631a18746c1461011757806326af6a3c1461014157806354fd4d50146101615780635be8727414610176575b5f5ffd5b6100e26100dd36600461205a565b61025e565b60405190151581526020015b60405180910390f35b61010a610105366004612135565b6103ef565b6040516100ee9190612180565b61012a6101253660046121b7565b610404565b6040805192151583529015156020830152016100ee565b61015461014f366004612205565b610425565b6040516100ee919061227a565b6101696104dd565b6040516100ee91906122af565b6100e2610184366004612205565b61050d565b61019c6101973660046122e4565b6105d8565b60405163ffffffff90911681526020016100ee565b61019c6101bf3660046122e4565b6105fe565b6101d76101d2366004612314565b610624565b005b6102007f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100ee565b6102006102263660046122e4565b6107f1565b6100e26102393660046123cd565b61081a565b61025161024c366004612440565b6108ad565b6040516100ee91906124b7565b5f5f61026a8585610972565b90505f61027686610b32565b5f8181526004602081815260408084208a5163ffffffff16855282528084208151608081018352815481526001820154818501528251808401845260028301548152600383015481860152818401529381018054835181860281018601909452808452969750949593949093606086019383018282801561031457602002820191905f5260205f20905b815481526020019060010190808311610300575b50505050508152505090505f8160600151905085518451146103495760405163512509d360e11b815260040160405180910390fd5b5f5b84518110156103de575f61271088838151811061036a5761036a6124c9565b602002602001015161ffff16848481518110610388576103886124c9565b602002602001015161039a91906124f1565b6103a4919061251c565b9050808683815181106103b9576103b96124c9565b602002602001015110156103d5575f96505050505050506103e8565b5060010161034b565b5060019450505050505b9392505050565b60606103fb8383610972565b90505b92915050565b5f5f61041886848787600162061a80610b95565b9150915094509492505050565b61042d6119f3565b5f61043785610b32565b5f81815260056020908152604080832063ffffffff8916845282528083208784528252918290208251608081018452815481850190815260018301546060830152815260028201805485518186028101860190965280865295965090949193858401939092908301828280156104ca57602002820191905f5260205f20905b8154815260200190600101908083116104b6575b5050505050815250509150509392505050565b60606105087f0000000000000000000000000000000000000000000000000000000000000000610c5d565b905090565b5f5f61051885610b32565b5f81815260056020908152604080832063ffffffff891684528252808320878452825280832081516080810183528154818401908152600183015460608301528152600282018054845181870281018701909552808552969750949590949193858101939291908301828280156105ac57602002820191905f5260205f20905b815481526020019060010190808311610598575b50505091909252505081515191925050158015906105ce575080516020015115155b9695505050505050565b5f5f6105e383610b32565b5f9081526003602052604090205463ffffffff169392505050565b5f5f61060983610b32565b5f9081526002602052604090205463ffffffff169392505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461066d5760405163030c1b6b60e11b815260040160405180910390fd5b5f610685610680368790038701876122e4565b610b32565b5f8181526003602052604090205490915063ffffffff908116908516116106bf57604051632f20889f60e01b815260040160405180910390fd5b5f81815260046020818152604080842063ffffffff8916855282529283902086518155818701516001820155928601518051600285015581015160038401556060860151805187949361071793908501920190611a1d565b5050505f818152600360209081526040909120805463ffffffff191663ffffffff87161790556107499083018361252f565b5f8281526001602090815260409182902080546001600160a01b0319166001600160a01b03949094169390931790925561078891908401908401612548565b5f8281526002602052604090819020805463ffffffff191663ffffffff9390931692909217909155517f93e6bea1c9b5dce4a5c07b00261e956df2a4a253d9ab6ca070ca2037d72ada9e906107e290879087908790612561565b60405180910390a15050505050565b5f5f6107fc83610b32565b5f908152600160205260409020546001600160a01b03169392505050565b5f5f6108268585610972565b9050825181511461084a5760405163512509d360e11b815260040160405180910390fd5b5f5b81518110156108a157838181518110610867576108676124c9565b6020026020010151828281518110610881576108816124c9565b60200260200101511015610899575f925050506103e8565b60010161084c565b50600195945050505050565b6108b5611a66565b5f6108bf84610b32565b5f81815260046020818152604080842063ffffffff891685528252928390208351608081018552815481526001820154818401528451808601865260028301548152600383015481850152818601529281018054855181850281018501909652808652959650929490936060860193909290919083018282801561096057602002820191905f5260205f20905b81548152602001906001019080831161094c575b50505050508152505091505092915050565b606061097c611a98565b61098584610b32565b80825283516109949190610c9a565b80515f908152600460208181526040808420875163ffffffff1685528252928390208351608081018552815481526001820154818401528451808601865260028301548152600383015481850152818601529281018054855181850281018501909652808652939491936060860193830182828015610a3057602002820191905f5260205f20905b815481526020019060010190808311610a1c575b505050919092525050506020820181905251610a5f57604051630cad17b760e31b815260040160405180910390fd5b806020015160600151516001600160401b03811115610a8057610a80611bc6565b604051908082528060200260200182016040528015610aa9578160200160208202803683370190505b5060408201525f5b81602001516060015151811015610b0d578160200151606001518181518110610adc57610adc6124c9565b602002602001015182604001518281518110610afa57610afa6124c9565b6020908102919091010152600101610ab1565b50610b188184610cec565b6060820152610b278184610e16565b604001519392505050565b5f815f0151826020015163ffffffff16604051602001610b7d92919060609290921b6bffffffffffffffffffffffff1916825260a01b6001600160a01b031916601482015260200190565b6040516020818303038152906040526103fe906125ad565b5f5f5f610ba189610e84565b90505f610bb08a89898c610f0e565b90505f610bc7610bc08a84610fc2565b8b90611032565b90505f610c09610c0284610bfc6040805180820182525f80825260209182015281518083019092526001825260029082015290565b90610fc2565b8590611032565b90508715610c2e57610c2582610c1d6110a6565b838c8b611166565b96509450610c4e565b610c4182610c3a6110a6565b838c61137a565b95508515610c4e57600194505b50505050965096945050505050565b60605f610c69836115b1565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b5f8281526002602052604090205463ffffffff16801580610cca5750610cc081836125d0565b63ffffffff164211155b610ce75760405163640fcd6b60e11b815260040160405180910390fd5b505050565b6040805180820182525f808252602091820181905282518084019093528083529082018190525b826080015151811015610e0f575f83608001518281518110610d3757610d376124c9565b60200260200101519050846020015160200151815f015163ffffffff1610610d72576040516301fa53c760e11b815260040160405180910390fd5b845184515f91610d8291846115d8565b8051909150610d92908590611032565b93505f5b816020015151811015610e0457866040015151811015610dfc5781602001518181518110610dc657610dc66124c9565b602002602001015187604001518281518110610de457610de46124c9565b60200260200101818151610df891906125ec565b9052505b600101610d96565b505050600101610d13565b5092915050565b5f610e36610e27846060015161174f565b60208501516040015190611032565b90505f5f610e5284602001518486606001518760400151610404565b91509150818015610e605750805b610e7d5760405163439cc0cd60e01b815260040160405180910390fd5b5050505050565b604080518082019091525f80825260208201525f8080610eb15f5160206126265f395f51905f52866125ff565b90505b610ebd816117e5565b90935091505f5160206126265f395f51905f528283098303610ef5576040805180820190915290815260208101919091529392505050565b5f5160206126265f395f51905f52600182089050610eb4565b8251602080850151845180519083015186840151805190850151875188870151604080519889018e90528801989098526060870195909552608086019390935260a085019190915260c084015260e08301526101008201526101208101919091525f907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019061014001604051602081830303815290604052805190602001205f1c610fb991906125ff565b95945050505050565b604080518082019091525f8082526020820152610fdd611add565b835181526020808501519082015260408082018490525f908360608460076107d05a03fa9050808061100b57fe5b508061102a57604051632319df1960e11b815260040160405180910390fd5b505092915050565b604080518082019091525f808252602082015261104d611afb565b835181526020808501518183015283516040808401919091529084015160608301525f908360808460066107d05a03fa9050808061108757fe5b508061102a5760405163d4b68fd760e01b815260040160405180910390fd5b6110ae611b19565b50604080516080810182527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28183019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6060830152815281518083019092527f275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec82527f1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9d60208381019190915281019190915290565b6040805180820182528681526020808201869052825180840190935286835282018490525f91829190611197611b39565b5f5b600281101561134e575f6111ae8260066124f1565b90508482600281106111c2576111c26124c9565b602002015151836111d3835f612612565b600c81106111e3576111e36124c9565b60200201528482600281106111fa576111fa6124c9565b602002015160200151838260016112119190612612565b600c8110611221576112216124c9565b6020020152838260028110611238576112386124c9565b602002015151518361124b836002612612565b600c811061125b5761125b6124c9565b6020020152838260028110611272576112726124c9565b602002015151600160200201518361128b836003612612565b600c811061129b5761129b6124c9565b60200201528382600281106112b2576112b26124c9565b6020020151602001515f600281106112cc576112cc6124c9565b6020020151836112dd836004612612565b600c81106112ed576112ed6124c9565b6020020152838260028110611304576113046124c9565b60200201516020015160016002811061131f5761131f6124c9565b602002015183611330836005612612565b600c8110611340576113406124c9565b602002015250600101611199565b50611357611b58565b5f6020826101808560088cfa9151919c9115159b50909950505050505050505050565b6040805180820182528581526020808201859052825180840190935285835282018390525f916113a8611b39565b5f5b600281101561155f575f6113bf8260066124f1565b90508482600281106113d3576113d36124c9565b602002015151836113e4835f612612565b600c81106113f4576113f46124c9565b602002015284826002811061140b5761140b6124c9565b602002015160200151838260016114229190612612565b600c8110611432576114326124c9565b6020020152838260028110611449576114496124c9565b602002015151518361145c836002612612565b600c811061146c5761146c6124c9565b6020020152838260028110611483576114836124c9565b602002015151600160200201518361149c836003612612565b600c81106114ac576114ac6124c9565b60200201528382600281106114c3576114c36124c9565b6020020151602001515f600281106114dd576114dd6124c9565b6020020151836114ee836004612612565b600c81106114fe576114fe6124c9565b6020020152838260028110611515576115156124c9565b602002015160200151600160028110611530576115306124c9565b602002015183611541836005612612565b600c8110611551576115516124c9565b6020020152506001016113aa565b50611568611b58565b5f6020826101808560086107d05a03fa9050808061158257fe5b50806115a1576040516324ccc79360e21b815260040160405180910390fd5b5051151598975050505050505050565b5f60ff8216601f8111156103fe57604051632cd44ac360e21b815260040160405180910390fd5b6115e06119f3565b5f84815260056020908152604080832063ffffffff808816855290835281842086519091168452825280832081516080810183528154818401908152600183015460608301528152600282018054845181870281018701909552808552919492938584019390929083018282801561167557602002820191905f5260205f20905b815481526020019060010190808311611661575b5050509190925250508151519192505f911515905080611699575081516020015115155b905080611742575f6116b98787875f015188604001518960200151611861565b9050806116d95760405163439cc0cd60e01b815260040160405180910390fd5b6040808601515f8981526005602090815283822063ffffffff808c1684529082528483208a51909116835281529290208151805182558301516001820155828201518051929391926117319260028501920190611a1d565b509050508460400151935050611746565b8192505b50509392505050565b604080518082019091525f8082526020820152815115801561177357506020820151155b15611790575050604080518082019091525f808252602082015290565b6040518060400160405280835f015181526020015f5160206126265f395f51905f5284602001516117c191906125ff565b6117d8905f5160206126265f395f51905f526125ec565b905292915050565b919050565b5f80805f5160206126265f395f51905f5260035f5160206126265f395f51905f52865f5160206126265f395f51905f52888909090890505f611855827f0c19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f525f5160206126265f395f51905f526118cc565b91959194509092505050565b5f5f83604051602001611874919061227a565b60408051601f1981840301815291815281516020928301205f8a81526004845282812063ffffffff808c16835294529190912054909250906118c0908590839085908a81169061194516565b98975050505050505050565b5f5f6118d6611b58565b6118de611b76565b602080825281810181905260408201819052606082018890526080820187905260a082018690528260c08360056107d05a03fa9250828061191b57fe5b508261193a5760405163d51edae360e01b815260040160405180910390fd5b505195945050505050565b5f8361195286858561195c565b1495945050505050565b5f6020845161196b91906125ff565b15611989576040516313717da960e21b815260040160405180910390fd5b8260205b855181116119ea576119a06002856125ff565b5f036119c157815f528086015160205260405f2091506002840493506119d8565b808601515f528160205260405f2091506002840493505b6119e3602082612612565b905061198d565b50949350505050565b604080516080810182525f91810182815260608201929092529081905b8152602001606081525090565b828054828255905f5260205f20908101928215611a56579160200282015b82811115611a56578251825591602001919060010190611a3b565b50611a62929150611b94565b5090565b60405180608001604052805f81526020015f8152602001611a1060405180604001604052805f81526020015f81525090565b60405180608001604052805f8152602001611ab1611a66565b815260200160608152602001611ad860405180604001604052805f81526020015f81525090565b905290565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518060400160405280611b2c611ba8565b8152602001611ad8611ba8565b604051806101800160405280600c906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b5b80821115611a62575f8155600101611b95565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b5f52604160045260245ffd5b604080519081016001600160401b0381118282101715611bfc57611bfc611bc6565b60405290565b60405160a081016001600160401b0381118282101715611bfc57611bfc611bc6565b604051606081016001600160401b0381118282101715611bfc57611bfc611bc6565b604051608081016001600160401b0381118282101715611bfc57611bfc611bc6565b604051601f8201601f191681016001600160401b0381118282101715611c9057611c90611bc6565b604052919050565b80356001600160a01b03811681146117e0575f5ffd5b803563ffffffff811681146117e0575f5ffd5b5f60408284031215611cd1575f5ffd5b611cd9611bda565b9050611ce482611c98565b8152611cf260208301611cae565b602082015292915050565b5f60408284031215611d0d575f5ffd5b611d15611bda565b823581526020928301359281019290925250919050565b5f82601f830112611d3b575f5ffd5b611d43611bda565b806040840185811115611d54575f5ffd5b845b81811015611d6e578035845260209384019301611d56565b509095945050505050565b5f60808284031215611d89575f5ffd5b611d91611bda565b9050611d9d8383611d2c565b8152611cf28360408401611d2c565b5f6001600160401b03821115611dc457611dc4611bc6565b5060051b60200190565b5f82601f830112611ddd575f5ffd5b8135611df0611deb82611dac565b611c68565b8082825260208201915060208360051b860101925085831115611e11575f5ffd5b602085015b83811015611e2e578035835260209283019201611e16565b5095945050505050565b5f60608284031215611e48575f5ffd5b611e50611bda565b9050611e5c8383611cfd565b815260408201356001600160401b03811115611e76575f5ffd5b611e8284828501611dce565b60208301525092915050565b5f6101208284031215611e9f575f5ffd5b611ea7611c02565b9050611eb282611cae565b815260208281013590820152611ecb8360408401611cfd565b6040820152611edd8360808401611d79565b60608201526101008201356001600160401b03811115611efb575f5ffd5b8201601f81018413611f0b575f5ffd5b8035611f19611deb82611dac565b8082825260208201915060208360051b850101925086831115611f3a575f5ffd5b602084015b8381101561204a5780356001600160401b03811115611f5c575f5ffd5b85016060818a03601f19011215611f71575f5ffd5b611f79611c24565b611f8560208301611cae565b815260408201356001600160401b03811115611f9f575f5ffd5b82016020810190603f018b13611fb3575f5ffd5b80356001600160401b03811115611fcc57611fcc611bc6565b611fdf601f8201601f1916602001611c68565b8181528c6020838501011115611ff3575f5ffd5b816020840160208301375f6020838301015280602085015250505060608201356001600160401b03811115612026575f5ffd5b6120358b602083860101611e38565b60408301525084525060209283019201611f3f565b5060808501525091949350505050565b5f5f5f6080848603121561206c575f5ffd5b6120768585611cc1565b925060408401356001600160401b03811115612090575f5ffd5b61209c86828701611e8e565b92505060608401356001600160401b038111156120b7575f5ffd5b8401601f810186136120c7575f5ffd5b80356120d5611deb82611dac565b8082825260208201915060208360051b8501019250888311156120f6575f5ffd5b6020840193505b8284101561212757833561ffff81168114612116575f5ffd5b8252602093840193909101906120fd565b809450505050509250925092565b5f5f60608385031215612146575f5ffd5b6121508484611cc1565b915060408301356001600160401b0381111561216a575f5ffd5b61217685828601611e8e565b9150509250929050565b602080825282518282018190525f918401906040840190835b81811015611d6e578351835260209384019390920191600101612199565b5f5f5f5f61012085870312156121cb575f5ffd5b843593506121dc8660208701611cfd565b92506121eb8660608701611d79565b91506121fa8660e08701611cfd565b905092959194509250565b5f5f5f60808486031215612217575f5ffd5b6122218585611cc1565b925061222f60408501611cae565b929592945050506060919091013590565b5f8151808452602084019350602083015f5b82811015612270578151865260209586019590910190600101612252565b5093949350505050565b60208082528251805183830152015160408201525f60208301516060808401526122a76080840182612240565b949350505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f604082840312156122f4575f5ffd5b6103fb8383611cc1565b5f6040828403121561230e575f5ffd5b50919050565b5f5f5f5f60c08587031215612327575f5ffd5b61233186866122fe565b935061233f60408601611cae565b925060608501356001600160401b03811115612359575f5ffd5b850160a0818803121561236a575f5ffd5b612372611c46565b813581526020808301359082015261238d8860408401611cfd565b604082015260808201356001600160401b038111156123aa575f5ffd5b6123b689828501611dce565b60608301525092506121fa905086608087016122fe565b5f5f5f608084860312156123df575f5ffd5b6123e98585611cc1565b925060408401356001600160401b03811115612403575f5ffd5b61240f86828701611e8e565b92505060608401356001600160401b0381111561242a575f5ffd5b61243686828701611dce565b9150509250925092565b5f5f60608385031215612451575f5ffd5b61245b8484611cc1565b915061246960408401611cae565b90509250929050565b80518252602081015160208301525f604082015161249d604085018280518252602090810151910152565b50606082015160a060808501526122a760a0850182612240565b602081525f6103fb6020830184612472565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176103fe576103fe6124dd565b634e487b7160e01b5f52601260045260245ffd5b5f8261252a5761252a612508565b500490565b5f6020828403121561253f575f5ffd5b6103fb82611c98565b5f60208284031215612558575f5ffd5b6103fb82611cae565b6001600160a01b0361257285611c98565b16815263ffffffff61258660208601611cae565b16602082015263ffffffff83166040820152608060608201525f610fb96080830184612472565b8051602080830151919081101561230e575f1960209190910360031b1b16919050565b63ffffffff81811683821601908111156103fe576103fe6124dd565b818103818111156103fe576103fe6124dd565b5f8261260d5761260d612508565b500690565b808201808211156103fe576103fe6124dd56fe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47a2646970667358221220fd2799f8dd695e6668941ff1120d0e40682a75a7d8d30177a7d644d9a340b44264736f6c634300081b0033", + Bin: "0x60c060405234801561000f575f5ffd5b5060405161293738038061293783398101604081905261002e9161016a565b6001600160a01b0382166080528061004581610058565b60a0525061005161009e565b5050610294565b5f5f829050601f8151111561008b578260405163305a27a960e01b81526004016100829190610239565b60405180910390fd5b80516100968261026e565b179392505050565b5f54610100900460ff16156101055760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401610082565b5f5460ff90811614610154575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b634e487b7160e01b5f52604160045260245ffd5b5f5f6040838503121561017b575f5ffd5b82516001600160a01b0381168114610191575f5ffd5b60208401519092506001600160401b038111156101ac575f5ffd5b8301601f810185136101bc575f5ffd5b80516001600160401b038111156101d5576101d5610156565b604051601f8201601f19908116603f011681016001600160401b038111828210171561020357610203610156565b60405281815282820160200187101561021a575f5ffd5b8160208401602083015e5f602083830101528093505050509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b8051602080830151919081101561028e575f198160200360031b1b821691505b50919050565b60805160a05161267b6102bc5f395f6104e401525f81816101de015261062f015261267b5ff3fe608060405234801561000f575f5ffd5b50600436106100cb575f3560e01c80635ddb9b5b1161008857806368d6e0811161006357806368d6e081146101d95780638481892014610218578063dd2ae1b91461022b578063eb39e68f1461023e575f5ffd5b80635ddb9b5b146101895780636141879e146101b15780636738c40b146101c4575f5ffd5b8063017d7974146100cf578063080b7150146100f75780631a18746c1461011757806326af6a3c1461014157806354fd4d50146101615780635be8727414610176575b5f5ffd5b6100e26100dd36600461205a565b61025e565b60405190151581526020015b60405180910390f35b61010a610105366004612135565b6103ef565b6040516100ee9190612180565b61012a6101253660046121b7565b610404565b6040805192151583529015156020830152016100ee565b61015461014f366004612205565b610425565b6040516100ee919061227a565b6101696104dd565b6040516100ee91906122af565b6100e2610184366004612205565b61050d565b61019c6101973660046122e4565b6105d8565b60405163ffffffff90911681526020016100ee565b61019c6101bf3660046122e4565b6105fe565b6101d76101d2366004612314565b610624565b005b6102007f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100ee565b6102006102263660046122e4565b6107f1565b6100e26102393660046123cd565b61081a565b61025161024c366004612440565b6108ad565b6040516100ee91906124b7565b5f5f61026a8585610972565b90505f61027686610b32565b5f8181526004602081815260408084208a5163ffffffff16855282528084208151608081018352815481526001820154818501528251808401845260028301548152600383015481860152818401529381018054835181860281018601909452808452969750949593949093606086019383018282801561031457602002820191905f5260205f20905b815481526020019060010190808311610300575b50505050508152505090505f8160600151905085518451146103495760405163512509d360e11b815260040160405180910390fd5b5f5b84518110156103de575f61271088838151811061036a5761036a6124c9565b602002602001015161ffff16848481518110610388576103886124c9565b602002602001015161039a91906124f1565b6103a4919061251c565b9050808683815181106103b9576103b96124c9565b602002602001015110156103d5575f96505050505050506103e8565b5060010161034b565b5060019450505050505b9392505050565b60606103fb8383610972565b90505b92915050565b5f5f61041886848787600162061a80610b95565b9150915094509492505050565b61042d6119f3565b5f61043785610b32565b5f81815260056020908152604080832063ffffffff8916845282528083208784528252918290208251608081018452815481850190815260018301546060830152815260028201805485518186028101860190965280865295965090949193858401939092908301828280156104ca57602002820191905f5260205f20905b8154815260200190600101908083116104b6575b5050505050815250509150509392505050565b60606105087f0000000000000000000000000000000000000000000000000000000000000000610c5d565b905090565b5f5f61051885610b32565b5f81815260056020908152604080832063ffffffff891684528252808320878452825280832081516080810183528154818401908152600183015460608301528152600282018054845181870281018701909552808552969750949590949193858101939291908301828280156105ac57602002820191905f5260205f20905b815481526020019060010190808311610598575b50505091909252505081515191925050158015906105ce575080516020015115155b9695505050505050565b5f5f6105e383610b32565b5f9081526003602052604090205463ffffffff169392505050565b5f5f61060983610b32565b5f9081526002602052604090205463ffffffff169392505050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461066d5760405163030c1b6b60e11b815260040160405180910390fd5b5f610685610680368790038701876122e4565b610b32565b5f8181526003602052604090205490915063ffffffff908116908516116106bf57604051632f20889f60e01b815260040160405180910390fd5b5f81815260046020818152604080842063ffffffff8916855282529283902086518155818701516001820155928601518051600285015581015160038401556060860151805187949361071793908501920190611a1d565b5050505f818152600360209081526040909120805463ffffffff191663ffffffff87161790556107499083018361252f565b5f8281526001602090815260409182902080546001600160a01b0319166001600160a01b03949094169390931790925561078891908401908401612548565b5f8281526002602052604090819020805463ffffffff191663ffffffff9390931692909217909155517f93e6bea1c9b5dce4a5c07b00261e956df2a4a253d9ab6ca070ca2037d72ada9e906107e290879087908790612561565b60405180910390a15050505050565b5f5f6107fc83610b32565b5f908152600160205260409020546001600160a01b03169392505050565b5f5f6108268585610972565b9050825181511461084a5760405163512509d360e11b815260040160405180910390fd5b5f5b81518110156108a157838181518110610867576108676124c9565b6020026020010151828281518110610881576108816124c9565b60200260200101511015610899575f925050506103e8565b60010161084c565b50600195945050505050565b6108b5611a66565b5f6108bf84610b32565b5f81815260046020818152604080842063ffffffff891685528252928390208351608081018552815481526001820154818401528451808601865260028301548152600383015481850152818601529281018054855181850281018501909652808652959650929490936060860193909290919083018282801561096057602002820191905f5260205f20905b81548152602001906001019080831161094c575b50505050508152505091505092915050565b606061097c611a98565b61098584610b32565b80825283516109949190610c9a565b80515f908152600460208181526040808420875163ffffffff1685528252928390208351608081018552815481526001820154818401528451808601865260028301548152600383015481850152818601529281018054855181850281018501909652808652939491936060860193830182828015610a3057602002820191905f5260205f20905b815481526020019060010190808311610a1c575b505050919092525050506020820181905251610a5f57604051630cad17b760e31b815260040160405180910390fd5b806020015160600151516001600160401b03811115610a8057610a80611bc6565b604051908082528060200260200182016040528015610aa9578160200160208202803683370190505b5060408201525f5b81602001516060015151811015610b0d578160200151606001518181518110610adc57610adc6124c9565b602002602001015182604001518281518110610afa57610afa6124c9565b6020908102919091010152600101610ab1565b50610b188184610cec565b6060820152610b278184610e16565b604001519392505050565b5f815f0151826020015163ffffffff16604051602001610b7d92919060609290921b6bffffffffffffffffffffffff1916825260a01b6001600160a01b031916601482015260200190565b6040516020818303038152906040526103fe906125ad565b5f5f5f610ba189610e84565b90505f610bb08a89898c610f0e565b90505f610bc7610bc08a84610fc2565b8b90611032565b90505f610c09610c0284610bfc6040805180820182525f80825260209182015281518083019092526001825260029082015290565b90610fc2565b8590611032565b90508715610c2e57610c2582610c1d6110a6565b838c8b611166565b96509450610c4e565b610c4182610c3a6110a6565b838c61137a565b95508515610c4e57600194505b50505050965096945050505050565b60605f610c69836115b1565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b5f8281526002602052604090205463ffffffff16801580610cca5750610cc081836125d0565b63ffffffff164211155b610ce75760405163640fcd6b60e11b815260040160405180910390fd5b505050565b6040805180820182525f808252602091820181905282518084019093528083529082018190525b826080015151811015610e0f575f83608001518281518110610d3757610d376124c9565b60200260200101519050846020015160200151815f015163ffffffff1610610d72576040516301fa53c760e11b815260040160405180910390fd5b845184515f91610d8291846115d8565b8051909150610d92908590611032565b93505f5b816020015151811015610e0457866040015151811015610dfc5781602001518181518110610dc657610dc66124c9565b602002602001015187604001518281518110610de457610de46124c9565b60200260200101818151610df891906125ec565b9052505b600101610d96565b505050600101610d13565b5092915050565b5f610e36610e27846060015161174f565b60208501516040015190611032565b90505f5f610e5284602001518486606001518760400151610404565b91509150818015610e605750805b610e7d5760405163439cc0cd60e01b815260040160405180910390fd5b5050505050565b604080518082019091525f80825260208201525f8080610eb15f5160206126265f395f51905f52866125ff565b90505b610ebd816117e5565b90935091505f5160206126265f395f51905f528283098303610ef5576040805180820190915290815260208101919091529392505050565b5f5160206126265f395f51905f52600182089050610eb4565b8251602080850151845180519083015186840151805190850151875188870151604080519889018e90528801989098526060870195909552608086019390935260a085019190915260c084015260e08301526101008201526101208101919091525f907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019061014001604051602081830303815290604052805190602001205f1c610fb991906125ff565b95945050505050565b604080518082019091525f8082526020820152610fdd611add565b835181526020808501519082015260408082018490525f908360608460076107d05a03fa9050808061100b57fe5b508061102a57604051632319df1960e11b815260040160405180910390fd5b505092915050565b604080518082019091525f808252602082015261104d611afb565b835181526020808501518183015283516040808401919091529084015160608301525f908360808460066107d05a03fa9050808061108757fe5b508061102a5760405163d4b68fd760e01b815260040160405180910390fd5b6110ae611b19565b50604080516080810182527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28183019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed6060830152815281518083019092527f275dc4a288d1afb3cbb1ac09187524c7db36395df7be3b99e673b13a075a65ec82527f1d9befcd05a5323e6da4d435f3b617cdb3af83285c2df711ef39c01571827f9d60208381019190915281019190915290565b6040805180820182528681526020808201869052825180840190935286835282018490525f91829190611197611b39565b5f5b600281101561134e575f6111ae8260066124f1565b90508482600281106111c2576111c26124c9565b602002015151836111d3835f612612565b600c81106111e3576111e36124c9565b60200201528482600281106111fa576111fa6124c9565b602002015160200151838260016112119190612612565b600c8110611221576112216124c9565b6020020152838260028110611238576112386124c9565b602002015151518361124b836002612612565b600c811061125b5761125b6124c9565b6020020152838260028110611272576112726124c9565b602002015151600160200201518361128b836003612612565b600c811061129b5761129b6124c9565b60200201528382600281106112b2576112b26124c9565b6020020151602001515f600281106112cc576112cc6124c9565b6020020151836112dd836004612612565b600c81106112ed576112ed6124c9565b6020020152838260028110611304576113046124c9565b60200201516020015160016002811061131f5761131f6124c9565b602002015183611330836005612612565b600c8110611340576113406124c9565b602002015250600101611199565b50611357611b58565b5f6020826101808560088cfa9151919c9115159b50909950505050505050505050565b6040805180820182528581526020808201859052825180840190935285835282018390525f916113a8611b39565b5f5b600281101561155f575f6113bf8260066124f1565b90508482600281106113d3576113d36124c9565b602002015151836113e4835f612612565b600c81106113f4576113f46124c9565b602002015284826002811061140b5761140b6124c9565b602002015160200151838260016114229190612612565b600c8110611432576114326124c9565b6020020152838260028110611449576114496124c9565b602002015151518361145c836002612612565b600c811061146c5761146c6124c9565b6020020152838260028110611483576114836124c9565b602002015151600160200201518361149c836003612612565b600c81106114ac576114ac6124c9565b60200201528382600281106114c3576114c36124c9565b6020020151602001515f600281106114dd576114dd6124c9565b6020020151836114ee836004612612565b600c81106114fe576114fe6124c9565b6020020152838260028110611515576115156124c9565b602002015160200151600160028110611530576115306124c9565b602002015183611541836005612612565b600c8110611551576115516124c9565b6020020152506001016113aa565b50611568611b58565b5f6020826101808560086107d05a03fa9050808061158257fe5b50806115a1576040516324ccc79360e21b815260040160405180910390fd5b5051151598975050505050505050565b5f60ff8216601f8111156103fe57604051632cd44ac360e21b815260040160405180910390fd5b6115e06119f3565b5f84815260056020908152604080832063ffffffff808816855290835281842086519091168452825280832081516080810183528154818401908152600183015460608301528152600282018054845181870281018701909552808552919492938584019390929083018282801561167557602002820191905f5260205f20905b815481526020019060010190808311611661575b5050509190925250508151519192505f911515905080611699575081516020015115155b905080611742575f6116b98787875f015188604001518960200151611861565b9050806116d95760405163439cc0cd60e01b815260040160405180910390fd5b6040808601515f8981526005602090815283822063ffffffff808c1684529082528483208a51909116835281529290208151805182558301516001820155828201518051929391926117319260028501920190611a1d565b509050508460400151935050611746565b8192505b50509392505050565b604080518082019091525f8082526020820152815115801561177357506020820151155b15611790575050604080518082019091525f808252602082015290565b6040518060400160405280835f015181526020015f5160206126265f395f51905f5284602001516117c191906125ff565b6117d8905f5160206126265f395f51905f526125ec565b905292915050565b919050565b5f80805f5160206126265f395f51905f5260035f5160206126265f395f51905f52865f5160206126265f395f51905f52888909090890505f611855827f0c19139cb84c680a6e14116da060561765e05aa45a1c72a34f082305b61f3f525f5160206126265f395f51905f526118cc565b91959194509092505050565b5f5f83604051602001611874919061227a565b60408051601f1981840301815291815281516020928301205f8a81526004845282812063ffffffff808c16835294529190912054909250906118c0908590839085908a81169061194516565b98975050505050505050565b5f5f6118d6611b58565b6118de611b76565b602080825281810181905260408201819052606082018890526080820187905260a082018690528260c08360056107d05a03fa9250828061191b57fe5b508261193a5760405163d51edae360e01b815260040160405180910390fd5b505195945050505050565b5f8361195286858561195c565b1495945050505050565b5f6020845161196b91906125ff565b15611989576040516313717da960e21b815260040160405180910390fd5b8260205b855181116119ea576119a06002856125ff565b5f036119c157815f528086015160205260405f2091506002840493506119d8565b808601515f528160205260405f2091506002840493505b6119e3602082612612565b905061198d565b50949350505050565b604080516080810182525f91810182815260608201929092529081905b8152602001606081525090565b828054828255905f5260205f20908101928215611a56579160200282015b82811115611a56578251825591602001919060010190611a3b565b50611a62929150611b94565b5090565b60405180608001604052805f81526020015f8152602001611a1060405180604001604052805f81526020015f81525090565b60405180608001604052805f8152602001611ab1611a66565b815260200160608152602001611ad860405180604001604052805f81526020015f81525090565b905290565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b6040518060400160405280611b2c611ba8565b8152602001611ad8611ba8565b604051806101800160405280600c906020820280368337509192915050565b60405180602001604052806001906020820280368337509192915050565b6040518060c001604052806006906020820280368337509192915050565b5b80821115611a62575f8155600101611b95565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b5f52604160045260245ffd5b604080519081016001600160401b0381118282101715611bfc57611bfc611bc6565b60405290565b60405160a081016001600160401b0381118282101715611bfc57611bfc611bc6565b604051606081016001600160401b0381118282101715611bfc57611bfc611bc6565b604051608081016001600160401b0381118282101715611bfc57611bfc611bc6565b604051601f8201601f191681016001600160401b0381118282101715611c9057611c90611bc6565b604052919050565b80356001600160a01b03811681146117e0575f5ffd5b803563ffffffff811681146117e0575f5ffd5b5f60408284031215611cd1575f5ffd5b611cd9611bda565b9050611ce482611c98565b8152611cf260208301611cae565b602082015292915050565b5f60408284031215611d0d575f5ffd5b611d15611bda565b823581526020928301359281019290925250919050565b5f82601f830112611d3b575f5ffd5b611d43611bda565b806040840185811115611d54575f5ffd5b845b81811015611d6e578035845260209384019301611d56565b509095945050505050565b5f60808284031215611d89575f5ffd5b611d91611bda565b9050611d9d8383611d2c565b8152611cf28360408401611d2c565b5f6001600160401b03821115611dc457611dc4611bc6565b5060051b60200190565b5f82601f830112611ddd575f5ffd5b8135611df0611deb82611dac565b611c68565b8082825260208201915060208360051b860101925085831115611e11575f5ffd5b602085015b83811015611e2e578035835260209283019201611e16565b5095945050505050565b5f60608284031215611e48575f5ffd5b611e50611bda565b9050611e5c8383611cfd565b815260408201356001600160401b03811115611e76575f5ffd5b611e8284828501611dce565b60208301525092915050565b5f6101208284031215611e9f575f5ffd5b611ea7611c02565b9050611eb282611cae565b815260208281013590820152611ecb8360408401611cfd565b6040820152611edd8360808401611d79565b60608201526101008201356001600160401b03811115611efb575f5ffd5b8201601f81018413611f0b575f5ffd5b8035611f19611deb82611dac565b8082825260208201915060208360051b850101925086831115611f3a575f5ffd5b602084015b8381101561204a5780356001600160401b03811115611f5c575f5ffd5b85016060818a03601f19011215611f71575f5ffd5b611f79611c24565b611f8560208301611cae565b815260408201356001600160401b03811115611f9f575f5ffd5b82016020810190603f018b13611fb3575f5ffd5b80356001600160401b03811115611fcc57611fcc611bc6565b611fdf601f8201601f1916602001611c68565b8181528c6020838501011115611ff3575f5ffd5b816020840160208301375f6020838301015280602085015250505060608201356001600160401b03811115612026575f5ffd5b6120358b602083860101611e38565b60408301525084525060209283019201611f3f565b5060808501525091949350505050565b5f5f5f6080848603121561206c575f5ffd5b6120768585611cc1565b925060408401356001600160401b03811115612090575f5ffd5b61209c86828701611e8e565b92505060608401356001600160401b038111156120b7575f5ffd5b8401601f810186136120c7575f5ffd5b80356120d5611deb82611dac565b8082825260208201915060208360051b8501019250888311156120f6575f5ffd5b6020840193505b8284101561212757833561ffff81168114612116575f5ffd5b8252602093840193909101906120fd565b809450505050509250925092565b5f5f60608385031215612146575f5ffd5b6121508484611cc1565b915060408301356001600160401b0381111561216a575f5ffd5b61217685828601611e8e565b9150509250929050565b602080825282518282018190525f918401906040840190835b81811015611d6e578351835260209384019390920191600101612199565b5f5f5f5f61012085870312156121cb575f5ffd5b843593506121dc8660208701611cfd565b92506121eb8660608701611d79565b91506121fa8660e08701611cfd565b905092959194509250565b5f5f5f60808486031215612217575f5ffd5b6122218585611cc1565b925061222f60408501611cae565b929592945050506060919091013590565b5f8151808452602084019350602083015f5b82811015612270578151865260209586019590910190600101612252565b5093949350505050565b60208082528251805183830152015160408201525f60208301516060808401526122a76080840182612240565b949350505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f604082840312156122f4575f5ffd5b6103fb8383611cc1565b5f6040828403121561230e575f5ffd5b50919050565b5f5f5f5f60c08587031215612327575f5ffd5b61233186866122fe565b935061233f60408601611cae565b925060608501356001600160401b03811115612359575f5ffd5b850160a0818803121561236a575f5ffd5b612372611c46565b813581526020808301359082015261238d8860408401611cfd565b604082015260808201356001600160401b038111156123aa575f5ffd5b6123b689828501611dce565b60608301525092506121fa905086608087016122fe565b5f5f5f608084860312156123df575f5ffd5b6123e98585611cc1565b925060408401356001600160401b03811115612403575f5ffd5b61240f86828701611e8e565b92505060608401356001600160401b0381111561242a575f5ffd5b61243686828701611dce565b9150509250925092565b5f5f60608385031215612451575f5ffd5b61245b8484611cc1565b915061246960408401611cae565b90509250929050565b80518252602081015160208301525f604082015161249d604085018280518252602090810151910152565b50606082015160a060808501526122a760a0850182612240565b602081525f6103fb6020830184612472565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176103fe576103fe6124dd565b634e487b7160e01b5f52601260045260245ffd5b5f8261252a5761252a612508565b500490565b5f6020828403121561253f575f5ffd5b6103fb82611c98565b5f60208284031215612558575f5ffd5b6103fb82611cae565b6001600160a01b0361257285611c98565b16815263ffffffff61258660208601611cae565b16602082015263ffffffff83166040820152608060608201525f610fb96080830184612472565b8051602080830151919081101561230e575f1960209190910360031b1b16919050565b63ffffffff81811683821601908111156103fe576103fe6124dd565b818103818111156103fe576103fe6124dd565b5f8261260d5761260d612508565b500690565b808201808211156103fe576103fe6124dd56fe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47a2646970667358221220808eac6a801e660a415f16e4c4f00978e3b42070176fe9e5bc413769ed2834df64736f6c634300081b0033", } // BN254CertificateVerifierABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/ECDSACertificateVerifier/binding.go b/pkg/bindings/ECDSACertificateVerifier/binding.go index a95fc5d31d..d84a3ecbf4 100644 --- a/pkg/bindings/ECDSACertificateVerifier/binding.go +++ b/pkg/bindings/ECDSACertificateVerifier/binding.go @@ -57,7 +57,7 @@ type OperatorSet struct { // ECDSACertificateVerifierMetaData contains all meta data concerning the ECDSACertificateVerifier contract. var ECDSACertificateVerifierMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_operatorTableUpdater\",\"type\":\"address\",\"internalType\":\"contractIOperatorTableUpdater\"},{\"name\":\"_version\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"calculateCertificateDigest\",\"inputs\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorCount\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfo\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfos\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetOwner\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalStakes\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestReferenceTimestamp\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxOperatorTableStaleness\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorTableUpdater\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOperatorTableUpdater\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateOperatorTable\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"operatorSetConfig\",\"type\":\"tuple\",\"internalType\":\"structICrossChainRegistryTypes.OperatorSetConfig\",\"components\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificate\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyCertificateNominal\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeNominalThresholds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyCertificateProportion\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeProportionThresholds\",\"type\":\"uint16[]\",\"internalType\":\"uint16[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"MaxStalenessPeriodUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetOwnerUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TableUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CertificateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidShortString\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyTableUpdater\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReferenceTimestampDoesNotExist\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"SignatureExpired\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StringTooLong\",\"inputs\":[{\"name\":\"str\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"TableUpdateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VerificationFailed\",\"inputs\":[]}]", - Bin: "0x60c060405234801561000f575f5ffd5b5060405161235d38038061235d83398101604081905261002e9161016d565b6001600160a01b03821660805280806100468161005b565b60a0525061005490506100a1565b5050610297565b5f5f829050601f8151111561008e578260405163305a27a960e01b8152600401610085919061023c565b60405180910390fd5b805161009982610271565b179392505050565b5f54610100900460ff16156101085760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401610085565b5f5460ff90811614610157575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b634e487b7160e01b5f52604160045260245ffd5b5f5f6040838503121561017e575f5ffd5b82516001600160a01b0381168114610194575f5ffd5b60208401519092506001600160401b038111156101af575f5ffd5b8301601f810185136101bf575f5ffd5b80516001600160401b038111156101d8576101d8610159565b604051601f8201601f19908116603f011681016001600160401b038111828210171561020657610206610159565b60405281815282820160200187101561021d575f5ffd5b8160208401602083015e5f602083830101528093505050509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80516020808301519190811015610291575f198160200360031b1b821691505b50919050565b60805160a0516120976102c65f395f8181610679015261118201525f81816101db01526106ad01526120975ff3fe608060405234801561000f575f5ffd5b50600436106100f0575f3560e01c80636141879e1161009357806384818920116100635780638481892014610248578063be86e0b21461025b578063c0da24201461027e578063f698da2514610291575f5ffd5b80636141879e146101c357806368d6e081146101d65780637c85ac4c1461021557806380c7d3f314610235575f5ffd5b806323c2a3cb116100ce57806323c2a3cb1461015e57806354fd4d501461018657806356d482f51461019b5780635ddb9b5b146101b0575f5ffd5b806304cdbae4146100f4578063082ef73d1461011d578063184674341461013d575b5f5ffd5b6101076101023660046116ee565b610299565b6040516101149190611720565b60405180910390f35b61013061012b36600461181a565b61049d565b60405161011491906118b0565b61015061014b3660046118c2565b6105d0565b604051908152602001610114565b61017161016c3660046118ea565b61063f565b60405163ffffffff9091168152602001610114565b61018e610672565b6040516101149190611933565b6101ae6101a9366004611985565b6106a2565b005b6101716101be3660046119f7565b61089f565b6101716101d13660046119f7565b6108c5565b6101fd7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b6102286102233660046118ea565b6108eb565b6040516101149190611a11565b610107610243366004611a84565b610a59565b6101fd6102563660046119f7565b610a65565b61026e610269366004611acf565b610a8e565b6040519015158152602001610114565b61026e61028c366004611bb1565b610b21565b610150610c13565b60605f6102b36102ae368690038601866119f7565b610cd3565b5f8181526003602052604090205490915063ffffffff8481169116146102ec57604051630cad17b760e31b815260040160405180910390fd5b5f81815260046020908152604080832063ffffffff871684529091529020548061032957604051630cad17b760e31b815260040160405180910390fd5b5f82815260056020908152604080832063ffffffff88168452825280832083805290915281206001015490816001600160401b0381111561036c5761036c611762565b604051908082528060200260200182016040528015610395578160200160208202803683370190505b5090505f5b83811015610490575f85815260056020908152604080832063ffffffff808c168552908352818420908516845282528083206001018054825181850281018501909352808352919290919083018282801561041257602002820191905f5260205f20905b8154815260200190600101908083116103fe575b509394505f93505050505b81518110801561042c57508481105b156104865781818151811061044357610443611c27565b602002602001015184828151811061045d5761045d611c27565b602002602001018181516104719190611c4f565b9052508061047e81611c62565b91505061041d565b505060010161039a565b5093505050505b92915050565b604080518082019091525f8152606060208201525f6104bb85610cd3565b5f81815260046020908152604080832063ffffffff808a1685529252909120549192508416106105315760405162461bcd60e51b815260206004820152601c60248201527f4f70657261746f7220696e646578206f7574206f6620626f756e647300000000604482015260640160405180910390fd5b5f81815260056020908152604080832063ffffffff808916855290835281842090871684528252918290208251808401845281546001600160a01b03168152600182018054855181860281018601909652808652919492938581019392908301828280156105bc57602002820191905f5260205f20905b8154815260200190600101908083116105a8575b5050505050815250509150505b9392505050565b604080517fda346acb3ce99e7c5132bf8cafb159ad8085970ebfdba78007ef0fe163063d14602082015263ffffffff841691810191909152606081018290525f90819060800160405160208183030381529060405280519060200120905061063781610d36565b949350505050565b5f5f61064a84610cd3565b5f90815260046020908152604080832063ffffffff8716845290915290205491505092915050565b606061069d7f0000000000000000000000000000000000000000000000000000000000000000610d7c565b905090565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106eb5760405163030c1b6b60e11b815260040160405180910390fd5b5f6106fe6102ae368890038801886119f7565b5f8181526003602052604090205490915063ffffffff9081169086161161073857604051632f20889f60e01b815260040160405180910390fd5b5f81815260046020908152604080832063ffffffff8916845290915281208490555b838110156107c45784848281811061077457610774611c27565b90506020028101906107869190611c7a565b5f83815260056020908152604080832063ffffffff808c168552908352818420908616845290915290206107ba8282611caf565b505060010161075a565b505f818152600360209081526040909120805463ffffffff191663ffffffff88161790556107f490830183611db2565b5f8281526001602090815260409182902080546001600160a01b0319166001600160a01b03949094169390931790925561083391908401908401611dcd565b5f8281526002602052604090819020805463ffffffff191663ffffffff9390931692909217909155517f4f588da9ec57976194a79b5594f8f8782923d93013df2b9ed12fe125805011ef9061088f908890889088908890611de6565b60405180910390a1505050505050565b5f5f6108aa83610cd3565b5f9081526003602052604090205463ffffffff169392505050565b5f5f6108d083610cd3565b5f9081526002602052604090205463ffffffff169392505050565b60605f6108f784610cd3565b5f81815260046020908152604080832063ffffffff8089168552925282205492935082166001600160401b0381111561093257610932611762565b60405190808252806020026020018201604052801561097757816020015b604080518082019091525f8152606060208201528152602001906001900390816109505790505b5090505f5b8263ffffffff168163ffffffff161015610a4f575f84815260056020908152604080832063ffffffff808b16855290835281842090851684528252918290208251808401845281546001600160a01b0316815260018201805485518186028101860190965280865291949293858101939290830182828015610a1b57602002820191905f5260205f20905b815481526020019060010190808311610a07575b505050505081525050828263ffffffff1681518110610a3c57610a3c611c27565b602090810291909101015260010161097c565b5095945050505050565b60606105c98383610db9565b5f5f610a7083610cd3565b5f908152600160205260409020546001600160a01b03169392505050565b5f5f610a9a8585610db9565b90508251815114610abe5760405163512509d360e11b815260040160405180910390fd5b5f5b8151811015610b1557838181518110610adb57610adb611c27565b6020026020010151828281518110610af557610af5611c27565b60200260200101511015610b0d575f925050506105c9565b600101610ac0565b50600195945050505050565b5f5f610b2d8686610db9565b90505f610b41876101026020890189611dcd565b82519091508414610b655760405163512509d360e11b815260040160405180910390fd5b5f5b8251811015610c05575f612710878784818110610b8657610b86611c27565b9050602002016020810190610b9b9190611f19565b61ffff16848481518110610bb157610bb1611c27565b6020026020010151610bc39190611c98565b610bcd9190611f4e565b905080848381518110610be257610be2611c27565b60200260200101511015610bfc575f945050505050610637565b50600101610b67565b506001979650505050505050565b60408051808201909152600a81526922b4b3b2b72630bcb2b960b11b6020909101525f7f91ab3d17e3a50a9d89e63fd30b92be7f5336b03b287bb946787a83a9d62a27667f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea610c8061117a565b8051602091820120604051610cb8949392309101938452602084019290925260408301526001600160a01b0316606082015260800190565b60405160208183030381529060405280519060200120905090565b5f815f0151826020015163ffffffff16604051602001610d1e92919060609290921b6bffffffffffffffffffffffff1916825260a01b6001600160a01b031916601482015260200190565b60405160208183030381529060405261049790611f61565b5f610d3f610c13565b60405161190160f01b6020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050919050565b60605f610d88836111ef565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b60605f610dce6102ae368690038601866119f7565b5f8181526002602090815260409091205491925063ffffffff90911690610df790850185611dcd565b610e019190611f84565b63ffffffff16421115610e275760405163640fcd6b60e11b815260040160405180910390fd5b610e346020840184611dcd565b5f8281526003602052604090205463ffffffff908116911614610e6a57604051630cad17b760e31b815260040160405180910390fd5b5f610e7c856101026020870187611dcd565b90505f81516001600160401b03811115610e9857610e98611762565b604051908082528060200260200182016040528015610ec1578160200160208202803683370190505b5090505f610edf610ed56020880188611dcd565b87602001356105d0565b90505f80610f2d83610ef460408b018b611fa0565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061121692505050565b9150915080610f4f5760405163439cc0cd60e01b815260040160405180910390fd5b5f5b825181101561116c575f838281518110610f6d57610f6d611c27565b602002602001015190505f5f9050610fa060405180604001604052805f6001600160a01b03168152602001606081525090565b5f5b60045f8c81526020019081526020015f205f8e5f016020810190610fc69190611dcd565b63ffffffff1663ffffffff1681526020019081526020015f20548110156110cb5760055f8c81526020019081526020015f205f8e5f01602081019061100b9190611dcd565b63ffffffff908116825260208083019390935260409182015f90812091851681529083528190208151808301835281546001600160a01b03168152600182018054845181870281018701909552808552919492938584019390929083018282801561109357602002820191905f5260205f20905b81548152602001906001019080831161107f575b5050505050815250509150836001600160a01b0316825f01516001600160a01b0316036110c357600192506110cb565b600101610fa2565b50816110ea5760405163439cc0cd60e01b815260040160405180910390fd5b60208101515f5b8151811080156111015750895181105b1561115b5781818151811061111857611118611c27565b60200260200101518a828151811061113257611132611c27565b602002602001018181516111469190611c4f565b9052508061115381611c62565b9150506110f1565b505060019093019250610f51915050565b509298975050505050505050565b60605f6111a67f0000000000000000000000000000000000000000000000000000000000000000610d7c565b9050805f815181106111ba576111ba611c27565b016020908101516040516001600160f81b03199091169181019190915260210160405160208183030381529060405291505090565b5f60ff8216601f81111561049757604051632cd44ac360e21b815260040160405180910390fd5b60605f604183516112279190611fe2565b1561124557604051634be6321b60e01b815260040160405180910390fd5b5f604184516112549190611f4e565b9050806001600160401b0381111561126e5761126e611762565b604051908082528060200260200182016040528015611297578160200160208202803683370190505b5092505f5b8181101561141957604080516041808252608082019092525f916020820181803683370190505090505f5b60418110156113325786816112dd856041611c98565b6112e79190611c4f565b815181106112f7576112f7611c27565b602001015160f81c60f81b82828151811061131457611314611c27565b60200101906001600160f81b03191690815f1a9053506001016112c7565b505f5f61133f8984611427565b90925090505f81600481111561135757611357611ff5565b14158061136b57506001600160a01b038216155b1561137e57505f94506114209350505050565b5f841180156113c2575086611394600186612009565b815181106113a4576113a4611c27565b60200260200101516001600160a01b0316826001600160a01b031611155b156113d557505f94506114209350505050565b6113e2828a855f19611466565b818785815181106113f5576113f5611c27565b6001600160a01b03929092166020928302919091019091015250505060010161129c565b5060019150505b9250929050565b5f5f825160410361145b576020830151604084015160608501515f1a61144f878285856114be565b94509450505050611420565b505f90506002611420565b4281101561148757604051630819bdcd60e01b815260040160405180910390fd5b61149b6001600160a01b038516848461157b565b6114b857604051638baa579f60e01b815260040160405180910390fd5b50505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156114f357505f90506003611572565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611544573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b03811661156c575f60019250925050611572565b91505f90505b94509492505050565b5f5f5f6115888585611427565b90925090505f8160048111156115a0576115a0611ff5565b1480156115be5750856001600160a01b0316826001600160a01b0316145b806115cf57506115cf8686866115d9565b9695505050505050565b5f5f5f856001600160a01b0316631626ba7e60e01b868660405160240161160192919061201c565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161163f9190612034565b5f60405180830381855afa9150503d805f8114611677576040519150601f19603f3d011682016040523d82523d5f602084013e61167c565b606091505b509150915081801561169057506020815110155b80156115cf57508051630b135d3f60e11b906116b5908301602090810190840161204a565b149695505050505050565b5f604082840312156116d0575f5ffd5b50919050565b803563ffffffff811681146116e9575f5ffd5b919050565b5f5f606083850312156116ff575f5ffd5b61170984846116c0565b9150611717604084016116d6565b90509250929050565b602080825282518282018190525f918401906040840190835b81811015611757578351835260209384019390920191600101611739565b509095945050505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561179e5761179e611762565b604052919050565b6001600160a01b03811681146117ba575f5ffd5b50565b5f604082840312156117cd575f5ffd5b604080519081016001600160401b03811182821017156117ef576117ef611762565b6040529050808235611800816117a6565b815261180e602084016116d6565b60208201525092915050565b5f5f5f6080848603121561182c575f5ffd5b61183685856117bd565b9250611844604085016116d6565b9150611852606085016116d6565b90509250925092565b80516001600160a01b03168252602080820151604082850181905281519085018190525f929190910190829060608601905b80831015610a4f578351825260208201915060208401935060018301925061188d565b602081525f6105c9602083018461185b565b5f5f604083850312156118d3575f5ffd5b6118dc836116d6565b946020939093013593505050565b5f5f606083850312156118fb575f5ffd5b61170984846117bd565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6105c96020830184611905565b5f5f83601f840112611955575f5ffd5b5081356001600160401b0381111561196b575f5ffd5b6020830191508360208260051b8501011115611420575f5ffd5b5f5f5f5f5f60c08688031215611999575f5ffd5b6119a387876116c0565b94506119b1604087016116d6565b935060608601356001600160401b038111156119cb575f5ffd5b6119d788828901611945565b90945092506119eb905087608088016116c0565b90509295509295909350565b5f60408284031215611a07575f5ffd5b6105c983836117bd565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b82811015611a6857603f19878603018452611a5385835161185b565b94506020938401939190910190600101611a37565b50929695505050505050565b5f606082840312156116d0575f5ffd5b5f5f60608385031215611a95575f5ffd5b611a9f84846116c0565b915060408301356001600160401b03811115611ab9575f5ffd5b611ac585828601611a74565b9150509250929050565b5f5f5f60808486031215611ae1575f5ffd5b611aeb85856116c0565b925060408401356001600160401b03811115611b05575f5ffd5b611b1186828701611a74565b92505060608401356001600160401b03811115611b2c575f5ffd5b8401601f81018613611b3c575f5ffd5b80356001600160401b03811115611b5557611b55611762565b8060051b611b6560208201611776565b91825260208184018101929081019089841115611b80575f5ffd5b6020850194505b83851015611ba2578435825260209485019490910190611b87565b80955050505050509250925092565b5f5f5f5f60808587031215611bc4575f5ffd5b611bce86866116c0565b935060408501356001600160401b03811115611be8575f5ffd5b611bf487828801611a74565b93505060608501356001600160401b03811115611c0f575f5ffd5b611c1b87828801611945565b95989497509550505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8082018082111561049757610497611c3b565b5f60018201611c7357611c73611c3b565b5060010190565b5f8235603e19833603018112611c8e575f5ffd5b9190910192915050565b808202811582820484141761049757610497611c3b565b8135611cba816117a6565b81546001600160a01b0319166001600160a01b0391909116178155602082013536839003601e19018112611cec575f5ffd5b820180356001600160401b03811115611d03575f5ffd5b6020820191508060051b3603821315611d1a575f5ffd5b600183016001600160401b03821115611d3557611d35611762565b68010000000000000000821115611d4e57611d4e611762565b805482825580831015611d83575f828152602090208381019082015b80821015611d80575f8255600182019150611d6a565b50505b505f90815260208120905b82811015611daa57833582820155602090930192600101611d8e565b505050505050565b5f60208284031215611dc2575f5ffd5b81356105c9816117a6565b5f60208284031215611ddd575f5ffd5b6105c9826116d6565b5f608082018635611df6816117a6565b6001600160a01b0316835263ffffffff611e12602089016116d6565b16602084015263ffffffff861660408401526080606084015283905260a0600584901b83018101908301855f603e1936839003015b87821015611f0a57868503609f190184528235818112611e65575f5ffd5b89018035611e72816117a6565b6001600160a01b03168652602081013536829003601e19018112611e94575f5ffd5b016020810190356001600160401b03811115611eae575f5ffd5b8060051b803603831315611ec0575f5ffd5b60406020890181905288018290526001600160fb1b03821115611ee1575f5ffd5b808360608a01376060818901019750505050602083019250602084019350600182019150611e47565b50929998505050505050505050565b5f60208284031215611f29575f5ffd5b813561ffff811681146105c9575f5ffd5b634e487b7160e01b5f52601260045260245ffd5b5f82611f5c57611f5c611f3a565b500490565b805160208083015191908110156116d0575f1960209190910360031b1b16919050565b63ffffffff818116838216019081111561049757610497611c3b565b5f5f8335601e19843603018112611fb5575f5ffd5b8301803591506001600160401b03821115611fce575f5ffd5b602001915036819003821315611420575f5ffd5b5f82611ff057611ff0611f3a565b500690565b634e487b7160e01b5f52602160045260245ffd5b8181038181111561049757610497611c3b565b828152604060208201525f6106376040830184611905565b5f82518060208501845e5f920191825250919050565b5f6020828403121561205a575f5ffd5b505191905056fea26469706673582212204ab2e5a3db3ef47b225060aabe7ae55676a783476d90d9285e6e11dad82d421f64736f6c634300081b0033", + Bin: "0x60c060405234801561000f575f5ffd5b5060405161235d38038061235d83398101604081905261002e9161016d565b6001600160a01b03821660805280806100468161005b565b60a0525061005490506100a1565b5050610297565b5f5f829050601f8151111561008e578260405163305a27a960e01b8152600401610085919061023c565b60405180910390fd5b805161009982610271565b179392505050565b5f54610100900460ff16156101085760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401610085565b5f5460ff90811614610157575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b634e487b7160e01b5f52604160045260245ffd5b5f5f6040838503121561017e575f5ffd5b82516001600160a01b0381168114610194575f5ffd5b60208401519092506001600160401b038111156101af575f5ffd5b8301601f810185136101bf575f5ffd5b80516001600160401b038111156101d8576101d8610159565b604051601f8201601f19908116603f011681016001600160401b038111828210171561020657610206610159565b60405281815282820160200187101561021d575f5ffd5b8160208401602083015e5f602083830101528093505050509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80516020808301519190811015610291575f198160200360031b1b821691505b50919050565b60805160a0516120976102c65f395f8181610679015261118201525f81816101db01526106ad01526120975ff3fe608060405234801561000f575f5ffd5b50600436106100f0575f3560e01c80636141879e1161009357806384818920116100635780638481892014610248578063be86e0b21461025b578063c0da24201461027e578063f698da2514610291575f5ffd5b80636141879e146101c357806368d6e081146101d65780637c85ac4c1461021557806380c7d3f314610235575f5ffd5b806323c2a3cb116100ce57806323c2a3cb1461015e57806354fd4d501461018657806356d482f51461019b5780635ddb9b5b146101b0575f5ffd5b806304cdbae4146100f4578063082ef73d1461011d578063184674341461013d575b5f5ffd5b6101076101023660046116ee565b610299565b6040516101149190611720565b60405180910390f35b61013061012b36600461181a565b61049d565b60405161011491906118b0565b61015061014b3660046118c2565b6105d0565b604051908152602001610114565b61017161016c3660046118ea565b61063f565b60405163ffffffff9091168152602001610114565b61018e610672565b6040516101149190611933565b6101ae6101a9366004611985565b6106a2565b005b6101716101be3660046119f7565b61089f565b6101716101d13660046119f7565b6108c5565b6101fd7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610114565b6102286102233660046118ea565b6108eb565b6040516101149190611a11565b610107610243366004611a84565b610a59565b6101fd6102563660046119f7565b610a65565b61026e610269366004611acf565b610a8e565b6040519015158152602001610114565b61026e61028c366004611bb1565b610b21565b610150610c13565b60605f6102b36102ae368690038601866119f7565b610cd3565b5f8181526003602052604090205490915063ffffffff8481169116146102ec57604051630cad17b760e31b815260040160405180910390fd5b5f81815260046020908152604080832063ffffffff871684529091529020548061032957604051630cad17b760e31b815260040160405180910390fd5b5f82815260056020908152604080832063ffffffff88168452825280832083805290915281206001015490816001600160401b0381111561036c5761036c611762565b604051908082528060200260200182016040528015610395578160200160208202803683370190505b5090505f5b83811015610490575f85815260056020908152604080832063ffffffff808c168552908352818420908516845282528083206001018054825181850281018501909352808352919290919083018282801561041257602002820191905f5260205f20905b8154815260200190600101908083116103fe575b509394505f93505050505b81518110801561042c57508481105b156104865781818151811061044357610443611c27565b602002602001015184828151811061045d5761045d611c27565b602002602001018181516104719190611c4f565b9052508061047e81611c62565b91505061041d565b505060010161039a565b5093505050505b92915050565b604080518082019091525f8152606060208201525f6104bb85610cd3565b5f81815260046020908152604080832063ffffffff808a1685529252909120549192508416106105315760405162461bcd60e51b815260206004820152601c60248201527f4f70657261746f7220696e646578206f7574206f6620626f756e647300000000604482015260640160405180910390fd5b5f81815260056020908152604080832063ffffffff808916855290835281842090871684528252918290208251808401845281546001600160a01b03168152600182018054855181860281018601909652808652919492938581019392908301828280156105bc57602002820191905f5260205f20905b8154815260200190600101908083116105a8575b5050505050815250509150505b9392505050565b604080517fda346acb3ce99e7c5132bf8cafb159ad8085970ebfdba78007ef0fe163063d14602082015263ffffffff841691810191909152606081018290525f90819060800160405160208183030381529060405280519060200120905061063781610d36565b949350505050565b5f5f61064a84610cd3565b5f90815260046020908152604080832063ffffffff8716845290915290205491505092915050565b606061069d7f0000000000000000000000000000000000000000000000000000000000000000610d7c565b905090565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146106eb5760405163030c1b6b60e11b815260040160405180910390fd5b5f6106fe6102ae368890038801886119f7565b5f8181526003602052604090205490915063ffffffff9081169086161161073857604051632f20889f60e01b815260040160405180910390fd5b5f81815260046020908152604080832063ffffffff8916845290915281208490555b838110156107c45784848281811061077457610774611c27565b90506020028101906107869190611c7a565b5f83815260056020908152604080832063ffffffff808c168552908352818420908616845290915290206107ba8282611caf565b505060010161075a565b505f818152600360209081526040909120805463ffffffff191663ffffffff88161790556107f490830183611db2565b5f8281526001602090815260409182902080546001600160a01b0319166001600160a01b03949094169390931790925561083391908401908401611dcd565b5f8281526002602052604090819020805463ffffffff191663ffffffff9390931692909217909155517f4f588da9ec57976194a79b5594f8f8782923d93013df2b9ed12fe125805011ef9061088f908890889088908890611de6565b60405180910390a1505050505050565b5f5f6108aa83610cd3565b5f9081526003602052604090205463ffffffff169392505050565b5f5f6108d083610cd3565b5f9081526002602052604090205463ffffffff169392505050565b60605f6108f784610cd3565b5f81815260046020908152604080832063ffffffff8089168552925282205492935082166001600160401b0381111561093257610932611762565b60405190808252806020026020018201604052801561097757816020015b604080518082019091525f8152606060208201528152602001906001900390816109505790505b5090505f5b8263ffffffff168163ffffffff161015610a4f575f84815260056020908152604080832063ffffffff808b16855290835281842090851684528252918290208251808401845281546001600160a01b0316815260018201805485518186028101860190965280865291949293858101939290830182828015610a1b57602002820191905f5260205f20905b815481526020019060010190808311610a07575b505050505081525050828263ffffffff1681518110610a3c57610a3c611c27565b602090810291909101015260010161097c565b5095945050505050565b60606105c98383610db9565b5f5f610a7083610cd3565b5f908152600160205260409020546001600160a01b03169392505050565b5f5f610a9a8585610db9565b90508251815114610abe5760405163512509d360e11b815260040160405180910390fd5b5f5b8151811015610b1557838181518110610adb57610adb611c27565b6020026020010151828281518110610af557610af5611c27565b60200260200101511015610b0d575f925050506105c9565b600101610ac0565b50600195945050505050565b5f5f610b2d8686610db9565b90505f610b41876101026020890189611dcd565b82519091508414610b655760405163512509d360e11b815260040160405180910390fd5b5f5b8251811015610c05575f612710878784818110610b8657610b86611c27565b9050602002016020810190610b9b9190611f19565b61ffff16848481518110610bb157610bb1611c27565b6020026020010151610bc39190611c98565b610bcd9190611f4e565b905080848381518110610be257610be2611c27565b60200260200101511015610bfc575f945050505050610637565b50600101610b67565b506001979650505050505050565b60408051808201909152600a81526922b4b3b2b72630bcb2b960b11b6020909101525f7f91ab3d17e3a50a9d89e63fd30b92be7f5336b03b287bb946787a83a9d62a27667f71b625cfad44bac63b13dba07f2e1d6084ee04b6f8752101ece6126d584ee6ea610c8061117a565b8051602091820120604051610cb8949392309101938452602084019290925260408301526001600160a01b0316606082015260800190565b60405160208183030381529060405280519060200120905090565b5f815f0151826020015163ffffffff16604051602001610d1e92919060609290921b6bffffffffffffffffffffffff1916825260a01b6001600160a01b031916601482015260200190565b60405160208183030381529060405261049790611f61565b5f610d3f610c13565b60405161190160f01b6020820152602281019190915260428101839052606201604051602081830303815290604052805190602001209050919050565b60605f610d88836111ef565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b60605f610dce6102ae368690038601866119f7565b5f8181526002602090815260409091205491925063ffffffff90911690610df790850185611dcd565b610e019190611f84565b63ffffffff16421115610e275760405163640fcd6b60e11b815260040160405180910390fd5b610e346020840184611dcd565b5f8281526003602052604090205463ffffffff908116911614610e6a57604051630cad17b760e31b815260040160405180910390fd5b5f610e7c856101026020870187611dcd565b90505f81516001600160401b03811115610e9857610e98611762565b604051908082528060200260200182016040528015610ec1578160200160208202803683370190505b5090505f610edf610ed56020880188611dcd565b87602001356105d0565b90505f80610f2d83610ef460408b018b611fa0565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061121692505050565b9150915080610f4f5760405163439cc0cd60e01b815260040160405180910390fd5b5f5b825181101561116c575f838281518110610f6d57610f6d611c27565b602002602001015190505f5f9050610fa060405180604001604052805f6001600160a01b03168152602001606081525090565b5f5b60045f8c81526020019081526020015f205f8e5f016020810190610fc69190611dcd565b63ffffffff1663ffffffff1681526020019081526020015f20548110156110cb5760055f8c81526020019081526020015f205f8e5f01602081019061100b9190611dcd565b63ffffffff908116825260208083019390935260409182015f90812091851681529083528190208151808301835281546001600160a01b03168152600182018054845181870281018701909552808552919492938584019390929083018282801561109357602002820191905f5260205f20905b81548152602001906001019080831161107f575b5050505050815250509150836001600160a01b0316825f01516001600160a01b0316036110c357600192506110cb565b600101610fa2565b50816110ea5760405163439cc0cd60e01b815260040160405180910390fd5b60208101515f5b8151811080156111015750895181105b1561115b5781818151811061111857611118611c27565b60200260200101518a828151811061113257611132611c27565b602002602001018181516111469190611c4f565b9052508061115381611c62565b9150506110f1565b505060019093019250610f51915050565b509298975050505050505050565b60605f6111a67f0000000000000000000000000000000000000000000000000000000000000000610d7c565b9050805f815181106111ba576111ba611c27565b016020908101516040516001600160f81b03199091169181019190915260210160405160208183030381529060405291505090565b5f60ff8216601f81111561049757604051632cd44ac360e21b815260040160405180910390fd5b60605f604183516112279190611fe2565b1561124557604051634be6321b60e01b815260040160405180910390fd5b5f604184516112549190611f4e565b9050806001600160401b0381111561126e5761126e611762565b604051908082528060200260200182016040528015611297578160200160208202803683370190505b5092505f5b8181101561141957604080516041808252608082019092525f916020820181803683370190505090505f5b60418110156113325786816112dd856041611c98565b6112e79190611c4f565b815181106112f7576112f7611c27565b602001015160f81c60f81b82828151811061131457611314611c27565b60200101906001600160f81b03191690815f1a9053506001016112c7565b505f5f61133f8984611427565b90925090505f81600481111561135757611357611ff5565b14158061136b57506001600160a01b038216155b1561137e57505f94506114209350505050565b5f841180156113c2575086611394600186612009565b815181106113a4576113a4611c27565b60200260200101516001600160a01b0316826001600160a01b031611155b156113d557505f94506114209350505050565b6113e2828a855f19611466565b818785815181106113f5576113f5611c27565b6001600160a01b03929092166020928302919091019091015250505060010161129c565b5060019150505b9250929050565b5f5f825160410361145b576020830151604084015160608501515f1a61144f878285856114be565b94509450505050611420565b505f90506002611420565b4281101561148757604051630819bdcd60e01b815260040160405180910390fd5b61149b6001600160a01b038516848461157b565b6114b857604051638baa579f60e01b815260040160405180910390fd5b50505050565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156114f357505f90506003611572565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611544573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b03811661156c575f60019250925050611572565b91505f90505b94509492505050565b5f5f5f6115888585611427565b90925090505f8160048111156115a0576115a0611ff5565b1480156115be5750856001600160a01b0316826001600160a01b0316145b806115cf57506115cf8686866115d9565b9695505050505050565b5f5f5f856001600160a01b0316631626ba7e60e01b868660405160240161160192919061201c565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161163f9190612034565b5f60405180830381855afa9150503d805f8114611677576040519150601f19603f3d011682016040523d82523d5f602084013e61167c565b606091505b509150915081801561169057506020815110155b80156115cf57508051630b135d3f60e11b906116b5908301602090810190840161204a565b149695505050505050565b5f604082840312156116d0575f5ffd5b50919050565b803563ffffffff811681146116e9575f5ffd5b919050565b5f5f606083850312156116ff575f5ffd5b61170984846116c0565b9150611717604084016116d6565b90509250929050565b602080825282518282018190525f918401906040840190835b81811015611757578351835260209384019390920191600101611739565b509095945050505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561179e5761179e611762565b604052919050565b6001600160a01b03811681146117ba575f5ffd5b50565b5f604082840312156117cd575f5ffd5b604080519081016001600160401b03811182821017156117ef576117ef611762565b6040529050808235611800816117a6565b815261180e602084016116d6565b60208201525092915050565b5f5f5f6080848603121561182c575f5ffd5b61183685856117bd565b9250611844604085016116d6565b9150611852606085016116d6565b90509250925092565b80516001600160a01b03168252602080820151604082850181905281519085018190525f929190910190829060608601905b80831015610a4f578351825260208201915060208401935060018301925061188d565b602081525f6105c9602083018461185b565b5f5f604083850312156118d3575f5ffd5b6118dc836116d6565b946020939093013593505050565b5f5f606083850312156118fb575f5ffd5b61170984846117bd565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f6105c96020830184611905565b5f5f83601f840112611955575f5ffd5b5081356001600160401b0381111561196b575f5ffd5b6020830191508360208260051b8501011115611420575f5ffd5b5f5f5f5f5f60c08688031215611999575f5ffd5b6119a387876116c0565b94506119b1604087016116d6565b935060608601356001600160401b038111156119cb575f5ffd5b6119d788828901611945565b90945092506119eb905087608088016116c0565b90509295509295909350565b5f60408284031215611a07575f5ffd5b6105c983836117bd565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b82811015611a6857603f19878603018452611a5385835161185b565b94506020938401939190910190600101611a37565b50929695505050505050565b5f606082840312156116d0575f5ffd5b5f5f60608385031215611a95575f5ffd5b611a9f84846116c0565b915060408301356001600160401b03811115611ab9575f5ffd5b611ac585828601611a74565b9150509250929050565b5f5f5f60808486031215611ae1575f5ffd5b611aeb85856116c0565b925060408401356001600160401b03811115611b05575f5ffd5b611b1186828701611a74565b92505060608401356001600160401b03811115611b2c575f5ffd5b8401601f81018613611b3c575f5ffd5b80356001600160401b03811115611b5557611b55611762565b8060051b611b6560208201611776565b91825260208184018101929081019089841115611b80575f5ffd5b6020850194505b83851015611ba2578435825260209485019490910190611b87565b80955050505050509250925092565b5f5f5f5f60808587031215611bc4575f5ffd5b611bce86866116c0565b935060408501356001600160401b03811115611be8575f5ffd5b611bf487828801611a74565b93505060608501356001600160401b03811115611c0f575f5ffd5b611c1b87828801611945565b95989497509550505050565b634e487b7160e01b5f52603260045260245ffd5b634e487b7160e01b5f52601160045260245ffd5b8082018082111561049757610497611c3b565b5f60018201611c7357611c73611c3b565b5060010190565b5f8235603e19833603018112611c8e575f5ffd5b9190910192915050565b808202811582820484141761049757610497611c3b565b8135611cba816117a6565b81546001600160a01b0319166001600160a01b0391909116178155602082013536839003601e19018112611cec575f5ffd5b820180356001600160401b03811115611d03575f5ffd5b6020820191508060051b3603821315611d1a575f5ffd5b600183016001600160401b03821115611d3557611d35611762565b68010000000000000000821115611d4e57611d4e611762565b805482825580831015611d83575f828152602090208381019082015b80821015611d80575f8255600182019150611d6a565b50505b505f90815260208120905b82811015611daa57833582820155602090930192600101611d8e565b505050505050565b5f60208284031215611dc2575f5ffd5b81356105c9816117a6565b5f60208284031215611ddd575f5ffd5b6105c9826116d6565b5f608082018635611df6816117a6565b6001600160a01b0316835263ffffffff611e12602089016116d6565b16602084015263ffffffff861660408401526080606084015283905260a0600584901b83018101908301855f603e1936839003015b87821015611f0a57868503609f190184528235818112611e65575f5ffd5b89018035611e72816117a6565b6001600160a01b03168652602081013536829003601e19018112611e94575f5ffd5b016020810190356001600160401b03811115611eae575f5ffd5b8060051b803603831315611ec0575f5ffd5b60406020890181905288018290526001600160fb1b03821115611ee1575f5ffd5b808360608a01376060818901019750505050602083019250602084019350600182019150611e47565b50929998505050505050505050565b5f60208284031215611f29575f5ffd5b813561ffff811681146105c9575f5ffd5b634e487b7160e01b5f52601260045260245ffd5b5f82611f5c57611f5c611f3a565b500490565b805160208083015191908110156116d0575f1960209190910360031b1b16919050565b63ffffffff818116838216019081111561049757610497611c3b565b5f5f8335601e19843603018112611fb5575f5ffd5b8301803591506001600160401b03821115611fce575f5ffd5b602001915036819003821315611420575f5ffd5b5f82611ff057611ff0611f3a565b500690565b634e487b7160e01b5f52602160045260245ffd5b8181038181111561049757610497611c3b565b828152604060208201525f6106376040830184611905565b5f82518060208501845e5f920191825250919050565b5f6020828403121561205a575f5ffd5b505191905056fea26469706673582212201e0114f053a23f1bf71bb51482be17a4dc12059eba0d64f50e908ccc5d64950c64736f6c634300081b0033", } // ECDSACertificateVerifierABI is the input ABI used to generate the binding from. diff --git a/pkg/bindings/ECDSACertificateVerifierStorage/binding.go b/pkg/bindings/ECDSACertificateVerifierStorage/binding.go index be151953a0..3db963a47d 100644 --- a/pkg/bindings/ECDSACertificateVerifierStorage/binding.go +++ b/pkg/bindings/ECDSACertificateVerifierStorage/binding.go @@ -56,7 +56,7 @@ type OperatorSet struct { // ECDSACertificateVerifierStorageMetaData contains all meta data concerning the ECDSACertificateVerifierStorage contract. var ECDSACertificateVerifierStorageMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"getOperatorCount\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfo\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfos\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetOwner\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalStakes\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestReferenceTimestamp\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxOperatorTableStaleness\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorTableUpdater\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOperatorTableUpdater\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateOperatorTable\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"operatorSetConfig\",\"type\":\"tuple\",\"internalType\":\"structICrossChainRegistryTypes.OperatorSetConfig\",\"components\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificate\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"signedStakes\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateNominal\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeNominalThresholds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateProportion\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeProportionThresholds\",\"type\":\"uint16[]\",\"internalType\":\"uint16[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"MaxStalenessPeriodUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetOwnerUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TableUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CertificateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyTableUpdater\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReferenceTimestampDoesNotExist\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TableUpdateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VerificationFailed\",\"inputs\":[]}]", + ABI: "[{\"type\":\"function\",\"name\":\"calculateCertificateDigest\",\"inputs\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorCount\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfo\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfos\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetOwner\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalStakes\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestReferenceTimestamp\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxOperatorTableStaleness\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"operatorTableUpdater\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOperatorTableUpdater\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateOperatorTable\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"operatorSetConfig\",\"type\":\"tuple\",\"internalType\":\"structICrossChainRegistryTypes.OperatorSetConfig\",\"components\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificate\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"signedStakes\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateNominal\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeNominalThresholds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateProportion\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeProportionThresholds\",\"type\":\"uint16[]\",\"internalType\":\"uint16[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"MaxStalenessPeriodUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetOwnerUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TableUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CertificateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyTableUpdater\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReferenceTimestampDoesNotExist\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TableUpdateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VerificationFailed\",\"inputs\":[]}]", } // ECDSACertificateVerifierStorageABI is the input ABI used to generate the binding from. @@ -205,6 +205,68 @@ func (_ECDSACertificateVerifierStorage *ECDSACertificateVerifierStorageTransacto return _ECDSACertificateVerifierStorage.Contract.contract.Transact(opts, method, params...) } +// CalculateCertificateDigest is a free data retrieval call binding the contract method 0x18467434. +// +// Solidity: function calculateCertificateDigest(uint32 referenceTimestamp, bytes32 messageHash) view returns(bytes32) +func (_ECDSACertificateVerifierStorage *ECDSACertificateVerifierStorageCaller) CalculateCertificateDigest(opts *bind.CallOpts, referenceTimestamp uint32, messageHash [32]byte) ([32]byte, error) { + var out []interface{} + err := _ECDSACertificateVerifierStorage.contract.Call(opts, &out, "calculateCertificateDigest", referenceTimestamp, messageHash) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateCertificateDigest is a free data retrieval call binding the contract method 0x18467434. +// +// Solidity: function calculateCertificateDigest(uint32 referenceTimestamp, bytes32 messageHash) view returns(bytes32) +func (_ECDSACertificateVerifierStorage *ECDSACertificateVerifierStorageSession) CalculateCertificateDigest(referenceTimestamp uint32, messageHash [32]byte) ([32]byte, error) { + return _ECDSACertificateVerifierStorage.Contract.CalculateCertificateDigest(&_ECDSACertificateVerifierStorage.CallOpts, referenceTimestamp, messageHash) +} + +// CalculateCertificateDigest is a free data retrieval call binding the contract method 0x18467434. +// +// Solidity: function calculateCertificateDigest(uint32 referenceTimestamp, bytes32 messageHash) view returns(bytes32) +func (_ECDSACertificateVerifierStorage *ECDSACertificateVerifierStorageCallerSession) CalculateCertificateDigest(referenceTimestamp uint32, messageHash [32]byte) ([32]byte, error) { + return _ECDSACertificateVerifierStorage.Contract.CalculateCertificateDigest(&_ECDSACertificateVerifierStorage.CallOpts, referenceTimestamp, messageHash) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_ECDSACertificateVerifierStorage *ECDSACertificateVerifierStorageCaller) DomainSeparator(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _ECDSACertificateVerifierStorage.contract.Call(opts, &out, "domainSeparator") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_ECDSACertificateVerifierStorage *ECDSACertificateVerifierStorageSession) DomainSeparator() ([32]byte, error) { + return _ECDSACertificateVerifierStorage.Contract.DomainSeparator(&_ECDSACertificateVerifierStorage.CallOpts) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_ECDSACertificateVerifierStorage *ECDSACertificateVerifierStorageCallerSession) DomainSeparator() ([32]byte, error) { + return _ECDSACertificateVerifierStorage.Contract.DomainSeparator(&_ECDSACertificateVerifierStorage.CallOpts) +} + // GetOperatorCount is a free data retrieval call binding the contract method 0x23c2a3cb. // // Solidity: function getOperatorCount((address,uint32) operatorSet, uint32 referenceTimestamp) view returns(uint32) diff --git a/pkg/bindings/IECDSACertificateVerifier/binding.go b/pkg/bindings/IECDSACertificateVerifier/binding.go index 89be00b4fc..da369e1736 100644 --- a/pkg/bindings/IECDSACertificateVerifier/binding.go +++ b/pkg/bindings/IECDSACertificateVerifier/binding.go @@ -56,7 +56,7 @@ type OperatorSet struct { // IECDSACertificateVerifierMetaData contains all meta data concerning the IECDSACertificateVerifier contract. var IECDSACertificateVerifierMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"function\",\"name\":\"getOperatorCount\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfo\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfos\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetOwner\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalStakes\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestReferenceTimestamp\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxOperatorTableStaleness\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateOperatorTable\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"operatorSetConfig\",\"type\":\"tuple\",\"internalType\":\"structICrossChainRegistryTypes.OperatorSetConfig\",\"components\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificate\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"signedStakes\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateNominal\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeNominalThresholds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateProportion\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeProportionThresholds\",\"type\":\"uint16[]\",\"internalType\":\"uint16[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"MaxStalenessPeriodUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetOwnerUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TableUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CertificateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyTableUpdater\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReferenceTimestampDoesNotExist\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TableUpdateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VerificationFailed\",\"inputs\":[]}]", + ABI: "[{\"type\":\"function\",\"name\":\"calculateCertificateDigest\",\"inputs\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"domainSeparator\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorCount\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfo\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorInfos\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getOperatorSetOwner\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getTotalStakes\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"latestReferenceTimestamp\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"maxOperatorTableStaleness\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateOperatorTable\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"operatorSetConfig\",\"type\":\"tuple\",\"internalType\":\"structICrossChainRegistryTypes.OperatorSetConfig\",\"components\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificate\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"signedStakes\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateNominal\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeNominalThresholds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyCertificateProportion\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"cert\",\"type\":\"tuple\",\"internalType\":\"structIECDSACertificateVerifierTypes.ECDSACertificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"sig\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"totalStakeProportionThresholds\",\"type\":\"uint16[]\",\"internalType\":\"uint16[]\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"MaxStalenessPeriodUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OperatorSetOwnerUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TableUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"indexed\":false,\"internalType\":\"uint32\"},{\"name\":\"operatorInfos\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structIECDSATableCalculatorTypes.ECDSAOperatorInfo[]\",\"components\":[{\"name\":\"pubkey\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"ArrayLengthMismatch\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CertificateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OnlyTableUpdater\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"ReferenceTimestampDoesNotExist\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TableUpdateStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"VerificationFailed\",\"inputs\":[]}]", } // IECDSACertificateVerifierABI is the input ABI used to generate the binding from. @@ -205,6 +205,68 @@ func (_IECDSACertificateVerifier *IECDSACertificateVerifierTransactorRaw) Transa return _IECDSACertificateVerifier.Contract.contract.Transact(opts, method, params...) } +// CalculateCertificateDigest is a free data retrieval call binding the contract method 0x18467434. +// +// Solidity: function calculateCertificateDigest(uint32 referenceTimestamp, bytes32 messageHash) view returns(bytes32) +func (_IECDSACertificateVerifier *IECDSACertificateVerifierCaller) CalculateCertificateDigest(opts *bind.CallOpts, referenceTimestamp uint32, messageHash [32]byte) ([32]byte, error) { + var out []interface{} + err := _IECDSACertificateVerifier.contract.Call(opts, &out, "calculateCertificateDigest", referenceTimestamp, messageHash) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CalculateCertificateDigest is a free data retrieval call binding the contract method 0x18467434. +// +// Solidity: function calculateCertificateDigest(uint32 referenceTimestamp, bytes32 messageHash) view returns(bytes32) +func (_IECDSACertificateVerifier *IECDSACertificateVerifierSession) CalculateCertificateDigest(referenceTimestamp uint32, messageHash [32]byte) ([32]byte, error) { + return _IECDSACertificateVerifier.Contract.CalculateCertificateDigest(&_IECDSACertificateVerifier.CallOpts, referenceTimestamp, messageHash) +} + +// CalculateCertificateDigest is a free data retrieval call binding the contract method 0x18467434. +// +// Solidity: function calculateCertificateDigest(uint32 referenceTimestamp, bytes32 messageHash) view returns(bytes32) +func (_IECDSACertificateVerifier *IECDSACertificateVerifierCallerSession) CalculateCertificateDigest(referenceTimestamp uint32, messageHash [32]byte) ([32]byte, error) { + return _IECDSACertificateVerifier.Contract.CalculateCertificateDigest(&_IECDSACertificateVerifier.CallOpts, referenceTimestamp, messageHash) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_IECDSACertificateVerifier *IECDSACertificateVerifierCaller) DomainSeparator(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _IECDSACertificateVerifier.contract.Call(opts, &out, "domainSeparator") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_IECDSACertificateVerifier *IECDSACertificateVerifierSession) DomainSeparator() ([32]byte, error) { + return _IECDSACertificateVerifier.Contract.DomainSeparator(&_IECDSACertificateVerifier.CallOpts) +} + +// DomainSeparator is a free data retrieval call binding the contract method 0xf698da25. +// +// Solidity: function domainSeparator() view returns(bytes32) +func (_IECDSACertificateVerifier *IECDSACertificateVerifierCallerSession) DomainSeparator() ([32]byte, error) { + return _IECDSACertificateVerifier.Contract.DomainSeparator(&_IECDSACertificateVerifier.CallOpts) +} + // GetOperatorCount is a free data retrieval call binding the contract method 0x23c2a3cb. // // Solidity: function getOperatorCount((address,uint32) operatorSet, uint32 referenceTimestamp) view returns(uint32) diff --git a/pkg/bindings/OperatorTableUpdater/binding.go b/pkg/bindings/OperatorTableUpdater/binding.go index 86879c632f..64c606296f 100644 --- a/pkg/bindings/OperatorTableUpdater/binding.go +++ b/pkg/bindings/OperatorTableUpdater/binding.go @@ -86,7 +86,7 @@ type OperatorSet struct { // OperatorTableUpdaterMetaData contains all meta data concerning the OperatorTableUpdater contract. var OperatorTableUpdaterMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_bn254CertificateVerifier\",\"type\":\"address\",\"internalType\":\"contractIBN254CertificateVerifier\"},{\"name\":\"_ecdsaCertificateVerifier\",\"type\":\"address\",\"internalType\":\"contractIECDSACertificateVerifier\"},{\"name\":\"_version\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"GLOBAL_TABLE_ROOT_CERT_TYPEHASH\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"MAX_BPS\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"bn254CertificateVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIBN254CertificateVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"confirmGlobalTableRoot\",\"inputs\":[{\"name\":\"globalTableRootCert\",\"type\":\"tuple\",\"internalType\":\"structIBN254CertificateVerifierTypes.BN254Certificate\",\"components\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"signature\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"apk\",\"type\":\"tuple\",\"internalType\":\"structBN254.G2Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"},{\"name\":\"Y\",\"type\":\"uint256[2]\",\"internalType\":\"uint256[2]\"}]},{\"name\":\"nonSignerWitnesses\",\"type\":\"tuple[]\",\"internalType\":\"structIBN254CertificateVerifierTypes.BN254OperatorInfoWitness[]\",\"components\":[{\"name\":\"operatorIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"operatorInfoProof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operatorInfo\",\"type\":\"tuple\",\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorInfo\",\"components\":[{\"name\":\"pubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"weights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]}]}]},{\"name\":\"globalTableRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"referenceBlockNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ecdsaCertificateVerifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIECDSACertificateVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCertificateVerifier\",\"inputs\":[{\"name\":\"curveType\",\"type\":\"uint8\",\"internalType\":\"enumIKeyRegistrarTypes.CurveType\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getCurrentGlobalTableRoot\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getGlobalConfirmerSetReferenceTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getGlobalRootConfirmerSet\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getGlobalTableRootByTimestamp\",\"inputs\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getGlobalTableUpdateMessageHash\",\"inputs\":[{\"name\":\"globalTableRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"referenceBlockNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getLatestReferenceBlockNumber\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestReferenceTimestamp\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getReferenceBlockNumberByTimestamp\",\"inputs\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getReferenceTimestampByBlockNumber\",\"inputs\":[{\"name\":\"referenceBlockNumber\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"globalRootConfirmationThreshold\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_globalRootConfirmerSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"_globalRootConfirmationThreshold\",\"type\":\"uint16\",\"internalType\":\"uint16\"},{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"globalRootConfirmerSetInfo\",\"type\":\"tuple\",\"internalType\":\"structIBN254TableCalculatorTypes.BN254OperatorSetInfo\",\"components\":[{\"name\":\"operatorInfoTreeRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"numOperators\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"aggregatePubkey\",\"type\":\"tuple\",\"internalType\":\"structBN254.G1Point\",\"components\":[{\"name\":\"X\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"Y\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"totalWeights\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}]},{\"name\":\"globalRootConfirmerSetConfig\",\"type\":\"tuple\",\"internalType\":\"structICrossChainRegistryTypes.OperatorSetConfig\",\"components\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"maxStalenessPeriod\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGlobalRootConfirmationThreshold\",\"inputs\":[{\"name\":\"bps\",\"type\":\"uint16\",\"internalType\":\"uint16\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setGlobalRootConfirmerSet\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"updateOperatorTable\",\"inputs\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"globalTableRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"operatorSetIndex\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"operatorTableBytes\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"version\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"event\",\"name\":\"GlobalRootConfirmationThresholdUpdated\",\"inputs\":[{\"name\":\"bps\",\"type\":\"uint16\",\"indexed\":false,\"internalType\":\"uint16\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"GlobalRootConfirmerSetUpdated\",\"inputs\":[{\"name\":\"operatorSet\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structOperatorSet\",\"components\":[{\"name\":\"avs\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"id\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"NewGlobalTableRoot\",\"inputs\":[{\"name\":\"referenceTimestamp\",\"type\":\"uint32\",\"indexed\":true,\"internalType\":\"uint32\"},{\"name\":\"globalTableRoot\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"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\":\"error\",\"name\":\"CertificateInvalid\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"GlobalTableRootInFuture\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"GlobalTableRootStale\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidConfirmationThreshold\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCurveType\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidGlobalTableRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidMessageHash\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidOperatorSetProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidProofLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidShortString\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSignatureLength\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"StringTooLong\",\"inputs\":[{\"name\":\"str\",\"type\":\"string\",\"internalType\":\"string\"}]},{\"type\":\"error\",\"name\":\"TableUpdateForPastTimestamp\",\"inputs\":[]}]", - Bin: "0x60e060405234801561000f575f5ffd5b506040516120af3803806120af83398101604081905261002e91610188565b6001600160a01b03808416608052821660a0528061004b8161005f565b60c052506100576100a5565b5050506102b9565b5f5f829050601f81511115610092578260405163305a27a960e01b8152600401610089919061025e565b60405180910390fd5b805161009d82610293565b179392505050565b5f54610100900460ff161561010c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401610089565b5f5460ff9081161461015b575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b0381168114610171575f5ffd5b50565b634e487b7160e01b5f52604160045260245ffd5b5f5f5f6060848603121561019a575f5ffd5b83516101a58161015d565b60208501519093506101b68161015d565b60408501519092506001600160401b038111156101d1575f5ffd5b8401601f810186136101e1575f5ffd5b80516001600160401b038111156101fa576101fa610174565b604051601f8201601f19908116603f011681016001600160401b038111828210171561022857610228610174565b60405281815282820160200188101561023f575f5ffd5b8160208401602083015e5f602083830101528093505050509250925092565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b805160208083015191908110156102b3575f198160200360031b1b821691505b50919050565b60805160a05160c051611d9b6103145f395f61069d01525f81816103490152818161071e015261090c01525f81816103700152818161050c0152818161060b015281816106de015281816108670152610ac60152611d9b5ff3fe608060405234801561000f575f5ffd5b5060043610610153575f3560e01c80636f728c50116100bf578063c252aa2211610079578063c252aa2214610392578063c3be1e33146103b3578063c5916a39146103c6578063eaaed9d5146103eb578063f2fde38b146103fe578063fd967f4714610411575f5ffd5b80636f728c50146102ed578063715018a6146103185780638da5cb5b146103205780639ea9477814610331578063ad0f958214610344578063b8c143061461036b575f5ffd5b806328522d791161011057806328522d791461020457806331a599d2146102305780633ef6cd7a146102555780634624e6a31461027c578063462828891461029057806354fd4d50146102d8575f5ffd5b8063021ab442146101575780630371406e1461016c5780630f3f8edd1461017f578063193b79f3146101a15780632370356c146101c957806323b7b5b2146101dc575b5f5ffd5b61016a610165366004611085565b61041a565b005b61016a61017a366004611119565b6105de565b6101876105f2565b60405163ffffffff90911681526020015b60405180910390f35b6101876101af36600461113a565b63ffffffff9081165f908152606960205260409020541690565b61016a6101d7366004611155565b610685565b6101876101ea36600461113a565b63ffffffff9081165f908152606860205260409020541690565b60655462010000900463ffffffff165f908152606760205260409020545b604051908152602001610198565b60655462010000900463ffffffff9081165f9081526068602052604090205416610187565b6102227fdbbb55ba0f5fdd66c1f17f44359cb4c67628f9dca440a4c104e61189ad4424b981565b60655462010000900463ffffffff16610187565b6040805180820182525f80825260209182015281518083019092526066546001600160a01b0381168352600160a01b900463ffffffff1690820152604051610198919061118c565b6102e0610696565b604051610198919061119a565b6103006102fb3660046111dd565b6106c1565b6040516001600160a01b039091168152602001610198565b61016a610760565b6033546001600160a01b0316610300565b61016a61033f36600461123a565b610773565b6103007f000000000000000000000000000000000000000000000000000000000000000081565b6103007f000000000000000000000000000000000000000000000000000000000000000081565b6065546103a09061ffff1681565b60405161ffff9091168152602001610198565b6102226103c13660046112d5565b610971565b6102226103d436600461113a565b63ffffffff165f9081526067602052604090205490565b61016a6103f9366004611314565b6109d9565b61016a61040c366004611380565b610bf6565b6103a061271081565b5f54610100900460ff161580801561043857505f54600160ff909116105b806104515750303b15801561045157505f5460ff166001145b6104b95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b5f805460ff1916600117905580156104da575f805461ff0019166101001790555b6104e387610c68565b6104ec86610cb9565b6104f585610d03565b604051636738c40b60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636738c40b90610547908990889088908890600401611444565b5f604051808303815f87803b15801561055e575f5ffd5b505af1158015610570573d5f5f3e3d5ffd5b50506065805465ffffffff000019166201000063ffffffff891602179055505080156105d5575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6105e6610d6e565b6105ef81610cb9565b50565b604051635ddb9b5b60e01b81525f906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635ddb9b5b90610641906066906004016114cd565b602060405180830381865afa15801561065c573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061068091906114f4565b905090565b61068d610d6e565b6105ef81610d03565b60606106807f0000000000000000000000000000000000000000000000000000000000000000610dc8565b5f60028260028111156106d6576106d661150f565b0361070257507f0000000000000000000000000000000000000000000000000000000000000000919050565b60018260028111156107165761071661150f565b0361074257507f0000000000000000000000000000000000000000000000000000000000000000919050565b60405163fdea7c0960e01b815260040160405180910390fd5b919050565b610768610d6e565b6107715f610c68565b565b5f5f5f5f6107818686610e05565b9350935093509350610792836106c1565b6001600160a01b0316635ddb9b5b856040518263ffffffff1660e01b81526004016107bd919061118c565b602060405180830381865afa1580156107d8573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107fc91906114f4565b63ffffffff168b63ffffffff16116108275760405163207617df60e01b815260040160405180910390fd5b61084c8b8b8b8b8b8b8b60405161083f929190611523565b6040518091039020610e4c565b60028360028111156108605761086061150f565b036108f1577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636738c40b858d61089f85610eed565b866040518563ffffffff1660e01b81526004016108bf949392919061156c565b5f604051808303815f87803b1580156108d6575f5ffd5b505af11580156108e8573d5f5f3e3d5ffd5b50505050610964565b60018360028111156109055761090561150f565b03610742577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166356d482f5858d61094485610f0f565b866040518563ffffffff1660e01b81526004016108bf94939291906115df565b5050505050505050505050565b604080517fdbbb55ba0f5fdd66c1f17f44359cb4c67628f9dca440a4c104e61189ad4424b9602082015290810184905263ffffffff8084166060830152821660808201525f9060a0016040516020818303038152906040528051906020012090509392505050565b428263ffffffff161115610a0057604051635a119db560e11b815260040160405180910390fd5b60655463ffffffff62010000909104811690831611610a325760405163037fa86b60e31b815260040160405180910390fd5b610a3d838383610971565b846020013514610a6057604051638b56642d60e01b815260040160405180910390fd5b6040805160018082528183019092525f91602080830190803683375050606554825192935061ffff16918391505f90610a9b57610a9b611698565b61ffff90921660209283029190910190910152604051625f5e5d60e21b81525f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063017d797490610b00906066908a908790600401611756565b6020604051808303815f875af1158015610b1c573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b4091906118e3565b905080610b6057604051633042041f60e21b815260040160405180910390fd5b6065805463ffffffff80871662010000810265ffffffff000019909316929092179092555f818152606860209081526040808320805495891663ffffffff1996871681179091558352606982528083208054909516841790945582825260679052828120889055915187927f010dcbe0d1e019c93357711f7bb6287d543b7ff7de74f29df3fb5ecceec8d36991a3505050505050565b610bfe610d6e565b6001600160a01b038116610c635760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104b0565b6105ef815b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b806066610cc68282611902565b9050507f20100394950e66014c25009b45d12b675210a6e7a002044a0e3de6544e3c4b3781604051610cf8919061195e565b60405180910390a150565b61271061ffff82161115610d2a576040516307336f0360e11b815260040160405180910390fd5b6065805461ffff191661ffff83169081179091556040519081527ff5d1836df8fcd7c1e54047e94ac8773d2855395603e2ef9ba5f5f16905f2259290602001610cf8565b6033546001600160a01b031633146107715760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104b0565b60605f610dd483610f25565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b604080518082019091525f8082526020820152604080518082019091525f80825260208201819052906060610e3c85870187611a26565b9299919850965090945092505050565b63ffffffff86165f908152606760205260409020548514610e805760405163639d09b560e11b815260040160405180910390fd5b610ec883838080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152508992508591505063ffffffff8816610f4c565b610ee55760405163afa42ca760e01b815260040160405180910390fd5b505050505050565b610ef5610ffa565b81806020019051810190610f099190611b77565b92915050565b606081806020019051810190610f099190611c26565b5f60ff8216601f811115610f0957604051632cd44ac360e21b815260040160405180910390fd5b5f83610f59868585610f63565b1495945050505050565b5f60208451610f729190611d27565b15610f90576040516313717da960e21b815260040160405180910390fd5b8260205b85518111610ff157610fa7600285611d27565b5f03610fc857815f528086015160205260405f209150600284049350610fdf565b808601515f528160205260405f2091506002840493505b610fea602082611d46565b9050610f94565b50949350505050565b60405180608001604052805f81526020015f815260200161102c60405180604001604052805f81526020015f81525090565b8152602001606081525090565b6001600160a01b03811681146105ef575f5ffd5b5f6040828403121561105d575f5ffd5b50919050565b803561ffff8116811461075b575f5ffd5b63ffffffff811681146105ef575f5ffd5b5f5f5f5f5f5f610100878903121561109b575f5ffd5b86356110a681611039565b95506110b5886020890161104d565b94506110c360608801611063565b935060808701356110d381611074565b925060a08701356001600160401b038111156110ed575f5ffd5b870160a0818a0312156110fe575f5ffd5b915061110d8860c0890161104d565b90509295509295509295565b5f60408284031215611129575f5ffd5b611133838361104d565b9392505050565b5f6020828403121561114a575f5ffd5b813561113381611074565b5f60208284031215611165575f5ffd5b61113382611063565b80516001600160a01b0316825260209081015163ffffffff16910152565b60408101610f09828461116e565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356003811061075b575f5ffd5b5f602082840312156111ed575f5ffd5b611133826111cf565b5f5f83601f840112611206575f5ffd5b5081356001600160401b0381111561121c575f5ffd5b602083019150836020828501011115611233575f5ffd5b9250929050565b5f5f5f5f5f5f5f60a0888a031215611250575f5ffd5b873561125b81611074565b965060208801359550604088013561127281611074565b945060608801356001600160401b0381111561128c575f5ffd5b6112988a828b016111f6565b90955093505060808801356001600160401b038111156112b6575f5ffd5b6112c28a828b016111f6565b989b979a50959850939692959293505050565b5f5f5f606084860312156112e7575f5ffd5b8335925060208401356112f981611074565b9150604084013561130981611074565b809150509250925092565b5f5f5f5f60808587031215611327575f5ffd5b84356001600160401b0381111561133c575f5ffd5b8501610120818803121561134e575f5ffd5b935060208501359250604085013561136581611074565b9150606085013561137581611074565b939692955090935050565b5f60208284031215611390575f5ffd5b813561113381611039565b80356113a681611039565b6001600160a01b0316825260208101356113bf81611074565b63ffffffff81166020840152505050565b5f5f8335601e198436030181126113e5575f5ffd5b83016020810192503590506001600160401b03811115611403575f5ffd5b8060051b3603821315611233575f5ffd5b8183525f6001600160fb1b0383111561142b575f5ffd5b8260051b80836020870137939093016020019392505050565b61144e818661139b565b63ffffffff841660408281019190915260c06060808401829052853591840191909152602085013560e0840152908401356101008301528301356101208201525f61149c60808501856113d0565b60a06101408501526114b361016085018284611414565b925050506114c4608083018461139b565b95945050505050565b60408101610f098284546001600160a01b038116825260a01c63ffffffff16602090910152565b5f60208284031215611504575f5ffd5b815161113381611074565b634e487b7160e01b5f52602160045260245ffd5b818382375f9101908152919050565b5f8151808452602084019350602083015f5b82811015611562578151865260209586019590910190600101611544565b5093949350505050565b611576818661116e565b63ffffffff8416604082015260c06060820152825160c0820152602083015160e08201525f60408401518051610100840152602081015161012084015250606084015160a06101408401526115cf610160840182611532565b9150506114c4608083018461116e565b5f60c082016115ee838861116e565b63ffffffff8616604084015260c0606084015280855180835260e08501915060e08160051b8601019250602087015f5b8281101561166f5786850360df19018452815180516001600160a01b0316865260209081015160409187018290529061165990870182611532565b955050602093840193919091019060010161161e565b50505050809150506114c4608083018461116e565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b5f8235605e198336030181126116e8575f5ffd5b90910192915050565b80358252602080820135908301525f61170d60408301836113d0565b606060408601526114c4606086018284611414565b5f8151808452602084019350602083015f5b8281101561156257815161ffff16865260209586019590910190600101611734565b6117798185546001600160a01b038116825260a01c63ffffffff16602090910152565b608060408201525f6101a08201843561179181611074565b63ffffffff166080840152602085013560a0840152604085013560c0840152606085013560e0840152604060808601610100850137604060c086016101408501376117e06101008601866113d0565b610120610180860152828184526101c0860190506101c08260051b8701019350825f5b838110156118c2578786036101bf1901835261181f82866116d4565b803561182a81611074565b63ffffffff168752602081013536829003601e19018112611849575f5ffd5b81016020810190356001600160401b03811115611864575f5ffd5b803603821315611872575f5ffd5b606060208a015261188760608a0182846116ac565b91505061189760408301836116d4565b915087810360408901526118ab81836116f1565b975050506020928301929190910190600101611803565b505050505082810360608401526118d98185611722565b9695505050505050565b5f602082840312156118f3575f5ffd5b81518015158114611133575f5ffd5b813561190d81611039565b81546001600160a01b031981166001600160a01b03929092169182178355602084013561193981611074565b6001600160c01b03199190911690911760a09190911b63ffffffff60a01b1617905550565b60408101610f09828461139b565b604080519081016001600160401b038111828210171561198e5761198e611684565b60405290565b604051608081016001600160401b038111828210171561198e5761198e611684565b604051601f8201601f191681016001600160401b03811182821017156119de576119de611684565b604052919050565b5f604082840312156119f6575f5ffd5b6119fe61196c565b90508135611a0b81611039565b81526020820135611a1b81611074565b602082015292915050565b5f5f5f5f60c08587031215611a39575f5ffd5b611a4386866119e6565b9350611a51604086016111cf565b9250611a6086606087016119e6565b915060a08501356001600160401b03811115611a7a575f5ffd5b8501601f81018713611a8a575f5ffd5b80356001600160401b03811115611aa357611aa3611684565b611ab6601f8201601f19166020016119b6565b818152886020838501011115611aca575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b5f6001600160401b03821115611b0357611b03611684565b5060051b60200190565b5f82601f830112611b1c575f5ffd5b8151611b2f611b2a82611aeb565b6119b6565b8082825260208201915060208360051b860101925085831115611b50575f5ffd5b602085015b83811015611b6d578051835260209283019201611b55565b5095945050505050565b5f60208284031215611b87575f5ffd5b81516001600160401b03811115611b9c575f5ffd5b820180840360a0811215611bae575f5ffd5b611bb6611994565b82518152602080840151908201526040603f1983011215611bd5575f5ffd5b611bdd61196c565b604084810151825260608501516020830152820152608083015191506001600160401b03821115611c0c575f5ffd5b611c1886838501611b0d565b606082015295945050505050565b5f60208284031215611c36575f5ffd5b81516001600160401b03811115611c4b575f5ffd5b8201601f81018413611c5b575f5ffd5b8051611c69611b2a82611aeb565b8082825260208201915060208360051b850101925086831115611c8a575f5ffd5b602084015b83811015611d1c5780516001600160401b03811115611cac575f5ffd5b85016040818a03601f19011215611cc1575f5ffd5b611cc961196c565b6020820151611cd781611039565b815260408201516001600160401b03811115611cf1575f5ffd5b611d008b602083860101611b0d565b6020830152508085525050602083019250602081019050611c8f565b509695505050505050565b5f82611d4157634e487b7160e01b5f52601260045260245ffd5b500690565b80820180821115610f0957634e487b7160e01b5f52601160045260245ffdfea26469706673582212209ef8b0f0c9ea1483bf6298537a98d0d43a7142e8f94e3142b0017168a9ac5f0264736f6c634300081b0033", + Bin: "0x60e060405234801561000f575f5ffd5b506040516120af3803806120af83398101604081905261002e91610188565b6001600160a01b03808416608052821660a0528061004b8161005f565b60c052506100576100a5565b5050506102b9565b5f5f829050601f81511115610092578260405163305a27a960e01b8152600401610089919061025e565b60405180910390fd5b805161009d82610293565b179392505050565b5f54610100900460ff161561010c5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b6064820152608401610089565b5f5460ff9081161461015b575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6001600160a01b0381168114610171575f5ffd5b50565b634e487b7160e01b5f52604160045260245ffd5b5f5f5f6060848603121561019a575f5ffd5b83516101a58161015d565b60208501519093506101b68161015d565b60408501519092506001600160401b038111156101d1575f5ffd5b8401601f810186136101e1575f5ffd5b80516001600160401b038111156101fa576101fa610174565b604051601f8201601f19908116603f011681016001600160401b038111828210171561022857610228610174565b60405281815282820160200188101561023f575f5ffd5b8160208401602083015e5f602083830101528093505050509250925092565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b805160208083015191908110156102b3575f198160200360031b1b821691505b50919050565b60805160a05160c051611d9b6103145f395f61069d01525f81816103490152818161071e015261090c01525f81816103700152818161050c0152818161060b015281816106de015281816108670152610ac60152611d9b5ff3fe608060405234801561000f575f5ffd5b5060043610610153575f3560e01c80636f728c50116100bf578063c252aa2211610079578063c252aa2214610392578063c3be1e33146103b3578063c5916a39146103c6578063eaaed9d5146103eb578063f2fde38b146103fe578063fd967f4714610411575f5ffd5b80636f728c50146102ed578063715018a6146103185780638da5cb5b146103205780639ea9477814610331578063ad0f958214610344578063b8c143061461036b575f5ffd5b806328522d791161011057806328522d791461020457806331a599d2146102305780633ef6cd7a146102555780634624e6a31461027c578063462828891461029057806354fd4d50146102d8575f5ffd5b8063021ab442146101575780630371406e1461016c5780630f3f8edd1461017f578063193b79f3146101a15780632370356c146101c957806323b7b5b2146101dc575b5f5ffd5b61016a610165366004611085565b61041a565b005b61016a61017a366004611119565b6105de565b6101876105f2565b60405163ffffffff90911681526020015b60405180910390f35b6101876101af36600461113a565b63ffffffff9081165f908152606960205260409020541690565b61016a6101d7366004611155565b610685565b6101876101ea36600461113a565b63ffffffff9081165f908152606860205260409020541690565b60655462010000900463ffffffff165f908152606760205260409020545b604051908152602001610198565b60655462010000900463ffffffff9081165f9081526068602052604090205416610187565b6102227fdbbb55ba0f5fdd66c1f17f44359cb4c67628f9dca440a4c104e61189ad4424b981565b60655462010000900463ffffffff16610187565b6040805180820182525f80825260209182015281518083019092526066546001600160a01b0381168352600160a01b900463ffffffff1690820152604051610198919061118c565b6102e0610696565b604051610198919061119a565b6103006102fb3660046111dd565b6106c1565b6040516001600160a01b039091168152602001610198565b61016a610760565b6033546001600160a01b0316610300565b61016a61033f36600461123a565b610773565b6103007f000000000000000000000000000000000000000000000000000000000000000081565b6103007f000000000000000000000000000000000000000000000000000000000000000081565b6065546103a09061ffff1681565b60405161ffff9091168152602001610198565b6102226103c13660046112d5565b610971565b6102226103d436600461113a565b63ffffffff165f9081526067602052604090205490565b61016a6103f9366004611314565b6109d9565b61016a61040c366004611380565b610bf6565b6103a061271081565b5f54610100900460ff161580801561043857505f54600160ff909116105b806104515750303b15801561045157505f5460ff166001145b6104b95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b5f805460ff1916600117905580156104da575f805461ff0019166101001790555b6104e387610c68565b6104ec86610cb9565b6104f585610d03565b604051636738c40b60e01b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690636738c40b90610547908990889088908890600401611444565b5f604051808303815f87803b15801561055e575f5ffd5b505af1158015610570573d5f5f3e3d5ffd5b50506065805465ffffffff000019166201000063ffffffff891602179055505080156105d5575f805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050505050565b6105e6610d6e565b6105ef81610cb9565b50565b604051635ddb9b5b60e01b81525f906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635ddb9b5b90610641906066906004016114cd565b602060405180830381865afa15801561065c573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061068091906114f4565b905090565b61068d610d6e565b6105ef81610d03565b60606106807f0000000000000000000000000000000000000000000000000000000000000000610dc8565b5f60028260028111156106d6576106d661150f565b0361070257507f0000000000000000000000000000000000000000000000000000000000000000919050565b60018260028111156107165761071661150f565b0361074257507f0000000000000000000000000000000000000000000000000000000000000000919050565b60405163fdea7c0960e01b815260040160405180910390fd5b919050565b610768610d6e565b6107715f610c68565b565b5f5f5f5f6107818686610e05565b9350935093509350610792836106c1565b6001600160a01b0316635ddb9b5b856040518263ffffffff1660e01b81526004016107bd919061118c565b602060405180830381865afa1580156107d8573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107fc91906114f4565b63ffffffff168b63ffffffff16116108275760405163207617df60e01b815260040160405180910390fd5b61084c8b8b8b8b8b8b8b60405161083f929190611523565b6040518091039020610e4c565b60028360028111156108605761086061150f565b036108f1577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636738c40b858d61089f85610eed565b866040518563ffffffff1660e01b81526004016108bf949392919061156c565b5f604051808303815f87803b1580156108d6575f5ffd5b505af11580156108e8573d5f5f3e3d5ffd5b50505050610964565b60018360028111156109055761090561150f565b03610742577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166356d482f5858d61094485610f0f565b866040518563ffffffff1660e01b81526004016108bf94939291906115df565b5050505050505050505050565b604080517fdbbb55ba0f5fdd66c1f17f44359cb4c67628f9dca440a4c104e61189ad4424b9602082015290810184905263ffffffff8084166060830152821660808201525f9060a0016040516020818303038152906040528051906020012090509392505050565b428263ffffffff161115610a0057604051635a119db560e11b815260040160405180910390fd5b60655463ffffffff62010000909104811690831611610a325760405163037fa86b60e31b815260040160405180910390fd5b610a3d838383610971565b846020013514610a6057604051638b56642d60e01b815260040160405180910390fd5b6040805160018082528183019092525f91602080830190803683375050606554825192935061ffff16918391505f90610a9b57610a9b611698565b61ffff90921660209283029190910190910152604051625f5e5d60e21b81525f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063017d797490610b00906066908a908790600401611756565b6020604051808303815f875af1158015610b1c573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b4091906118e3565b905080610b6057604051633042041f60e21b815260040160405180910390fd5b6065805463ffffffff80871662010000810265ffffffff000019909316929092179092555f818152606860209081526040808320805495891663ffffffff1996871681179091558352606982528083208054909516841790945582825260679052828120889055915187927f010dcbe0d1e019c93357711f7bb6287d543b7ff7de74f29df3fb5ecceec8d36991a3505050505050565b610bfe610d6e565b6001600160a01b038116610c635760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104b0565b6105ef815b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b806066610cc68282611902565b9050507f20100394950e66014c25009b45d12b675210a6e7a002044a0e3de6544e3c4b3781604051610cf8919061195e565b60405180910390a150565b61271061ffff82161115610d2a576040516307336f0360e11b815260040160405180910390fd5b6065805461ffff191661ffff83169081179091556040519081527ff5d1836df8fcd7c1e54047e94ac8773d2855395603e2ef9ba5f5f16905f2259290602001610cf8565b6033546001600160a01b031633146107715760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104b0565b60605f610dd483610f25565b6040805160208082528183019092529192505f91906020820181803683375050509182525060208101929092525090565b604080518082019091525f8082526020820152604080518082019091525f80825260208201819052906060610e3c85870187611a26565b9299919850965090945092505050565b63ffffffff86165f908152606760205260409020548514610e805760405163639d09b560e11b815260040160405180910390fd5b610ec883838080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152508992508591505063ffffffff8816610f4c565b610ee55760405163afa42ca760e01b815260040160405180910390fd5b505050505050565b610ef5610ffa565b81806020019051810190610f099190611b77565b92915050565b606081806020019051810190610f099190611c26565b5f60ff8216601f811115610f0957604051632cd44ac360e21b815260040160405180910390fd5b5f83610f59868585610f63565b1495945050505050565b5f60208451610f729190611d27565b15610f90576040516313717da960e21b815260040160405180910390fd5b8260205b85518111610ff157610fa7600285611d27565b5f03610fc857815f528086015160205260405f209150600284049350610fdf565b808601515f528160205260405f2091506002840493505b610fea602082611d46565b9050610f94565b50949350505050565b60405180608001604052805f81526020015f815260200161102c60405180604001604052805f81526020015f81525090565b8152602001606081525090565b6001600160a01b03811681146105ef575f5ffd5b5f6040828403121561105d575f5ffd5b50919050565b803561ffff8116811461075b575f5ffd5b63ffffffff811681146105ef575f5ffd5b5f5f5f5f5f5f610100878903121561109b575f5ffd5b86356110a681611039565b95506110b5886020890161104d565b94506110c360608801611063565b935060808701356110d381611074565b925060a08701356001600160401b038111156110ed575f5ffd5b870160a0818a0312156110fe575f5ffd5b915061110d8860c0890161104d565b90509295509295509295565b5f60408284031215611129575f5ffd5b611133838361104d565b9392505050565b5f6020828403121561114a575f5ffd5b813561113381611074565b5f60208284031215611165575f5ffd5b61113382611063565b80516001600160a01b0316825260209081015163ffffffff16910152565b60408101610f09828461116e565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b80356003811061075b575f5ffd5b5f602082840312156111ed575f5ffd5b611133826111cf565b5f5f83601f840112611206575f5ffd5b5081356001600160401b0381111561121c575f5ffd5b602083019150836020828501011115611233575f5ffd5b9250929050565b5f5f5f5f5f5f5f60a0888a031215611250575f5ffd5b873561125b81611074565b965060208801359550604088013561127281611074565b945060608801356001600160401b0381111561128c575f5ffd5b6112988a828b016111f6565b90955093505060808801356001600160401b038111156112b6575f5ffd5b6112c28a828b016111f6565b989b979a50959850939692959293505050565b5f5f5f606084860312156112e7575f5ffd5b8335925060208401356112f981611074565b9150604084013561130981611074565b809150509250925092565b5f5f5f5f60808587031215611327575f5ffd5b84356001600160401b0381111561133c575f5ffd5b8501610120818803121561134e575f5ffd5b935060208501359250604085013561136581611074565b9150606085013561137581611074565b939692955090935050565b5f60208284031215611390575f5ffd5b813561113381611039565b80356113a681611039565b6001600160a01b0316825260208101356113bf81611074565b63ffffffff81166020840152505050565b5f5f8335601e198436030181126113e5575f5ffd5b83016020810192503590506001600160401b03811115611403575f5ffd5b8060051b3603821315611233575f5ffd5b8183525f6001600160fb1b0383111561142b575f5ffd5b8260051b80836020870137939093016020019392505050565b61144e818661139b565b63ffffffff841660408281019190915260c06060808401829052853591840191909152602085013560e0840152908401356101008301528301356101208201525f61149c60808501856113d0565b60a06101408501526114b361016085018284611414565b925050506114c4608083018461139b565b95945050505050565b60408101610f098284546001600160a01b038116825260a01c63ffffffff16602090910152565b5f60208284031215611504575f5ffd5b815161113381611074565b634e487b7160e01b5f52602160045260245ffd5b818382375f9101908152919050565b5f8151808452602084019350602083015f5b82811015611562578151865260209586019590910190600101611544565b5093949350505050565b611576818661116e565b63ffffffff8416604082015260c06060820152825160c0820152602083015160e08201525f60408401518051610100840152602081015161012084015250606084015160a06101408401526115cf610160840182611532565b9150506114c4608083018461116e565b5f60c082016115ee838861116e565b63ffffffff8616604084015260c0606084015280855180835260e08501915060e08160051b8601019250602087015f5b8281101561166f5786850360df19018452815180516001600160a01b0316865260209081015160409187018290529061165990870182611532565b955050602093840193919091019060010161161e565b50505050809150506114c4608083018461116e565b634e487b7160e01b5f52604160045260245ffd5b634e487b7160e01b5f52603260045260245ffd5b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b5f8235605e198336030181126116e8575f5ffd5b90910192915050565b80358252602080820135908301525f61170d60408301836113d0565b606060408601526114c4606086018284611414565b5f8151808452602084019350602083015f5b8281101561156257815161ffff16865260209586019590910190600101611734565b6117798185546001600160a01b038116825260a01c63ffffffff16602090910152565b608060408201525f6101a08201843561179181611074565b63ffffffff166080840152602085013560a0840152604085013560c0840152606085013560e0840152604060808601610100850137604060c086016101408501376117e06101008601866113d0565b610120610180860152828184526101c0860190506101c08260051b8701019350825f5b838110156118c2578786036101bf1901835261181f82866116d4565b803561182a81611074565b63ffffffff168752602081013536829003601e19018112611849575f5ffd5b81016020810190356001600160401b03811115611864575f5ffd5b803603821315611872575f5ffd5b606060208a015261188760608a0182846116ac565b91505061189760408301836116d4565b915087810360408901526118ab81836116f1565b975050506020928301929190910190600101611803565b505050505082810360608401526118d98185611722565b9695505050505050565b5f602082840312156118f3575f5ffd5b81518015158114611133575f5ffd5b813561190d81611039565b81546001600160a01b031981166001600160a01b03929092169182178355602084013561193981611074565b6001600160c01b03199190911690911760a09190911b63ffffffff60a01b1617905550565b60408101610f09828461139b565b604080519081016001600160401b038111828210171561198e5761198e611684565b60405290565b604051608081016001600160401b038111828210171561198e5761198e611684565b604051601f8201601f191681016001600160401b03811182821017156119de576119de611684565b604052919050565b5f604082840312156119f6575f5ffd5b6119fe61196c565b90508135611a0b81611039565b81526020820135611a1b81611074565b602082015292915050565b5f5f5f5f60c08587031215611a39575f5ffd5b611a4386866119e6565b9350611a51604086016111cf565b9250611a6086606087016119e6565b915060a08501356001600160401b03811115611a7a575f5ffd5b8501601f81018713611a8a575f5ffd5b80356001600160401b03811115611aa357611aa3611684565b611ab6601f8201601f19166020016119b6565b818152886020838501011115611aca575f5ffd5b816020840160208301375f6020838301015280935050505092959194509250565b5f6001600160401b03821115611b0357611b03611684565b5060051b60200190565b5f82601f830112611b1c575f5ffd5b8151611b2f611b2a82611aeb565b6119b6565b8082825260208201915060208360051b860101925085831115611b50575f5ffd5b602085015b83811015611b6d578051835260209283019201611b55565b5095945050505050565b5f60208284031215611b87575f5ffd5b81516001600160401b03811115611b9c575f5ffd5b820180840360a0811215611bae575f5ffd5b611bb6611994565b82518152602080840151908201526040603f1983011215611bd5575f5ffd5b611bdd61196c565b604084810151825260608501516020830152820152608083015191506001600160401b03821115611c0c575f5ffd5b611c1886838501611b0d565b606082015295945050505050565b5f60208284031215611c36575f5ffd5b81516001600160401b03811115611c4b575f5ffd5b8201601f81018413611c5b575f5ffd5b8051611c69611b2a82611aeb565b8082825260208201915060208360051b850101925086831115611c8a575f5ffd5b602084015b83811015611d1c5780516001600160401b03811115611cac575f5ffd5b85016040818a03601f19011215611cc1575f5ffd5b611cc961196c565b6020820151611cd781611039565b815260408201516001600160401b03811115611cf1575f5ffd5b611d008b602083860101611b0d565b6020830152508085525050602083019250602081019050611c8f565b509695505050505050565b5f82611d4157634e487b7160e01b5f52601260045260245ffd5b500690565b80820180821115610f0957634e487b7160e01b5f52601160045260245ffdfea26469706673582212201f5c151a0c2118dacaf5d038f78efd43a22901b7e91e17a4bddee2bb6298a1ab64736f6c634300081b0033", } // OperatorTableUpdaterABI is the input ABI used to generate the binding from. diff --git a/src/contracts/interfaces/IECDSACertificateVerifier.sol b/src/contracts/interfaces/IECDSACertificateVerifier.sol index be47c9cd49..7755bfb210 100644 --- a/src/contracts/interfaces/IECDSACertificateVerifier.sol +++ b/src/contracts/interfaces/IECDSACertificateVerifier.sol @@ -130,4 +130,24 @@ interface IECDSACertificateVerifier is IECDSACertificateVerifierEvents, IBaseCer OperatorSet calldata operatorSet, uint32 referenceTimestamp ) external view returns (uint256[] memory); + + /** + * @notice Override domainSeparator to not include chainId + * @return The domain separator hash without chainId + * @dev This function overrides the base domainSeparator to not include chainId + */ + function domainSeparator() external view returns (bytes32); + + /** + * @notice Calculate the EIP-712 digest for a certificate + * @param referenceTimestamp The reference timestamp + * @param messageHash The message hash + * @return The EIP-712 digest + * @dev This function is public to allow offchain tools to calculate the same digest + * @dev Note: This does not support smart contract based signatures for multichain + */ + function calculateCertificateDigest( + uint32 referenceTimestamp, + bytes32 messageHash + ) external view returns (bytes32); } diff --git a/src/contracts/multichain/ECDSACertificateVerifier.sol b/src/contracts/multichain/ECDSACertificateVerifier.sol index 506d7ab1ac..205fa16292 100644 --- a/src/contracts/multichain/ECDSACertificateVerifier.sol +++ b/src/contracts/multichain/ECDSACertificateVerifier.sol @@ -38,56 +38,10 @@ contract ECDSACertificateVerifier is Initializable, ECDSACertificateVerifierStor } /** - * @notice Override domainSeparator to not include chainId - * @return The domain separator hash without chainId + * + * EXTERNAL FUNCTIONS + * */ - function domainSeparator() public view override returns (bytes32) { - return keccak256( - abi.encode( - EIP712_DOMAIN_TYPEHASH_NO_CHAINID, - keccak256(bytes("EigenLayer")), - keccak256(bytes(_majorVersion())), - address(this) - ) - ); - } - - /** - * @notice Calculate the EIP-712 digest for a certificate - * @param referenceTimestamp The reference timestamp - * @param messageHash The message hash - * @return The EIP-712 digest - * @dev This function is public to allow offchain tools to calculate the same digest - * @dev Note: This does not support smart contract based signatures for multichain - */ - function calculateCertificateDigest(uint32 referenceTimestamp, bytes32 messageHash) public view returns (bytes32) { - bytes32 structHash = keccak256(abi.encode(ECDSA_CERTIFICATE_TYPEHASH, referenceTimestamp, messageHash)); - return _calculateSignableDigest(structHash); - } - - ///@inheritdoc IBaseCertificateVerifier - function getOperatorSetOwner( - OperatorSet memory operatorSet - ) external view returns (address) { - bytes32 operatorSetKey = operatorSet.key(); - return _operatorSetOwners[operatorSetKey]; - } - - ///@inheritdoc IBaseCertificateVerifier - function maxOperatorTableStaleness( - OperatorSet memory operatorSet - ) external view returns (uint32) { - bytes32 operatorSetKey = operatorSet.key(); - return _maxStalenessPeriods[operatorSetKey]; - } - - ///@inheritdoc IBaseCertificateVerifier - function latestReferenceTimestamp( - OperatorSet memory operatorSet - ) external view returns (uint32) { - bytes32 operatorSetKey = operatorSet.key(); - return _latestReferenceTimestamps[operatorSetKey]; - } ///@inheritdoc IECDSACertificateVerifier function updateOperatorTable( @@ -158,62 +112,6 @@ contract ECDSACertificateVerifier is Initializable, ECDSACertificateVerifierStor return true; } - /// @inheritdoc IECDSACertificateVerifier - function getOperatorInfos( - OperatorSet memory operatorSet, - uint32 referenceTimestamp - ) external view returns (ECDSAOperatorInfo[] memory) { - bytes32 operatorSetKey = operatorSet.key(); - uint32 numOperators = uint32(_numOperators[operatorSetKey][referenceTimestamp]); - ECDSAOperatorInfo[] memory operatorInfos = new ECDSAOperatorInfo[](numOperators); - - for (uint32 i = 0; i < numOperators; i++) { - operatorInfos[i] = _operatorInfos[operatorSetKey][referenceTimestamp][i]; - } - - return operatorInfos; - } - - /// @inheritdoc IECDSACertificateVerifier - function getOperatorInfo( - OperatorSet memory operatorSet, - uint32 referenceTimestamp, - uint32 operatorIndex - ) external view returns (ECDSAOperatorInfo memory) { - bytes32 operatorSetKey = operatorSet.key(); - require(operatorIndex < _numOperators[operatorSetKey][referenceTimestamp], "Operator index out of bounds"); - return _operatorInfos[operatorSetKey][referenceTimestamp][operatorIndex]; - } - - /// @inheritdoc IECDSACertificateVerifier - function getOperatorCount( - OperatorSet memory operatorSet, - uint32 referenceTimestamp - ) external view returns (uint32) { - bytes32 operatorSetKey = operatorSet.key(); - return uint32(_numOperators[operatorSetKey][referenceTimestamp]); - } - - /// @inheritdoc IECDSACertificateVerifier - function getTotalStakes( - OperatorSet calldata operatorSet, - uint32 referenceTimestamp - ) public view returns (uint256[] memory) { - bytes32 operatorSetKey = operatorSet.key(); - require(_latestReferenceTimestamps[operatorSetKey] == referenceTimestamp, ReferenceTimestampDoesNotExist()); - uint256 operatorCount = _numOperators[operatorSetKey][referenceTimestamp]; - require(operatorCount > 0, ReferenceTimestampDoesNotExist()); - uint256 stakeTypesCount = _operatorInfos[operatorSetKey][referenceTimestamp][0].weights.length; - uint256[] memory totalStakes = new uint256[](stakeTypesCount); - for (uint256 i = 0; i < operatorCount; i++) { - uint256[] memory weights = _operatorInfos[operatorSetKey][referenceTimestamp][uint32(i)].weights; - for (uint256 j = 0; j < weights.length && j < stakeTypesCount; j++) { - totalStakes[j] += weights[j]; - } - } - return totalStakes; - } - /** * @notice Internal function to verify a certificate * @param cert The certificate to verify @@ -273,6 +171,12 @@ contract ECDSACertificateVerifier is Initializable, ECDSACertificateVerifierStor return signedStakes; } + /** + * + * INTERNAL FUNCTIONS + * + */ + /** * @notice Parse signatures from the concatenated signature bytes * @param messageHash The message hash that was signed @@ -317,4 +221,108 @@ contract ECDSACertificateVerifier is Initializable, ECDSACertificateVerifierStor return (signers, true); } + + /** + * + * VIEW FUNCTIONS + * + */ + + ///@inheritdoc IBaseCertificateVerifier + function getOperatorSetOwner( + OperatorSet memory operatorSet + ) external view returns (address) { + bytes32 operatorSetKey = operatorSet.key(); + return _operatorSetOwners[operatorSetKey]; + } + + ///@inheritdoc IBaseCertificateVerifier + function maxOperatorTableStaleness( + OperatorSet memory operatorSet + ) external view returns (uint32) { + bytes32 operatorSetKey = operatorSet.key(); + return _maxStalenessPeriods[operatorSetKey]; + } + + ///@inheritdoc IBaseCertificateVerifier + function latestReferenceTimestamp( + OperatorSet memory operatorSet + ) external view returns (uint32) { + bytes32 operatorSetKey = operatorSet.key(); + return _latestReferenceTimestamps[operatorSetKey]; + } + + /// @inheritdoc IECDSACertificateVerifier + function getOperatorInfos( + OperatorSet memory operatorSet, + uint32 referenceTimestamp + ) external view returns (ECDSAOperatorInfo[] memory) { + bytes32 operatorSetKey = operatorSet.key(); + uint32 numOperators = uint32(_numOperators[operatorSetKey][referenceTimestamp]); + ECDSAOperatorInfo[] memory operatorInfos = new ECDSAOperatorInfo[](numOperators); + + for (uint32 i = 0; i < numOperators; i++) { + operatorInfos[i] = _operatorInfos[operatorSetKey][referenceTimestamp][i]; + } + + return operatorInfos; + } + + /// @inheritdoc IECDSACertificateVerifier + function getOperatorInfo( + OperatorSet memory operatorSet, + uint32 referenceTimestamp, + uint32 operatorIndex + ) external view returns (ECDSAOperatorInfo memory) { + bytes32 operatorSetKey = operatorSet.key(); + require(operatorIndex < _numOperators[operatorSetKey][referenceTimestamp], "Operator index out of bounds"); + return _operatorInfos[operatorSetKey][referenceTimestamp][operatorIndex]; + } + + /// @inheritdoc IECDSACertificateVerifier + function getOperatorCount( + OperatorSet memory operatorSet, + uint32 referenceTimestamp + ) external view returns (uint32) { + bytes32 operatorSetKey = operatorSet.key(); + return uint32(_numOperators[operatorSetKey][referenceTimestamp]); + } + + /// @inheritdoc IECDSACertificateVerifier + function getTotalStakes( + OperatorSet calldata operatorSet, + uint32 referenceTimestamp + ) public view returns (uint256[] memory) { + bytes32 operatorSetKey = operatorSet.key(); + require(_latestReferenceTimestamps[operatorSetKey] == referenceTimestamp, ReferenceTimestampDoesNotExist()); + uint256 operatorCount = _numOperators[operatorSetKey][referenceTimestamp]; + require(operatorCount > 0, ReferenceTimestampDoesNotExist()); + uint256 stakeTypesCount = _operatorInfos[operatorSetKey][referenceTimestamp][0].weights.length; + uint256[] memory totalStakes = new uint256[](stakeTypesCount); + for (uint256 i = 0; i < operatorCount; i++) { + uint256[] memory weights = _operatorInfos[operatorSetKey][referenceTimestamp][uint32(i)].weights; + for (uint256 j = 0; j < weights.length && j < stakeTypesCount; j++) { + totalStakes[j] += weights[j]; + } + } + return totalStakes; + } + + /// @inheritdoc IECDSACertificateVerifier + function domainSeparator() public view override(IECDSACertificateVerifier, SignatureUtilsMixin) returns (bytes32) { + return keccak256( + abi.encode( + EIP712_DOMAIN_TYPEHASH_NO_CHAINID, + keccak256(bytes("EigenLayer")), + keccak256(bytes(_majorVersion())), + address(this) + ) + ); + } + + /// @inheritdoc IECDSACertificateVerifier + function calculateCertificateDigest(uint32 referenceTimestamp, bytes32 messageHash) public view returns (bytes32) { + bytes32 structHash = keccak256(abi.encode(ECDSA_CERTIFICATE_TYPEHASH, referenceTimestamp, messageHash)); + return _calculateSignableDigest(structHash); + } } diff --git a/src/test/tree/ECDSACertificateVerifierUnit.tree b/src/test/tree/ECDSACertificateVerifierUnit.tree new file mode 100644 index 0000000000..761be50e11 --- /dev/null +++ b/src/test/tree/ECDSACertificateVerifierUnit.tree @@ -0,0 +1,65 @@ +. +└── ECDSACertificateVerifier (**** denotes that integration tests are needed to fully validate path) + ├── when updateOperatorTable is called + │ ├── given that the caller is not the table updater + │ │ └── it should revert + │ ├── given that the reference timestamp is not greater than the latest + │ │ └── it should revert + │ └── given that all parameters are valid + │ └── it should update operator infos, timestamp, owner, and staleness period & emit event + ├── when verifyCertificate is called + │ ├── given that the reference timestamp does not exist + │ │ └── it should revert + │ ├── given that the certificate is stale + │ │ └── it should revert + │ ├── given that the signature is invalid + │ │ └── it should revert + │ ├── given that a signer is not an operator + │ │ └── it should revert + │ ├── given that signatures are not ordered by address + │ │ └── it should revert + │ ├── given that all operators are signers + │ │ └── it should return full stake amounts + │ └── given that some operators are non-signers + │ └── it should deduct non-signer stakes from total + ├── when verifyCertificateProportion is called + │ ├── given that array lengths mismatch + │ │ └── it should revert + │ ├── given that the certificate meets thresholds + │ │ └── it should return true + │ └── given that the certificate does not meet thresholds + │ └── it should return false + ├── when verifyCertificateNominal is called + │ ├── given that array lengths mismatch + │ │ └── it should revert + │ ├── given that the certificate meets thresholds + │ │ └── it should return true + │ └── given that the certificate does not meet thresholds + │ └── it should return false + └── when view functions are called + ├── getOperatorSetOwner + │ └── it should return the correct owner address + ├── maxOperatorTableStaleness + │ └── it should return the correct staleness period + ├── latestReferenceTimestamp + │ └── it should return the latest timestamp + ├── getOperatorInfos + │ └── it should return all operator infos for the given timestamp + ├── getOperatorInfo + │ ├── given an out of bounds index + │ │ └── it should revert + │ └── given a valid index + │ └── it should return the correct operator info + ├── getOperatorCount + │ └── it should return the correct number of operators + ├── getTotalStakes + │ ├── given that reference timestamp does not exist + │ │ └── it should revert + │ ├── given that there are no operators + │ │ └── it should revert + │ └── given valid operators exist + │ └── it should return the sum of all operator weights + ├── domainSeparator + │ └── it should return the EIP-712 domain separator + └── calculateCertificateDigest + └── it should return the correct digest for given timestamp and message hash \ No newline at end of file diff --git a/src/test/unit/ECDSACertificateVerifierUnit.t.sol b/src/test/unit/ECDSACertificateVerifierUnit.t.sol index b2f7e6f257..ab0592574d 100644 --- a/src/test/unit/ECDSACertificateVerifierUnit.t.sol +++ b/src/test/unit/ECDSACertificateVerifierUnit.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.27; -import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; +import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import "forge-std/Test.sol"; import "src/contracts/libraries/OperatorSetLib.sol"; @@ -9,121 +9,150 @@ import "src/contracts/multichain/ECDSACertificateVerifier.sol"; import "src/contracts/interfaces/IOperatorTableUpdater.sol"; import "src/contracts/interfaces/IECDSACertificateVerifier.sol"; import "src/contracts/interfaces/ICrossChainRegistry.sol"; +import "src/test/utils/EigenLayerMultichainUnitTestSetup.sol"; +import "src/test/utils/Random.sol"; /** - * @title ECDSACertificateVerifierTest - * @notice Unit tests for ECDSACertificateVerifier contract + * @title ECDSACertificateVerifierUnitTests + * @notice Base contract for all ECDSACertificateVerifier unit tests */ -contract ECDSACertificateVerifierTest is Test { - // Contract being tested +contract ECDSACertificateVerifierUnitTests is + EigenLayerMultichainUnitTestSetup, + IECDSACertificateVerifierTypes, + IECDSACertificateVerifierEvents, + IBaseCertificateVerifierErrors +{ + using OperatorSetLib for OperatorSet; + + // Contracts + ECDSACertificateVerifier ecdsaCertificateVerifierImplementation; ECDSACertificateVerifier verifier; // Test accounts - address owner = address(0x1); - address tableUpdater = address(0x2); - address nonOwner = address(0x3); address operatorSetOwner = address(0x4); - // Test data + // Defaults uint32 numOperators = 4; - uint32 maxStaleness = 3600; // 1 hour max staleness - - // Create an OperatorSet for testing - OperatorSet testOperatorSet; + uint32 defaultMaxStaleness = 3600; // 1 hour max staleness + OperatorSet defaultOperatorSet; + ICrossChainRegistryTypes.OperatorSetConfig defaultOperatorSetConfig; // ECDSA signature specific fields - bytes32 msgHash; - uint signerPrivateKey = 0x1234; - address signerAddress; - - // Events - event TableUpdated( - OperatorSet indexed operatorSet, uint32 referenceTimestamp, IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] operatorInfos - ); + bytes32 defaultMsgHash = keccak256(abi.encodePacked("test message")); - function setUp() public virtual { - vm.warp(1_000_000); // Set block timestamp + function setUp() public virtual override { + super.setUp(); - testOperatorSet.avs = address(0x5); - testOperatorSet.id = 1; + defaultOperatorSet = OperatorSet({avs: address(0x5), id: 0}); + defaultOperatorSetConfig = + ICrossChainRegistryTypes.OperatorSetConfig({owner: operatorSetOwner, maxStalenessPeriod: defaultMaxStaleness}); // Deploy implementation - ECDSACertificateVerifier implementation = new ECDSACertificateVerifier(IOperatorTableUpdater(tableUpdater), "1.0.0"); + ecdsaCertificateVerifierImplementation = + new ECDSACertificateVerifier(IOperatorTableUpdater(address(operatorTableUpdaterMock)), "1.0.0"); // Deploy proxy and initialize - ERC1967Proxy proxy = new ERC1967Proxy(address(implementation), ""); + verifier = ECDSACertificateVerifier( + address(new TransparentUpgradeableProxy(address(ecdsaCertificateVerifierImplementation), address(eigenLayerProxyAdmin), "")) + ); + } - verifier = ECDSACertificateVerifier(address(proxy)); + // Helper functions + + /** + * @notice Generate signer and non-signer private keys + * @param pseudoRandomNumber Pseudo random number for generating keys + * @param numSigners Number of signers to generate + * @param numNonSigners Number of non-signers to generate + * @return signerPrivKeys Array of signer private keys + * @return nonSignerPrivKeys Array of non-signer private keys + */ + function _generateSignerAndNonSignerPrivateKeys(uint pseudoRandomNumber, uint numSigners, uint numNonSigners) + internal + pure + returns (uint[] memory signerPrivKeys, uint[] memory nonSignerPrivKeys) + { + signerPrivKeys = new uint[](numSigners); + nonSignerPrivKeys = new uint[](numNonSigners); - // Set standard test message hash - msgHash = keccak256(abi.encodePacked("test message")); + // Generate signer keys + for (uint i = 0; i < numSigners; i++) { + signerPrivKeys[i] = uint(keccak256(abi.encodePacked("signerPrivateKey", pseudoRandomNumber, i))) % MAX_PRIVATE_KEY; + if (signerPrivKeys[i] == 0) signerPrivKeys[i] = 1; // Ensure non-zero + } - // Generate signer address from private key - signerAddress = vm.addr(signerPrivateKey); + // Generate non-signer keys + for (uint i = 0; i < numNonSigners; i++) { + nonSignerPrivKeys[i] = uint(keccak256(abi.encodePacked("nonSignerPrivateKey", pseudoRandomNumber, i))) % MAX_PRIVATE_KEY; + if (nonSignerPrivKeys[i] == 0) nonSignerPrivKeys[i] = 1; // Ensure non-zero + } } - // Helper to create operator infos with specified weights - function createOperatorInfos(uint numSigners, uint numNonSigners) + /** + * @notice Create operators with split keys + * @param pseudoRandomNumber Pseudo random number for generating operator data + * @param numSigners Number of signers + * @param numNonSigners Number of non-signers + * @return operators Array of operator infos + * @return nonSignerIndices Array of non-signer indices + * @return signerPrivKeys Array of signer private keys + */ + function _createOperatorsWithSplitKeys(uint pseudoRandomNumber, uint numSigners, uint numNonSigners) internal view returns ( - IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory, - address[] memory, - uint[] memory // signer private keys + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys ) { require(numSigners + numNonSigners == numOperators, "Total operators mismatch"); - IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory ops = new IECDSACertificateVerifierTypes.ECDSAOperatorInfo[](numOperators); - address[] memory nonSigners = new address[](numNonSigners); - uint[] memory signerPrivKeys = new uint[](numSigners); + // Generate private keys + uint[] memory nonSignerPrivKeys; + (signerPrivKeys, nonSignerPrivKeys) = _generateSignerAndNonSignerPrivateKeys(pseudoRandomNumber, numSigners, numNonSigners); - // Create signers - for (uint i = 0; i < numSigners; i++) { - uint privateKey = uint(keccak256(abi.encodePacked("signer", i))); - address pubkey = vm.addr(privateKey); - - ops[i].pubkey = pubkey; - ops[i].weights = new uint[](2); - ops[i].weights[0] = uint(100 + i * 10); - ops[i].weights[1] = uint(200 + i * 20); - signerPrivKeys[i] = privateKey; + // Create all operators + operators = new IECDSACertificateVerifierTypes.ECDSAOperatorInfo[](numOperators); + + // Track indices of non-signers + nonSignerIndices = new uint32[](numNonSigners); + + // Create signers first + for (uint32 i = 0; i < numSigners; i++) { + operators[i].pubkey = vm.addr(signerPrivKeys[i]); + operators[i].weights = new uint[](2); + operators[i].weights[0] = uint(100 + i * 10); + operators[i].weights[1] = uint(200 + i * 20); } // Create non-signers - for (uint i = 0; i < numNonSigners; i++) { - uint idx = numSigners + i; - uint privateKey = uint(keccak256(abi.encodePacked("nonsigner", i))); - address pubkey = vm.addr(privateKey); - - ops[idx].pubkey = pubkey; - ops[idx].weights = new uint[](2); - ops[idx].weights[0] = uint(100 + idx * 10); - ops[idx].weights[1] = uint(200 + idx * 20); - nonSigners[i] = pubkey; + for (uint32 i = 0; i < numNonSigners; i++) { + uint32 idx = uint32(numSigners + i); + operators[idx].pubkey = vm.addr(nonSignerPrivKeys[i]); + operators[idx].weights = new uint[](2); + operators[idx].weights[0] = uint(100 + idx * 10); + operators[idx].weights[1] = uint(200 + idx * 20); + nonSignerIndices[i] = idx; } - - return (ops, nonSigners, signerPrivKeys); } - // Helper to create operator set config - function createOperatorSetConfig() internal view returns (ICrossChainRegistryTypes.OperatorSetConfig memory) { - return ICrossChainRegistryTypes.OperatorSetConfig({owner: operatorSetOwner, maxStalenessPeriod: maxStaleness}); - } - - // Helper function to mirror _calculateSignableDigest - function calculateSignableDigest(bytes32 structHash) internal view returns (bytes32) { - return keccak256(abi.encodePacked("\x19\x01", verifier.domainSeparator(), structHash)); - } - - // Helper to create a certificate with real ECDSA signatures - function createCertificate( + /** + * @notice Create a certificate with ECDSA signatures + * @param referenceTimestamp Reference timestamp for the certificate + * @param messageHash Message hash to sign + * @param nonSignerIndices Array of non-signer indices + * @param operators Array of operator infos + * @param signerPrivKeys Array of signer private keys + * @return cert The created certificate + */ + function _createCertificate( uint32 referenceTimestamp, bytes32 messageHash, - address[] memory nonSigners, - IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory ops, + uint32[] memory nonSignerIndices, + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, uint[] memory signerPrivKeys - ) internal view returns (IECDSACertificateVerifierTypes.ECDSACertificate memory) { + ) internal view returns (IECDSACertificateVerifierTypes.ECDSACertificate memory cert) { // Use the contract's digest calculation bytes32 signableDigest = verifier.calculateCertificateDigest(referenceTimestamp, messageHash); @@ -131,23 +160,14 @@ contract ECDSACertificateVerifierTest is Test { uint numSigners = signerPrivKeys.length; address[] memory signerAddresses = new address[](numSigners); bytes[] memory signaturesArr = new bytes[](numSigners); - uint signerIdx = 0; - for (uint i = 0; i < ops.length; i++) { - bool isNonSigner = false; - for (uint j = 0; j < nonSigners.length; j++) { - if (ops[i].pubkey == nonSigners[j]) { - isNonSigner = true; - break; - } - } - if (!isNonSigner) { - (uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPrivKeys[signerIdx], signableDigest); - bytes memory signature = abi.encodePacked(r, s, v); - signerAddresses[signerIdx] = ops[i].pubkey; - signaturesArr[signerIdx] = signature; - signerIdx++; - } + + // Get signer addresses and create signatures + for (uint i = 0; i < numSigners; i++) { + signerAddresses[i] = vm.addr(signerPrivKeys[i]); + (uint8 v, bytes32 r, bytes32 s) = vm.sign(signerPrivKeys[i], signableDigest); + signaturesArr[i] = abi.encodePacked(r, s, v); } + // Sort signers and signatures by address (ascending) for (uint i = 0; i < numSigners; i++) { for (uint j = i + 1; j < numSigners; j++) { @@ -163,377 +183,934 @@ contract ECDSACertificateVerifierTest is Test { } } } + // Concatenate signatures in sorted order bytes memory signatures; for (uint i = 0; i < numSigners; i++) { signatures = bytes.concat(signatures, signaturesArr[i]); } - return IECDSACertificateVerifierTypes.ECDSACertificate({ + + cert = IECDSACertificateVerifierTypes.ECDSACertificate({ referenceTimestamp: referenceTimestamp, messageHash: messageHash, sig: signatures }); } - // Test updating the operator table - function testUpdateOperatorTable() public { - uint32 referenceTimestamp = uint32(block.timestamp); + /** + * @notice Update operator table with randomness + * @param r Randomness for generating operator data + * @param numSigners Number of signers + * @param numNonSigners Number of non-signers + * @return operators Array of operator infos + * @return operatorSetConfig Operator set configuration + * @return referenceTimestamp Reference timestamp + * @return nonSignerIndices Array of non-signer indices + * @return signerPrivKeys Array of signer private keys + */ + function _updateOperatorTable(Randomness r, uint numSigners, uint numNonSigners) + internal + returns ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) + { + // Generate seed and reference timestamp + uint seed = r.Uint256(); + referenceTimestamp = r.Uint32(uint32(block.timestamp + 1), uint32(block.timestamp + 1000)); + + // Create operators + (operators, nonSignerIndices, signerPrivKeys) = _createOperatorsWithSplitKeys(seed, numSigners, numNonSigners); + operatorSetConfig = defaultOperatorSetConfig; + + // Update operator table + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, operatorSetConfig); + } + + /** + * @notice Initialize operator table for basic tests + * @return referenceTimestamp The reference timestamp used + */ + function _initializeOperatorTableBase() internal returns (uint32 referenceTimestamp) { + referenceTimestamp = uint32(block.timestamp); + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators,,) = _createOperatorsWithSplitKeys(123, numOperators, 0); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); + } +} + +/** + * @title ECDSACertificateVerifierUnitTests_updateOperatorTable + * @notice Unit tests for ECDSACertificateVerifier.updateOperatorTable + */ +contract ECDSACertificateVerifierUnitTests_updateOperatorTable is ECDSACertificateVerifierUnitTests { + function test_revert_notTableUpdater() public { + // Empty data + uint32 referenceTimestamp; + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators; + + // Update Table + vm.prank(address(0x100)); + vm.expectRevert(OnlyTableUpdater.selector); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); + } - // Create operators - 3 signers, 1 non-signer - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); + function test_revert_staleTimestamp() public { + vm.warp(1000); + uint32 firstTimestamp = uint32(block.timestamp); + uint32 staleTimestamp = firstTimestamp - 100; - // Create operator set config - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators,,) = _createOperatorsWithSplitKeys(123, 3, 1); - vm.startPrank(tableUpdater); + vm.startPrank(address(operatorTableUpdaterMock)); - // Update the operator table - verifier.updateOperatorTable(testOperatorSet, referenceTimestamp, operators, operatorSetConfig); + // First update should succeed + verifier.updateOperatorTable(defaultOperatorSet, firstTimestamp, operators, defaultOperatorSetConfig); + + // Second update with earlier timestamp should fail + vm.expectRevert(TableUpdateStale.selector); + verifier.updateOperatorTable(defaultOperatorSet, staleTimestamp, operators, defaultOperatorSetConfig); vm.stopPrank(); + } + + function testFuzz_updateOperatorTable_correctness(Randomness r) public rand(r) { + uint seed = r.Uint256(); + uint numSigners = r.Uint256(1, numOperators); + uint numNonSigners = numOperators - numSigners; + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators,,) = + _createOperatorsWithSplitKeys(seed, numSigners, numNonSigners); + + // Expect event + uint32 referenceTimestamp = uint32(block.timestamp); + vm.expectEmit(true, true, true, true, address(verifier)); + emit TableUpdated(defaultOperatorSet, referenceTimestamp, operators); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); // Verify storage updates - assertEq(verifier.latestReferenceTimestamp(testOperatorSet), referenceTimestamp, "Reference timestamp not updated correctly"); - assertEq(verifier.getOperatorSetOwner(testOperatorSet), operatorSetOwner, "Operator set owner not stored correctly"); - assertEq(verifier.maxOperatorTableStaleness(testOperatorSet), maxStaleness, "Max staleness not stored correctly"); + assertEq(verifier.latestReferenceTimestamp(defaultOperatorSet), referenceTimestamp, "Reference timestamp mismatch"); + assertEq(verifier.getOperatorSetOwner(defaultOperatorSet), operatorSetOwner, "Operator set owner mismatch"); + assertEq(verifier.maxOperatorTableStaleness(defaultOperatorSet), defaultMaxStaleness, "Max staleness mismatch"); // Verify operator infos were stored correctly IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory storedOperators = - verifier.getOperatorInfos(testOperatorSet, referenceTimestamp); + verifier.getOperatorInfos(defaultOperatorSet, referenceTimestamp); - assertEq(storedOperators.length, operators.length, "Number of operators not stored correctly"); + assertEq(storedOperators.length, operators.length, "Number of operators mismatch"); for (uint i = 0; i < operators.length; i++) { - assertEq(storedOperators[i].pubkey, operators[i].pubkey, "Operator pubkey not stored correctly"); - assertEq(storedOperators[i].weights[0], operators[i].weights[0], "Operator weight 0 not stored correctly"); - assertEq(storedOperators[i].weights[1], operators[i].weights[1], "Operator weight 1 not stored correctly"); + assertEq(storedOperators[i].pubkey, operators[i].pubkey, "Operator pubkey mismatch"); + assertEq(storedOperators[i].weights[0], operators[i].weights[0], "Operator weight 0 mismatch"); + assertEq(storedOperators[i].weights[1], operators[i].weights[1], "Operator weight 1 mismatch"); } } - // Test verifyCertificate with actual ECDSA signature validation - function testVerifyCertificate() public { + function test_multiple() public { + // Create two different operator sets + OperatorSet memory operatorSet1 = OperatorSet({avs: address(0x10), id: 1}); + OperatorSet memory operatorSet2 = OperatorSet({avs: address(0x20), id: 2}); + uint32 referenceTimestamp = uint32(block.timestamp); - // Create operators - 3 signers, 1 non-signer - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); + // Create operators for each set + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators1,,) = _createOperatorsWithSplitKeys(111, 3, 1); + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators2,,) = _createOperatorsWithSplitKeys(222, 2, 2); - // Create operator set config - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); + // Create operator set configs with different owners + ICrossChainRegistryTypes.OperatorSetConfig memory config1 = ICrossChainRegistryTypes.OperatorSetConfig({ + owner: address(0x100), + maxStalenessPeriod: 1800 // 30 minutes + }); + ICrossChainRegistryTypes.OperatorSetConfig memory config2 = ICrossChainRegistryTypes.OperatorSetConfig({ + owner: address(0x200), + maxStalenessPeriod: 7200 // 2 hours + }); - vm.prank(tableUpdater); - verifier.updateOperatorTable(testOperatorSet, referenceTimestamp, operators, operatorSetConfig); + vm.startPrank(address(operatorTableUpdaterMock)); + + // Update both operator tables + verifier.updateOperatorTable(operatorSet1, referenceTimestamp, operators1, config1); + verifier.updateOperatorTable(operatorSet2, referenceTimestamp, operators2, config2); + + vm.stopPrank(); + + // Verify that both operator sets are stored correctly and independently + assertEq(verifier.getOperatorSetOwner(operatorSet1), address(0x100), "OperatorSet1 owner incorrect"); + assertEq(verifier.getOperatorSetOwner(operatorSet2), address(0x200), "OperatorSet2 owner incorrect"); + + assertEq(verifier.maxOperatorTableStaleness(operatorSet1), 1800, "OperatorSet1 staleness incorrect"); + assertEq(verifier.maxOperatorTableStaleness(operatorSet2), 7200, "OperatorSet2 staleness incorrect"); + } +} + +/** + * @title ECDSACertificateVerifierUnitTests_verifyCertificate + * @notice Unit tests for ECDSACertificateVerifier.verifyCertificate + */ +contract ECDSACertificateVerifierUnitTests_verifyCertificate is ECDSACertificateVerifierUnitTests { + function test_revert_certificateStale() public { + uint32 referenceTimestamp = _initializeOperatorTableBase(); + IECDSACertificateVerifierTypes.ECDSACertificate memory cert; + cert.referenceTimestamp = referenceTimestamp; + + // Jump forward in time beyond the max staleness + vm.warp(block.timestamp + defaultMaxStaleness + 1); + + vm.expectRevert(CertificateStale.selector); + verifier.verifyCertificate(defaultOperatorSet, cert); + } + + function test_revert_referenceTimestampDoesNotExist() public { + uint32 referenceTimestamp = _initializeOperatorTableBase(); + uint32 nonExistentTimestamp = referenceTimestamp + 1000; + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert; + cert.referenceTimestamp = nonExistentTimestamp; + + vm.expectRevert(ReferenceTimestampDoesNotExist.selector); + verifier.verifyCertificate(defaultOperatorSet, cert); + } + + function test_revert_invalidSignature() public { + // Update operator table + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _createOperatorsWithSplitKeys(123, 3, 1); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, uint32(block.timestamp), operators, defaultOperatorSetConfig); + + // Create a certificate with signatures for the original message hash + bytes32 originalHash = defaultMsgHash; + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(uint32(block.timestamp), originalHash, nonSignerIndices, operators, signerPrivKeys); + + // Modify the certificate to use a different message hash + cert.messageHash = keccak256("different message"); + + // Verification should fail + vm.expectRevert(VerificationFailed.selector); + verifier.verifyCertificate(defaultOperatorSet, cert); + } + + function testFuzz_verifyCertificate_allSigners(Randomness r) public rand(r) { + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numOperators, 0); + + // Create certificate with no non-signers + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); + + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); + + // Calculate total stakes + uint[] memory totalStakes = new uint[](2); + for (uint i = 0; i < operators.length; i++) { + totalStakes[0] += operators[i].weights[0]; + totalStakes[1] += operators[i].weights[1]; + } + + // All stakes should be signed + assertEq(signedStakes[0], totalStakes[0], "All stake should be signed for type 0"); + assertEq(signedStakes[1], totalStakes[1], "All stake should be signed for type 1"); + } + + function testFuzz_verifyCertificate_someNonSigners(Randomness r) public rand(r) { + // Create operators and update operator table + uint numSigners = r.Uint256(1, numOperators - 1); + uint numNonSigners = numOperators - numSigners; + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numSigners, numNonSigners); - // Create certificate with real ECDSA signatures IECDSACertificateVerifierTypes.ECDSACertificate memory cert = - createCertificate(referenceTimestamp, msgHash, nonSigners, operators, signerPrivKeys); + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); - uint[] memory signedStakes = verifier.verifyCertificate(testOperatorSet, cert); + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); // Check that the signed stakes are correct assertEq(signedStakes.length, 2, "Wrong number of stake types"); // Calculate expected signed stakes uint[] memory expectedSignedStakes = new uint[](2); - - // Start with total stakes for (uint i = 0; i < operators.length; i++) { expectedSignedStakes[0] += operators[i].weights[0]; expectedSignedStakes[1] += operators[i].weights[1]; } // Subtract non-signer stakes - for (uint i = 0; i < nonSigners.length; i++) { - for (uint j = 0; j < operators.length; j++) { - if (operators[j].pubkey == nonSigners[i]) { - expectedSignedStakes[0] -= operators[j].weights[0]; - expectedSignedStakes[1] -= operators[j].weights[1]; - break; - } - } + for (uint i = 0; i < nonSignerIndices.length; i++) { + uint32 nonSignerIndex = nonSignerIndices[i]; + expectedSignedStakes[0] -= operators[nonSignerIndex].weights[0]; + expectedSignedStakes[1] -= operators[nonSignerIndex].weights[1]; + } + + assertEq(signedStakes[0], expectedSignedStakes[0], "Wrong signed stake for type 0"); + assertEq(signedStakes[1], expectedSignedStakes[1], "Wrong signed stake for type 1"); + } + + function test_updateStalenessAndVerify() public { + // Initial setup with default staleness (3600) + uint32 firstTimestamp = uint32(block.timestamp); + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _createOperatorsWithSplitKeys(123, 4, 0); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, firstTimestamp, operators, defaultOperatorSetConfig); + + // Warp past the staleness period (3601 seconds) + vm.warp(block.timestamp + 3601); + + // Update table again with new staleness period (7200) and new owner + uint32 secondTimestamp = uint32(block.timestamp); + ICrossChainRegistryTypes.OperatorSetConfig memory newConfig = ICrossChainRegistryTypes.OperatorSetConfig({ + owner: address(0x999), + maxStalenessPeriod: 7200 // 2 hours + }); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, secondTimestamp, operators, newConfig); + + // Warp past old staleness period (3601) but within new staleness period + vm.warp(block.timestamp + 3601); + + // Create and verify certificate - should succeed with new staleness period + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(secondTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); + + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); + + // Verify all stakes are signed + uint[] memory totalStakes = new uint[](2); + for (uint i = 0; i < operators.length; i++) { + totalStakes[0] += operators[i].weights[0]; + totalStakes[1] += operators[i].weights[1]; + } + assertEq(signedStakes[0], totalStakes[0], "All stake should be signed for type 0"); + assertEq(signedStakes[1], totalStakes[1], "All stake should be signed for type 1"); + + // Verify the new config is applied + assertEq(verifier.maxOperatorTableStaleness(defaultOperatorSet), 7200, "New staleness period not applied"); + assertEq(verifier.getOperatorSetOwner(defaultOperatorSet), address(0x999), "New owner not applied"); + } + + function test_updateOperatorsAndVerify() public { + // First update with initial operators + uint32 firstTimestamp = uint32(block.timestamp); + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory firstOperators,,) = _createOperatorsWithSplitKeys(123, 3, 1); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, firstTimestamp, firstOperators, defaultOperatorSetConfig); + + // Advance time and update with new operators + vm.warp(block.timestamp + 100); + uint32 secondTimestamp = uint32(block.timestamp); + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory secondOperators, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _createOperatorsWithSplitKeys(456, 2, 2); // Different seed for different operators + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, secondTimestamp, secondOperators, defaultOperatorSetConfig); + + // Create certificate with new operators + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(secondTimestamp, defaultMsgHash, nonSignerIndices, secondOperators, signerPrivKeys); + + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); + + // Verify only signers' stakes are counted + uint[] memory expectedSignedStakes = new uint[](2); + // First 2 operators are signers + for (uint i = 0; i < 2; i++) { + expectedSignedStakes[0] += secondOperators[i].weights[0]; + expectedSignedStakes[1] += secondOperators[i].weights[1]; } assertEq(signedStakes[0], expectedSignedStakes[0], "Wrong signed stake for type 0"); assertEq(signedStakes[1], expectedSignedStakes[1], "Wrong signed stake for type 1"); + + // Verify the latest timestamp is updated + assertEq(verifier.latestReferenceTimestamp(defaultOperatorSet), secondTimestamp, "Latest timestamp not updated"); + + // Verify new operators are stored + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory storedOperators = + verifier.getOperatorInfos(defaultOperatorSet, secondTimestamp); + assertEq(storedOperators.length, secondOperators.length, "Operator count mismatch"); + for (uint i = 0; i < secondOperators.length; i++) { + assertEq(storedOperators[i].pubkey, secondOperators[i].pubkey, "Operator pubkey mismatch"); + } + } + + function test_revert_signerNotOperator() public { + // Create operators and update the table + uint32 referenceTimestamp = uint32(block.timestamp); + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators,,) = _createOperatorsWithSplitKeys(123, 4, 0); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); + + // Create a private key for a non-operator signer + uint nonOperatorPrivKey = uint(keccak256(abi.encodePacked("nonOperator", block.timestamp))); + if (nonOperatorPrivKey == 0) nonOperatorPrivKey = 1; + + // Create certificate with the non-operator as a signer + bytes32 signableDigest = verifier.calculateCertificateDigest(referenceTimestamp, defaultMsgHash); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign(nonOperatorPrivKey, signableDigest); + bytes memory signature = abi.encodePacked(r, s, v); + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = IECDSACertificateVerifierTypes.ECDSACertificate({ + referenceTimestamp: referenceTimestamp, + messageHash: defaultMsgHash, + sig: signature + }); + + // Should revert because the signer is not an operator + vm.expectRevert(VerificationFailed.selector); + verifier.verifyCertificate(defaultOperatorSet, cert); } - // Test verifyCertificateProportion - function testVerifyCertificateProportion() public { + function test_revert_signaturesNotOrdered() public { + // Create operators with at least 2 signers uint32 referenceTimestamp = uint32(block.timestamp); + uint[] memory signerPrivKeys = new uint[](2); + + // Create two private keys where the first address is greater than the second + signerPrivKeys[0] = uint(keccak256(abi.encodePacked("signer1"))); + signerPrivKeys[1] = uint(keccak256(abi.encodePacked("signer2"))); + + // Ensure valid private keys + if (signerPrivKeys[0] == 0) signerPrivKeys[0] = 1; + if (signerPrivKeys[1] == 0) signerPrivKeys[1] = 1; + + // Make sure addr0 > addr1 by adjusting keys if needed + address addr0 = vm.addr(signerPrivKeys[0]); + address addr1 = vm.addr(signerPrivKeys[1]); + + // If addr0 < addr1, swap the keys to ensure we get the wrong order + if (addr0 < addr1) { + uint temp = signerPrivKeys[0]; + signerPrivKeys[0] = signerPrivKeys[1]; + signerPrivKeys[1] = temp; + addr0 = vm.addr(signerPrivKeys[0]); + addr1 = vm.addr(signerPrivKeys[1]); + } + + // Create operators with these addresses + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators = new IECDSACertificateVerifierTypes.ECDSAOperatorInfo[](2); + + operators[0].pubkey = addr0; + operators[0].weights = new uint[](2); + operators[0].weights[0] = 100; + operators[0].weights[1] = 200; + + operators[1].pubkey = addr1; + operators[1].weights = new uint[](2); + operators[1].weights[0] = 100; + operators[1].weights[1] = 200; + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); + + // Create signatures in the WRONG order (higher address first) + bytes32 signableDigest = verifier.calculateCertificateDigest(referenceTimestamp, defaultMsgHash); + + // Sign with both keys but put them in wrong order (addr0 > addr1) + (uint8 v0, bytes32 r0, bytes32 s0) = vm.sign(signerPrivKeys[0], signableDigest); + (uint8 v1, bytes32 r1, bytes32 s1) = vm.sign(signerPrivKeys[1], signableDigest); + + // Concatenate signatures in wrong order (higher address first) + bytes memory signatures = bytes.concat(abi.encodePacked(r0, s0, v0), abi.encodePacked(r1, s1, v1)); + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = IECDSACertificateVerifierTypes.ECDSACertificate({ + referenceTimestamp: referenceTimestamp, + messageHash: defaultMsgHash, + sig: signatures + }); + + // Should revert because signatures are not ordered by address + vm.expectRevert(VerificationFailed.selector); + verifier.verifyCertificate(defaultOperatorSet, cert); + } + + function test_revert_invalidSignatureRecoveryError() public { + // Create operators and update the table + uint32 referenceTimestamp = uint32(block.timestamp); + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators,,) = _createOperatorsWithSplitKeys(123, 4, 0); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); + + // Create an invalid signature with invalid s value (too large) + // This will cause ECDSA.tryRecover to return RecoverError.InvalidSignatureS + bytes memory invalidSignature = new bytes(65); + // Set r to a valid value + bytes32 r = bytes32(uint(0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef)); + // Set s to a value that's too large (> N/2) + bytes32 s = bytes32(uint(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)); + uint8 v = 27; + + // Pack the signature + for (uint i = 0; i < 32; i++) { + invalidSignature[i] = r[i]; + invalidSignature[i + 32] = s[i]; + } + invalidSignature[64] = bytes1(v); + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = IECDSACertificateVerifierTypes.ECDSACertificate({ + referenceTimestamp: referenceTimestamp, + messageHash: defaultMsgHash, + sig: invalidSignature + }); + + // Should revert because signature recovery returns an error + vm.expectRevert(VerificationFailed.selector); + verifier.verifyCertificate(defaultOperatorSet, cert); + } + + function test_revert_recoveredAddressZero() public { + // Create operators and update the table + uint32 referenceTimestamp = uint32(block.timestamp); + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators,,) = _createOperatorsWithSplitKeys(123, 4, 0); + + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); + + // Create a signature that will recover to address(0) + // This happens when v, r, s are valid but don't correspond to any valid signature + bytes memory zeroRecoverySignature = new bytes(65); + + // These specific values will cause ecrecover to return address(0) + // while still being within valid ranges + bytes32 r = bytes32(uint(1)); + bytes32 s = bytes32(uint(1)); + uint8 v = 27; + + // Pack the signature + for (uint i = 0; i < 32; i++) { + zeroRecoverySignature[i] = r[i]; + zeroRecoverySignature[i + 32] = s[i]; + } + zeroRecoverySignature[64] = bytes1(v); - // Create operators - 3 signers, 1 non-signer - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = IECDSACertificateVerifierTypes.ECDSACertificate({ + referenceTimestamp: referenceTimestamp, + messageHash: defaultMsgHash, + sig: zeroRecoverySignature + }); - // Create operator set config - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); + // Should revert because recovered address is zero + vm.expectRevert(VerificationFailed.selector); + verifier.verifyCertificate(defaultOperatorSet, cert); + } +} - vm.prank(tableUpdater); - verifier.updateOperatorTable(testOperatorSet, referenceTimestamp, operators, operatorSetConfig); +/** + * @title ECDSACertificateVerifierUnitTests_verifyCertificateProportion + * @notice Unit tests for ECDSACertificateVerifier.verifyCertificateProportion + */ +contract ECDSACertificateVerifierUnitTests_verifyCertificateProportion is ECDSACertificateVerifierUnitTests { + function testFuzz_revert_arrayLengthMismatch(Randomness r) public rand(r) { + // Update operator table + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numOperators, 0); - // Create certificate with real ECDSA signatures IECDSACertificateVerifierTypes.ECDSACertificate memory cert = - createCertificate(referenceTimestamp, msgHash, nonSigners, operators, signerPrivKeys); + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); + + // Set thresholds with wrong length + uint16[] memory wrongLengthThresholds = new uint16[](1); // Should be 2 + wrongLengthThresholds[0] = 6000; + + vm.expectRevert(ArrayLengthMismatch.selector); + verifier.verifyCertificateProportion(defaultOperatorSet, cert, wrongLengthThresholds); + } + + function testFuzz_verifyCertificateProportion_meetsThresholds(Randomness r) public rand(r) { + // Update operator table + uint numSigners = r.Uint256(1, numOperators - 1); + uint numNonSigners = numOperators - numSigners; + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numSigners, numNonSigners); + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); // Set thresholds at 60% of total stake for each type uint16[] memory thresholds = new uint16[](2); thresholds[0] = 6000; // 60% thresholds[1] = 6000; // 60% - // Verify certificate meets thresholds - bool meetsThresholds = verifier.verifyCertificateProportion(testOperatorSet, cert, thresholds); + bool meetsThresholds = verifier.verifyCertificateProportion(defaultOperatorSet, cert, thresholds); - // With 3 signers out of 4, should meet 60% threshold - assertTrue(meetsThresholds, "Certificate should meet thresholds"); + // Calculate expected result based on the number of signers + uint signedPercentage = (numSigners * 10_000) / numOperators; + bool expectedResult = signedPercentage >= 6000; + + assertEq(meetsThresholds, expectedResult, "Certificate threshold check incorrect"); + } + + function testFuzz_verifyCertificateProportion_doesNotMeetThresholds(Randomness r) public rand(r) { + // Update operator table with a specific split to ensure some thresholds won't be met + uint numSigners = r.Uint256(1, numOperators / 2); // At most half signers + uint numNonSigners = numOperators - numSigners; + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numSigners, numNonSigners); + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); // Try with higher threshold that shouldn't be met + uint16[] memory thresholds = new uint16[](2); thresholds[0] = 9000; // 90% thresholds[1] = 9000; // 90% - meetsThresholds = verifier.verifyCertificateProportion(testOperatorSet, cert, thresholds); + bool meetsThresholds = verifier.verifyCertificateProportion(defaultOperatorSet, cert, thresholds); // Calculate percentage of signed stakes to determine if it should meet threshold - uint[] memory signedStakes = verifier.verifyCertificate(testOperatorSet, cert); - uint totalStake0 = 0; - uint totalStake1 = 0; - for (uint i = 0; i < operators.length; i++) { - totalStake0 += operators[i].weights[0]; - totalStake1 += operators[i].weights[1]; - } - uint signedPercentage0 = (signedStakes[0] * 10_000) / totalStake0; - uint signedPercentage1 = (signedStakes[1] * 10_000) / totalStake1; + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); + uint[] memory totalStakes = verifier.getTotalStakes(defaultOperatorSet, referenceTimestamp); + uint signedPercentage0 = (signedStakes[0] * 10_000) / totalStakes[0]; + uint signedPercentage1 = (signedStakes[1] * 10_000) / totalStakes[1]; bool shouldMeetThreshold = (signedPercentage0 >= 9000) && (signedPercentage1 >= 9000); assertEq(meetsThresholds, shouldMeetThreshold, "Certificate threshold check incorrect"); } - // Test verifyCertificateNominal - function testVerifyCertificateNominal() public { - uint32 referenceTimestamp = uint32(block.timestamp); + /// @notice Fuzz against random thresholds + function testFuzz_verifyCertificateProportion_thresholds(Randomness r, uint16 threshold0, uint16 threshold1) public rand(r) { + // Update operator table with random split + uint numSigners = r.Uint256(1, numOperators); + uint numNonSigners = numOperators - numSigners; + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numSigners, numNonSigners); + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); + + threshold0 = uint16(bound(threshold0, 0, 10_000)); // 0% to 100% + threshold1 = uint16(bound(threshold1, 0, 10_000)); // 0% to 100% + + uint16[] memory thresholds = new uint16[](2); + thresholds[0] = threshold0; + thresholds[1] = threshold1; + + bool meetsThresholds = verifier.verifyCertificateProportion(defaultOperatorSet, cert, thresholds); - // Create operators - 3 signers, 1 non-signer - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); + // Calculate expected result + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); + uint[] memory totalStakes = verifier.getTotalStakes(defaultOperatorSet, referenceTimestamp); - // Create operator set config - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); + bool expectedResult = true; + for (uint i = 0; i < 2; i++) { + uint threshold = (totalStakes[i] * thresholds[i]) / 10_000; + if (signedStakes[i] < threshold) { + expectedResult = false; + break; + } + } - vm.prank(tableUpdater); - verifier.updateOperatorTable(testOperatorSet, referenceTimestamp, operators, operatorSetConfig); + assertEq(meetsThresholds, expectedResult, "Threshold calculation mismatch"); + } +} + +/** + * @title ECDSACertificateVerifierUnitTests_verifyCertificateNominal + * @notice Unit tests for ECDSACertificateVerifier.verifyCertificateNominal + */ +contract ECDSACertificateVerifierUnitTests_verifyCertificateNominal is ECDSACertificateVerifierUnitTests { + function testFuzz_revert_arrayLengthMismatch(Randomness r) public rand(r) { + // Update operator table + uint numSigners = r.Uint256(1, numOperators - 1); + uint numNonSigners = numOperators - numSigners; + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numSigners, numNonSigners); - // Create certificate with real ECDSA signatures IECDSACertificateVerifierTypes.ECDSACertificate memory cert = - createCertificate(referenceTimestamp, msgHash, nonSigners, operators, signerPrivKeys); + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); - // Get the signed stakes first - uint[] memory signedStakes = verifier.verifyCertificate(testOperatorSet, cert); + // Set thresholds with wrong length + uint[] memory wrongLengthThresholds = new uint[](1); // Should be 2 + wrongLengthThresholds[0] = 100; + + vm.expectRevert(ArrayLengthMismatch.selector); + verifier.verifyCertificateNominal(defaultOperatorSet, cert, wrongLengthThresholds); + } + + function testFuzz_verifyCertificateNominal_meetsThresholds(Randomness r) public rand(r) { + // Update operator table + uint numSigners = r.Uint256(1, numOperators); + uint numNonSigners = numOperators - numSigners; + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numSigners, numNonSigners); + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); + + // Get the signed stakes for reference + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); // Test with thresholds lower than signed stakes (should pass) uint[] memory passThresholds = new uint[](2); - passThresholds[0] = signedStakes[0] - 10; - passThresholds[1] = signedStakes[1] - 10; + passThresholds[0] = signedStakes[0] > 10 ? signedStakes[0] - 10 : 0; + passThresholds[1] = signedStakes[1] > 10 ? signedStakes[1] - 10 : 0; - bool meetsThresholds = verifier.verifyCertificateNominal(testOperatorSet, cert, passThresholds); + bool meetsThresholds = verifier.verifyCertificateNominal(defaultOperatorSet, cert, passThresholds); assertTrue(meetsThresholds, "Certificate should meet nominal thresholds"); + } + + function testFuzz_verifyCertificateNominal_doesNotMeetThresholds(Randomness r) public rand(r) { + // Update operator table + uint numSigners = r.Uint256(1, numOperators - 1); // Ensure at least one non-signer + uint numNonSigners = numOperators - numSigners; + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numSigners, numNonSigners); + + IECDSACertificateVerifierTypes.ECDSACertificate memory cert = + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); + + // Get the signed stakes for reference + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); // Test with thresholds higher than signed stakes (should fail) uint[] memory failThresholds = new uint[](2); failThresholds[0] = signedStakes[0] + 10; failThresholds[1] = signedStakes[1] + 10; - meetsThresholds = verifier.verifyCertificateNominal(testOperatorSet, cert, failThresholds); + bool meetsThresholds = verifier.verifyCertificateNominal(defaultOperatorSet, cert, failThresholds); assertFalse(meetsThresholds, "Certificate should not meet impossible nominal thresholds"); } - // Test with invalid signature (wrong message hash) - function testVerifyCertificateInvalidSignature() public { - uint32 referenceTimestamp = uint32(block.timestamp); + /// @notice Fuzz against random thresholds + function testFuzz_verifyCertificateNominal_thresholds(Randomness r, uint threshold0, uint threshold1) public rand(r) { + // Update operator table + uint numSigners = r.Uint256(1, numOperators); + uint numNonSigners = numOperators - numSigners; + ( + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, + ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig, + uint32 referenceTimestamp, + uint32[] memory nonSignerIndices, + uint[] memory signerPrivKeys + ) = _updateOperatorTable(r, numSigners, numNonSigners); - // Create operators - 3 signers, 1 non-signer - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); - - // Create operator set config - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); - - vm.prank(tableUpdater); - verifier.updateOperatorTable(testOperatorSet, referenceTimestamp, operators, operatorSetConfig); - - // Create a certificate with signatures for the original message hash - bytes32 originalHash = msgHash; IECDSACertificateVerifierTypes.ECDSACertificate memory cert = - createCertificate(referenceTimestamp, originalHash, nonSigners, operators, signerPrivKeys); + _createCertificate(referenceTimestamp, defaultMsgHash, nonSignerIndices, operators, signerPrivKeys); - // Now modify the certificate to use a different message hash - // This should make the signatures invalid since they were created for originalHash - bytes32 differentHash = keccak256("different message"); - cert.messageHash = differentHash; + // Get the signed stakes for reference + uint[] memory signedStakes = verifier.verifyCertificate(defaultOperatorSet, cert); - // Verification should fail because the signatures were created for originalHash - // but we're trying to verify them against differentHash - vm.expectRevert(abi.encodeWithSignature("VerificationFailed()")); - verifier.verifyCertificate(testOperatorSet, cert); - } + // Bound thresholds to reasonable values + threshold0 = bound(threshold0, 0, signedStakes[0] * 2); + threshold1 = bound(threshold1, 0, signedStakes[1] * 2); - // Test certificate with stale timestamp (should fail) - function testVerifyCertificateStaleTimestamp() public { - uint32 referenceTimestamp = uint32(block.timestamp); - - // Create operators - 3 signers, 1 non-signer - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); + uint[] memory thresholds = new uint[](2); + thresholds[0] = threshold0; + thresholds[1] = threshold1; - // Create operator set config - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); + bool meetsThresholds = verifier.verifyCertificateNominal(defaultOperatorSet, cert, thresholds); - vm.prank(tableUpdater); - verifier.updateOperatorTable(testOperatorSet, referenceTimestamp, operators, operatorSetConfig); - - // Create certificate with real ECDSA signatures - IECDSACertificateVerifierTypes.ECDSACertificate memory cert = - createCertificate(referenceTimestamp, msgHash, nonSigners, operators, signerPrivKeys); + // Expected result + bool expectedResult = (signedStakes[0] >= threshold0) && (signedStakes[1] >= threshold1); - // Jump forward in time beyond the max staleness - vm.warp(block.timestamp + maxStaleness + 1); - - // Verification should fail due to staleness - vm.expectRevert(abi.encodeWithSignature("CertificateStale()")); - verifier.verifyCertificate(testOperatorSet, cert); + assertEq(meetsThresholds, expectedResult, "Nominal threshold check mismatch"); } +} - // Test with invalid reference timestamp - function testInvalidReferenceTimestamp() public { - uint32 existingReferenceTimestamp = uint32(block.timestamp); - uint32 nonExistentTimestamp = existingReferenceTimestamp + 1000; +/** + * @title ECDSACertificateVerifierUnitTests_ViewFunctions + * @notice Unit tests for ECDSACertificateVerifier view functions + */ +contract ECDSACertificateVerifierUnitTests_ViewFunctions is ECDSACertificateVerifierUnitTests { + uint32 referenceTimestamp; - // Create operators - 3 signers, 1 non-signer - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); + function setUp() public override { + super.setUp(); + referenceTimestamp = uint32(block.timestamp); - // Create operator set config - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators = _getOperators(); - vm.prank(tableUpdater); - verifier.updateOperatorTable(testOperatorSet, existingReferenceTimestamp, operators, operatorSetConfig); + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); + } - // Create certificate using a non-existent timestamp - IECDSACertificateVerifierTypes.ECDSACertificate memory cert = - createCertificate(nonExistentTimestamp, msgHash, nonSigners, operators, signerPrivKeys); + function _getOperators() internal view returns (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory) { + (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators,,) = _createOperatorsWithSplitKeys(123, 3, 1); + return operators; + } - // Verification should fail due to timestamp not existing - vm.expectRevert(abi.encodeWithSignature("ReferenceTimestampDoesNotExist()")); - verifier.verifyCertificate(testOperatorSet, cert); + function test_getOperatorSetOwner() public view { + address owner = verifier.getOperatorSetOwner(defaultOperatorSet); + assertEq(owner, operatorSetOwner, "Operator set owner mismatch"); } - // Test multiple operator sets - function testMultipleOperatorSets() public { - // Create two different operator sets - OperatorSet memory operatorSet1 = OperatorSet({avs: address(0x10), id: 1}); - OperatorSet memory operatorSet2 = OperatorSet({avs: address(0x20), id: 2}); + function test_maxOperatorTableStaleness() public view { + uint32 staleness = verifier.maxOperatorTableStaleness(defaultOperatorSet); + assertEq(staleness, defaultMaxStaleness, "Max staleness mismatch"); + } - uint32 referenceTimestamp = uint32(block.timestamp); + function test_latestReferenceTimestamp() public view { + uint32 timestamp = verifier.latestReferenceTimestamp(defaultOperatorSet); + assertEq(timestamp, referenceTimestamp, "Latest reference timestamp mismatch"); + } - // Create different operators for each set - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators1, address[] memory nonSigners1, uint[] memory signerPrivKeys1) - = createOperatorInfos(3, 1); + function test_getOperatorInfos() public view { + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory storedOperators = + verifier.getOperatorInfos(defaultOperatorSet, referenceTimestamp); - // Create second set of operators with different private keys - IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators2 = new IECDSACertificateVerifierTypes.ECDSAOperatorInfo[](4); - address[] memory nonSigners2 = new address[](2); - uint[] memory signerPrivKeys2 = new uint[](2); + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators = _getOperators(); - for (uint i = 0; i < 4; i++) { - uint privateKey = uint(keccak256(abi.encodePacked("set2_signer", i))); - address pubkey = vm.addr(privateKey); + assertEq(storedOperators.length, operators.length, "Number of operators mismatch"); + for (uint i = 0; i < operators.length; i++) { + assertEq(storedOperators[i].pubkey, operators[i].pubkey, "Operator pubkey mismatch"); + assertEq(storedOperators[i].weights.length, operators[i].weights.length, "Weights length mismatch"); + for (uint j = 0; j < operators[i].weights.length; j++) { + assertEq(storedOperators[i].weights[j], operators[i].weights[j], "Weight value mismatch"); + } + } + } - operators2[i].pubkey = pubkey; - operators2[i].weights = new uint[](2); - operators2[i].weights[0] = uint(100 + i * 10); - operators2[i].weights[1] = uint(200 + i * 20); + function test_getOperatorInfo() public view { + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators = _getOperators(); - if (i >= 2) signerPrivKeys2[i - 2] = privateKey; - else nonSigners2[i] = pubkey; - } + for (uint32 i = 0; i < operators.length; i++) { + IECDSACertificateVerifierTypes.ECDSAOperatorInfo memory operatorInfo = + verifier.getOperatorInfo(defaultOperatorSet, referenceTimestamp, i); - // Create operator set configs with different owners - ICrossChainRegistryTypes.OperatorSetConfig memory config1 = ICrossChainRegistryTypes.OperatorSetConfig({ - owner: address(0x100), - maxStalenessPeriod: 1800 // 30 minutes - }); - ICrossChainRegistryTypes.OperatorSetConfig memory config2 = ICrossChainRegistryTypes.OperatorSetConfig({ - owner: address(0x200), - maxStalenessPeriod: 7200 // 2 hours - }); + assertEq(operatorInfo.pubkey, operators[i].pubkey, "Operator pubkey mismatch"); + assertEq(operatorInfo.weights[0], operators[i].weights[0], "Weight 0 mismatch"); + assertEq(operatorInfo.weights[1], operators[i].weights[1], "Weight 1 mismatch"); + } + } - vm.startPrank(tableUpdater); + function test_getOperatorCount() public view { + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators = _getOperators(); - // Update both operator tables - verifier.updateOperatorTable(operatorSet1, referenceTimestamp, operators1, config1); - verifier.updateOperatorTable(operatorSet2, referenceTimestamp, operators2, config2); + uint32 operatorCount = verifier.getOperatorCount(defaultOperatorSet, referenceTimestamp); + assertEq(operatorCount, operators.length, "Operator count mismatch"); + } - vm.stopPrank(); + function test_getTotalStakes() public view { + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators = _getOperators(); + uint[] memory totalStakes = verifier.getTotalStakes(defaultOperatorSet, referenceTimestamp); - // Verify that both operator sets are stored correctly and independently - assertEq(verifier.getOperatorSetOwner(operatorSet1), address(0x100), "OperatorSet1 owner incorrect"); - assertEq(verifier.getOperatorSetOwner(operatorSet2), address(0x200), "OperatorSet2 owner incorrect"); + // Calculate expected total stakes + uint[] memory expectedTotalStakes = new uint[](2); + for (uint i = 0; i < operators.length; i++) { + expectedTotalStakes[0] += operators[i].weights[0]; + expectedTotalStakes[1] += operators[i].weights[1]; + } - assertEq(verifier.maxOperatorTableStaleness(operatorSet1), 1800, "OperatorSet1 staleness incorrect"); - assertEq(verifier.maxOperatorTableStaleness(operatorSet2), 7200, "OperatorSet2 staleness incorrect"); + assertEq(totalStakes[0], expectedTotalStakes[0], "Total stake 0 mismatch"); + assertEq(totalStakes[1], expectedTotalStakes[1], "Total stake 1 mismatch"); + } - assertEq(verifier.latestReferenceTimestamp(operatorSet1), referenceTimestamp, "OperatorSet1 timestamp incorrect"); - assertEq(verifier.latestReferenceTimestamp(operatorSet2), referenceTimestamp, "OperatorSet2 timestamp incorrect"); + function test_calculateCertificateDigest() public view { + bytes32 messageHash = keccak256("test"); + uint32 timestamp = uint32(block.timestamp); - // Verify operator infos are stored independently - IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory storedOps1 = verifier.getOperatorInfos(operatorSet1, referenceTimestamp); - IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory storedOps2 = verifier.getOperatorInfos(operatorSet2, referenceTimestamp); + bytes32 digest = verifier.calculateCertificateDigest(timestamp, messageHash); - assertEq(storedOps1.length, 4, "OperatorSet1 should have 4 operators"); - assertEq(storedOps2.length, 4, "OperatorSet2 should have 4 operators"); + // Verify digest is deterministic + bytes32 digest2 = verifier.calculateCertificateDigest(timestamp, messageHash); + assertEq(digest, digest2, "Digest should be deterministic"); - // Verify they have different operators - assertTrue(storedOps1[0].pubkey != storedOps2[0].pubkey, "Operators should be different"); + // Verify different inputs produce different digests + bytes32 differentDigest = verifier.calculateCertificateDigest(timestamp + 1, messageHash); + assertTrue(digest != differentDigest, "Different inputs should produce different digests"); } - // Test access control for operator table updates - function testOperatorTableUpdateAccessControl() public { - uint32 referenceTimestamp = uint32(block.timestamp); + function test_domainSeparator() public view { + bytes32 domainSep = verifier.domainSeparator(); - // Create operators - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); + // Verify domain separator is deterministic + assertTrue(domainSep != bytes32(0), "Domain separator should not be zero"); + } - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); + function test_revert_indexOutOfBounds() public { + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators = _getOperators(); - // Try to update with non-authorized account - vm.prank(nonOwner); - vm.expectRevert(abi.encodeWithSignature("OnlyTableUpdater()")); - verifier.updateOperatorTable(testOperatorSet, referenceTimestamp, operators, operatorSetConfig); + // Try to get operator info with out of bounds index + uint32 outOfBoundsIndex = uint32(operators.length); - // Should succeed with authorized account - vm.prank(tableUpdater); - verifier.updateOperatorTable(testOperatorSet, referenceTimestamp, operators, operatorSetConfig); + vm.expectRevert("Operator index out of bounds"); + verifier.getOperatorInfo(defaultOperatorSet, referenceTimestamp, outOfBoundsIndex); } - // Test stale table update (timestamp not increasing) - function testStaleTableUpdate() public { - uint32 firstTimestamp = uint32(block.timestamp); - uint32 staleTimestamp = firstTimestamp - 100; // Earlier timestamp - - // Create operators - (IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators, address[] memory nonSigners, uint[] memory signerPrivKeys) = - createOperatorInfos(3, 1); + function test_revert_referenceTimestampDoesNotExist() public { + uint32 nonExistentTimestamp = uint32(block.timestamp + 1000); - ICrossChainRegistryTypes.OperatorSetConfig memory operatorSetConfig = createOperatorSetConfig(); + vm.expectRevert(ReferenceTimestampDoesNotExist.selector); + verifier.getTotalStakes(defaultOperatorSet, nonExistentTimestamp); + } - vm.startPrank(tableUpdater); + function test_revert_noOperators() public { + uint32 referenceTimestamp = uint32(block.timestamp) + 1; - // First update should succeed - verifier.updateOperatorTable(testOperatorSet, firstTimestamp, operators, operatorSetConfig); + // Create empty operator array + IECDSACertificateVerifierTypes.ECDSAOperatorInfo[] memory operators = new IECDSACertificateVerifierTypes.ECDSAOperatorInfo[](0); - // Second update with earlier timestamp should fail - vm.expectRevert(abi.encodeWithSignature("TableUpdateStale()")); - verifier.updateOperatorTable(testOperatorSet, staleTimestamp, operators, operatorSetConfig); + vm.prank(address(operatorTableUpdaterMock)); + verifier.updateOperatorTable(defaultOperatorSet, referenceTimestamp, operators, defaultOperatorSetConfig); - vm.stopPrank(); + vm.expectRevert(ReferenceTimestampDoesNotExist.selector); + verifier.getTotalStakes(defaultOperatorSet, referenceTimestamp); } }