From 6f3bb41e10bbee3ee06124830cb32d31fbd10c6e Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Tue, 25 Mar 2025 05:04:43 +0800 Subject: [PATCH 01/11] feat: refactor precompiles --- core/vm/contracts.go | 276 +++++++++++++++------- core/vm/contracts_test.go | 3 +- core/vm/evm.go | 7 +- core/vm/precompiles/precompiles.go | 35 +++ internal/ethapi/api.go | 3 +- internal/ethapi/override/override.go | 3 +- internal/ethapi/override/override_test.go | 8 +- internal/ethapi/simulate.go | 3 +- 8 files changed, 246 insertions(+), 92 deletions(-) create mode 100644 core/vm/precompiles/precompiles.go diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 06849e65ad..2202fcca85 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -31,6 +31,7 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/tracing" + "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/blake2b" "github.com/ethereum/go-ethereum/crypto/bn256" @@ -39,103 +40,92 @@ import ( "golang.org/x/crypto/ripemd160" ) -// PrecompiledContract is the basic interface for native Go contracts. The implementation -// requires a deterministic gas count based on the input size of the Run method of the -// contract. -type PrecompiledContract interface { - RequiredGas(input []byte) uint64 // RequiredPrice calculates the contract gas use - Run(input []byte) ([]byte, error) // Run runs the precompiled contract -} - -// PrecompiledContracts contains the precompiled contracts supported at the given fork. -type PrecompiledContracts map[common.Address]PrecompiledContract - // PrecompiledContractsHomestead contains the default set of pre-compiled Ethereum // contracts used in the Frontier and Homestead releases. -var PrecompiledContractsHomestead = PrecompiledContracts{ - common.BytesToAddress([]byte{0x1}): &ecrecover{}, - common.BytesToAddress([]byte{0x2}): &sha256hash{}, - common.BytesToAddress([]byte{0x3}): &ripemd160hash{}, - common.BytesToAddress([]byte{0x4}): &dataCopy{}, -} +var PrecompiledContractsHomestead = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ + (&ecrecover{}).Address(): &ecrecover{}, + (&sha256hash{}).Address(): &sha256hash{}, + (&ripemd160hash{}).Address(): &ripemd160hash{}, + (&dataCopy{}).Address(): &dataCopy{}, +}) // PrecompiledContractsByzantium contains the default set of pre-compiled Ethereum // contracts used in the Byzantium release. -var PrecompiledContractsByzantium = PrecompiledContracts{ - common.BytesToAddress([]byte{0x1}): &ecrecover{}, - common.BytesToAddress([]byte{0x2}): &sha256hash{}, - common.BytesToAddress([]byte{0x3}): &ripemd160hash{}, - common.BytesToAddress([]byte{0x4}): &dataCopy{}, - common.BytesToAddress([]byte{0x5}): &bigModExp{eip2565: false}, - common.BytesToAddress([]byte{0x6}): &bn256AddByzantium{}, - common.BytesToAddress([]byte{0x7}): &bn256ScalarMulByzantium{}, - common.BytesToAddress([]byte{0x8}): &bn256PairingByzantium{}, -} +var PrecompiledContractsByzantium = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ + (&ecrecover{}).Address(): &ecrecover{}, + (&sha256hash{}).Address(): &sha256hash{}, + (&ripemd160hash{}).Address(): &ripemd160hash{}, + (&dataCopy{}).Address(): &dataCopy{}, + (&bigModExp{eip2565: false}).Address(): &bigModExp{eip2565: false}, + (&bn256AddByzantium{}).Address(): &bn256AddByzantium{}, + (&bn256ScalarMulByzantium{}).Address(): &bn256ScalarMulByzantium{}, + (&bn256PairingByzantium{}).Address(): &bn256PairingByzantium{}, +}) // PrecompiledContractsIstanbul contains the default set of pre-compiled Ethereum // contracts used in the Istanbul release. -var PrecompiledContractsIstanbul = PrecompiledContracts{ - common.BytesToAddress([]byte{0x1}): &ecrecover{}, - common.BytesToAddress([]byte{0x2}): &sha256hash{}, - common.BytesToAddress([]byte{0x3}): &ripemd160hash{}, - common.BytesToAddress([]byte{0x4}): &dataCopy{}, - common.BytesToAddress([]byte{0x5}): &bigModExp{eip2565: false}, - common.BytesToAddress([]byte{0x6}): &bn256AddIstanbul{}, - common.BytesToAddress([]byte{0x7}): &bn256ScalarMulIstanbul{}, - common.BytesToAddress([]byte{0x8}): &bn256PairingIstanbul{}, - common.BytesToAddress([]byte{0x9}): &blake2F{}, -} +var PrecompiledContractsIstanbul = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ + (&ecrecover{}).Address(): &ecrecover{}, + (&sha256hash{}).Address(): &sha256hash{}, + (&ripemd160hash{}).Address(): &ripemd160hash{}, + (&dataCopy{}).Address(): &dataCopy{}, + (&bigModExp{eip2565: false}).Address(): &bigModExp{eip2565: false}, + (&bn256AddIstanbul{}).Address(): &bn256AddIstanbul{}, + (&bn256ScalarMulIstanbul{}).Address(): &bn256ScalarMulIstanbul{}, + (&bn256PairingIstanbul{}).Address(): &bn256PairingIstanbul{}, + (&blake2F{}).Address(): &blake2F{}, +}) // PrecompiledContractsBerlin contains the default set of pre-compiled Ethereum // contracts used in the Berlin release. -var PrecompiledContractsBerlin = PrecompiledContracts{ - common.BytesToAddress([]byte{0x1}): &ecrecover{}, - common.BytesToAddress([]byte{0x2}): &sha256hash{}, - common.BytesToAddress([]byte{0x3}): &ripemd160hash{}, - common.BytesToAddress([]byte{0x4}): &dataCopy{}, - common.BytesToAddress([]byte{0x5}): &bigModExp{eip2565: true}, - common.BytesToAddress([]byte{0x6}): &bn256AddIstanbul{}, - common.BytesToAddress([]byte{0x7}): &bn256ScalarMulIstanbul{}, - common.BytesToAddress([]byte{0x8}): &bn256PairingIstanbul{}, - common.BytesToAddress([]byte{0x9}): &blake2F{}, -} +var PrecompiledContractsBerlin = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ + (&ecrecover{}).Address(): &ecrecover{}, + (&sha256hash{}).Address(): &sha256hash{}, + (&ripemd160hash{}).Address(): &ripemd160hash{}, + (&dataCopy{}).Address(): &dataCopy{}, + (&bigModExp{eip2565: true}).Address(): &bigModExp{eip2565: true}, + (&bn256AddIstanbul{}).Address(): &bn256AddIstanbul{}, + (&bn256ScalarMulIstanbul{}).Address(): &bn256ScalarMulIstanbul{}, + (&bn256PairingIstanbul{}).Address(): &bn256PairingIstanbul{}, + (&blake2F{}).Address(): &blake2F{}, +}) // PrecompiledContractsCancun contains the default set of pre-compiled Ethereum // contracts used in the Cancun release. -var PrecompiledContractsCancun = PrecompiledContracts{ - common.BytesToAddress([]byte{0x1}): &ecrecover{}, - common.BytesToAddress([]byte{0x2}): &sha256hash{}, - common.BytesToAddress([]byte{0x3}): &ripemd160hash{}, - common.BytesToAddress([]byte{0x4}): &dataCopy{}, - common.BytesToAddress([]byte{0x5}): &bigModExp{eip2565: true}, - common.BytesToAddress([]byte{0x6}): &bn256AddIstanbul{}, - common.BytesToAddress([]byte{0x7}): &bn256ScalarMulIstanbul{}, - common.BytesToAddress([]byte{0x8}): &bn256PairingIstanbul{}, - common.BytesToAddress([]byte{0x9}): &blake2F{}, - common.BytesToAddress([]byte{0xa}): &kzgPointEvaluation{}, -} +var PrecompiledContractsCancun = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ + (&ecrecover{}).Address(): &ecrecover{}, + (&sha256hash{}).Address(): &sha256hash{}, + (&ripemd160hash{}).Address(): &ripemd160hash{}, + (&dataCopy{}).Address(): &dataCopy{}, + (&bigModExp{eip2565: true}).Address(): &bigModExp{eip2565: true}, + (&bn256AddIstanbul{}).Address(): &bn256AddIstanbul{}, + (&bn256ScalarMulIstanbul{}).Address(): &bn256ScalarMulIstanbul{}, + (&bn256PairingIstanbul{}).Address(): &bn256PairingIstanbul{}, + (&blake2F{}).Address(): &blake2F{}, + (&kzgPointEvaluation{}).Address(): &kzgPointEvaluation{}, +}) // PrecompiledContractsPrague contains the set of pre-compiled Ethereum // contracts used in the Prague release. -var PrecompiledContractsPrague = PrecompiledContracts{ - common.BytesToAddress([]byte{0x01}): &ecrecover{}, - common.BytesToAddress([]byte{0x02}): &sha256hash{}, - common.BytesToAddress([]byte{0x03}): &ripemd160hash{}, - common.BytesToAddress([]byte{0x04}): &dataCopy{}, - common.BytesToAddress([]byte{0x05}): &bigModExp{eip2565: true}, - common.BytesToAddress([]byte{0x06}): &bn256AddIstanbul{}, - common.BytesToAddress([]byte{0x07}): &bn256ScalarMulIstanbul{}, - common.BytesToAddress([]byte{0x08}): &bn256PairingIstanbul{}, - common.BytesToAddress([]byte{0x09}): &blake2F{}, - common.BytesToAddress([]byte{0x0a}): &kzgPointEvaluation{}, - common.BytesToAddress([]byte{0x0b}): &bls12381G1Add{}, - common.BytesToAddress([]byte{0x0c}): &bls12381G1MultiExp{}, - common.BytesToAddress([]byte{0x0d}): &bls12381G2Add{}, - common.BytesToAddress([]byte{0x0e}): &bls12381G2MultiExp{}, - common.BytesToAddress([]byte{0x0f}): &bls12381Pairing{}, - common.BytesToAddress([]byte{0x10}): &bls12381MapG1{}, - common.BytesToAddress([]byte{0x11}): &bls12381MapG2{}, -} +var PrecompiledContractsPrague = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ + (&ecrecover{}).Address(): &ecrecover{}, + (&sha256hash{}).Address(): &sha256hash{}, + (&ripemd160hash{}).Address(): &ripemd160hash{}, + (&dataCopy{}).Address(): &dataCopy{}, + (&bigModExp{eip2565: true}).Address(): &bigModExp{eip2565: true}, + (&bn256AddIstanbul{}).Address(): &bn256AddIstanbul{}, + (&bn256ScalarMulIstanbul{}).Address(): &bn256ScalarMulIstanbul{}, + (&bn256PairingIstanbul{}).Address(): &bn256PairingIstanbul{}, + (&blake2F{}).Address(): &blake2F{}, + (&kzgPointEvaluation{}).Address(): &kzgPointEvaluation{}, + (&bls12381G1Add{}).Address(): &bls12381G1Add{}, + (&bls12381G1MultiExp{}).Address(): &bls12381G1MultiExp{}, + (&bls12381G2Add{}).Address(): &bls12381G2Add{}, + (&bls12381G2MultiExp{}).Address(): &bls12381G2MultiExp{}, + (&bls12381Pairing{}).Address(): &bls12381Pairing{}, + (&bls12381MapG1{}).Address(): &bls12381MapG1{}, + (&bls12381MapG2{}).Address(): &bls12381MapG2{}, +}) var PrecompiledContractsBLS = PrecompiledContractsPrague @@ -171,7 +161,7 @@ func init() { } } -func activePrecompiledContracts(rules params.Rules) PrecompiledContracts { +func activePrecompiledContracts(rules params.Rules) precompiles.PrecompiledContracts { switch { case rules.IsVerkle: return PrecompiledContractsVerkle @@ -191,7 +181,7 @@ func activePrecompiledContracts(rules params.Rules) PrecompiledContracts { } // ActivePrecompiledContracts returns a copy of precompiled contracts enabled with the current configuration. -func ActivePrecompiledContracts(rules params.Rules) PrecompiledContracts { +func ActivePrecompiledContracts(rules params.Rules) precompiles.PrecompiledContracts { return maps.Clone(activePrecompiledContracts(rules)) } @@ -218,7 +208,7 @@ func ActivePrecompiles(rules params.Rules) []common.Address { // - the returned bytes, // - the _remaining_ gas, // - any error that occurred -func RunPrecompiledContract(p PrecompiledContract, input []byte, suppliedGas uint64, logger *tracing.Hooks) (ret []byte, remainingGas uint64, err error) { +func RunPrecompiledContract(p precompiles.PrecompiledContract, input []byte, suppliedGas uint64, logger *tracing.Hooks) (ret []byte, remainingGas uint64, err error) { gasCost := p.RequiredGas(input) if suppliedGas < gasCost { return nil, 0, ErrOutOfGas @@ -234,6 +224,12 @@ func RunPrecompiledContract(p PrecompiledContract, input []byte, suppliedGas uin // ecrecover implemented as a native contract. type ecrecover struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*ecrecover) Address() common.Address { + return common.BytesToAddress([]byte{0x1}) +} + func (c *ecrecover) RequiredGas(input []byte) uint64 { return params.EcrecoverGas } @@ -272,6 +268,12 @@ func (c *ecrecover) Run(input []byte) ([]byte, error) { // SHA256 implemented as a native contract. type sha256hash struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*sha256hash) Address() common.Address { + return common.BytesToAddress([]byte{0x2}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. // // This method does not require any overflow checking as the input size gas costs @@ -287,6 +289,12 @@ func (c *sha256hash) Run(input []byte) ([]byte, error) { // RIPEMD160 implemented as a native contract. type ripemd160hash struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*ripemd160hash) Address() common.Address { + return common.BytesToAddress([]byte{0x3}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. // // This method does not require any overflow checking as the input size gas costs @@ -303,6 +311,12 @@ func (c *ripemd160hash) Run(input []byte) ([]byte, error) { // data copy implemented as a native contract. type dataCopy struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*dataCopy) Address() common.Address { + return common.BytesToAddress([]byte{0x4}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. // // This method does not require any overflow checking as the input size gas costs @@ -319,6 +333,12 @@ type bigModExp struct { eip2565 bool } +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bigModExp) Address() common.Address { + return common.BytesToAddress([]byte{0x5}) +} + var ( big1 = big.NewInt(1) big3 = big.NewInt(3) @@ -516,6 +536,12 @@ func runBn256Add(input []byte) ([]byte, error) { // Istanbul consensus rules. type bn256AddIstanbul struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bn256AddIstanbul) Address() common.Address { + return common.BytesToAddress([]byte{0x6}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bn256AddIstanbul) RequiredGas(input []byte) uint64 { return params.Bn256AddGasIstanbul @@ -529,6 +555,12 @@ func (c *bn256AddIstanbul) Run(input []byte) ([]byte, error) { // conforming to Byzantium consensus rules. type bn256AddByzantium struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bn256AddByzantium) Address() common.Address { + return common.BytesToAddress([]byte{0x6}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bn256AddByzantium) RequiredGas(input []byte) uint64 { return params.Bn256AddGasByzantium @@ -554,6 +586,12 @@ func runBn256ScalarMul(input []byte) ([]byte, error) { // multiplication conforming to Istanbul consensus rules. type bn256ScalarMulIstanbul struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bn256ScalarMulIstanbul) Address() common.Address { + return common.BytesToAddress([]byte{0x7}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bn256ScalarMulIstanbul) RequiredGas(input []byte) uint64 { return params.Bn256ScalarMulGasIstanbul @@ -567,6 +605,12 @@ func (c *bn256ScalarMulIstanbul) Run(input []byte) ([]byte, error) { // multiplication conforming to Byzantium consensus rules. type bn256ScalarMulByzantium struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bn256ScalarMulByzantium) Address() common.Address { + return common.BytesToAddress([]byte{0x7}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bn256ScalarMulByzantium) RequiredGas(input []byte) uint64 { return params.Bn256ScalarMulGasByzantium @@ -622,6 +666,12 @@ func runBn256Pairing(input []byte) ([]byte, error) { // conforming to Istanbul consensus rules. type bn256PairingIstanbul struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bn256PairingIstanbul) Address() common.Address { + return common.BytesToAddress([]byte{0x8}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bn256PairingIstanbul) RequiredGas(input []byte) uint64 { return params.Bn256PairingBaseGasIstanbul + uint64(len(input)/192)*params.Bn256PairingPerPointGasIstanbul @@ -635,6 +685,12 @@ func (c *bn256PairingIstanbul) Run(input []byte) ([]byte, error) { // conforming to Byzantium consensus rules. type bn256PairingByzantium struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bn256PairingByzantium) Address() common.Address { + return common.BytesToAddress([]byte{0x8}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bn256PairingByzantium) RequiredGas(input []byte) uint64 { return params.Bn256PairingBaseGasByzantium + uint64(len(input)/192)*params.Bn256PairingPerPointGasByzantium @@ -646,6 +702,12 @@ func (c *bn256PairingByzantium) Run(input []byte) ([]byte, error) { type blake2F struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*blake2F) Address() common.Address { + return common.BytesToAddress([]byte{0x9}) +} + func (c *blake2F) RequiredGas(input []byte) uint64 { // If the input is malformed, we can't calculate the gas, return 0 and let the // actual call choke and fault. @@ -715,6 +777,12 @@ var ( // bls12381G1Add implements EIP-2537 G1Add precompile. type bls12381G1Add struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bls12381G1Add) Address() common.Address { + return common.BytesToAddress([]byte{0x0b}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bls12381G1Add) RequiredGas(input []byte) uint64 { return params.Bls12381G1AddGas @@ -751,6 +819,12 @@ func (c *bls12381G1Add) Run(input []byte) ([]byte, error) { // bls12381G1MultiExp implements EIP-2537 G1MultiExp precompile. type bls12381G1MultiExp struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bls12381G1MultiExp) Address() common.Address { + return common.BytesToAddress([]byte{0x0c}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bls12381G1MultiExp) RequiredGas(input []byte) uint64 { // Calculate G1 point, scalar value pair length @@ -811,6 +885,12 @@ func (c *bls12381G1MultiExp) Run(input []byte) ([]byte, error) { // bls12381G2Add implements EIP-2537 G2Add precompile. type bls12381G2Add struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bls12381G2Add) Address() common.Address { + return common.BytesToAddress([]byte{0x0d}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bls12381G2Add) RequiredGas(input []byte) uint64 { return params.Bls12381G2AddGas @@ -848,6 +928,12 @@ func (c *bls12381G2Add) Run(input []byte) ([]byte, error) { // bls12381G2MultiExp implements EIP-2537 G2MultiExp precompile. type bls12381G2MultiExp struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bls12381G2MultiExp) Address() common.Address { + return common.BytesToAddress([]byte{0x0e}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bls12381G2MultiExp) RequiredGas(input []byte) uint64 { // Calculate G2 point, scalar value pair length @@ -908,6 +994,12 @@ func (c *bls12381G2MultiExp) Run(input []byte) ([]byte, error) { // bls12381Pairing implements EIP-2537 Pairing precompile. type bls12381Pairing struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bls12381Pairing) Address() common.Address { + return common.BytesToAddress([]byte{0x0f}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bls12381Pairing) RequiredGas(input []byte) uint64 { return params.Bls12381PairingBaseGas + uint64(len(input)/384)*params.Bls12381PairingPerPairGas @@ -1060,6 +1152,12 @@ func encodePointG2(p *bls12381.G2Affine) []byte { // bls12381MapG1 implements EIP-2537 MapG1 precompile. type bls12381MapG1 struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bls12381MapG1) Address() common.Address { + return common.BytesToAddress([]byte{0x10}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bls12381MapG1) RequiredGas(input []byte) uint64 { return params.Bls12381MapG1Gas @@ -1089,6 +1187,12 @@ func (c *bls12381MapG1) Run(input []byte) ([]byte, error) { // bls12381MapG2 implements EIP-2537 MapG2 precompile. type bls12381MapG2 struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*bls12381MapG2) Address() common.Address { + return common.BytesToAddress([]byte{0x11}) +} + // RequiredGas returns the gas required to execute the pre-compiled contract. func (c *bls12381MapG2) RequiredGas(input []byte) uint64 { return params.Bls12381MapG2Gas @@ -1122,6 +1226,12 @@ func (c *bls12381MapG2) Run(input []byte) ([]byte, error) { // kzgPointEvaluation implements the EIP-4844 point evaluation precompile. type kzgPointEvaluation struct{} +// Address defines the precompiled contract address. This MUST match the address +// set in the precompiled contract map. +func (*kzgPointEvaluation) Address() common.Address { + return common.BytesToAddress([]byte{0xa}) +} + // RequiredGas estimates the gas required for running the point evaluation precompile. func (b *kzgPointEvaluation) RequiredGas(input []byte) uint64 { return params.BlobTxPointEvaluationPrecompileGas diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index b627f2ada5..e9c063e036 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -25,6 +25,7 @@ import ( "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/vm/precompiles" ) // precompiledTest defines the input/output pairs for precompiled contract tests. @@ -45,7 +46,7 @@ type precompiledFailureTest struct { // allPrecompiles does not map to the actual set of precompiles, as it also contains // repriced versions of precompiles at certain slots -var allPrecompiles = map[common.Address]PrecompiledContract{ +var allPrecompiles = map[common.Address]precompiles.PrecompiledContract{ common.BytesToAddress([]byte{1}): &ecrecover{}, common.BytesToAddress([]byte{2}): &sha256hash{}, common.BytesToAddress([]byte{3}): &ripemd160hash{}, diff --git a/core/vm/evm.go b/core/vm/evm.go index c28dcb2554..18ceb98fad 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -25,6 +25,7 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" "github.com/holiman/uint256" @@ -40,7 +41,7 @@ type ( GetHashFunc func(uint64) common.Hash ) -func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) { +func (evm *EVM) precompile(addr common.Address) (precompiles.PrecompiledContract, bool) { p, ok := evm.precompiles[addr] return p, ok } @@ -120,7 +121,7 @@ type EVM struct { callGasTemp uint64 // precompiles holds the precompiled contracts for the current epoch - precompiles map[common.Address]PrecompiledContract + precompiles map[common.Address]precompiles.PrecompiledContract // jumpDests is the aggregated result of JUMPDEST analysis made through // the life cycle of EVM. @@ -148,7 +149,7 @@ func NewEVM(blockCtx BlockContext, statedb StateDB, chainConfig *params.ChainCon // SetPrecompiles sets the precompiled contracts for the EVM. // This method is only used through RPC calls. // It is not thread-safe. -func (evm *EVM) SetPrecompiles(precompiles PrecompiledContracts) { +func (evm *EVM) SetPrecompiles(precompiles precompiles.PrecompiledContracts) { evm.precompiles = precompiles } diff --git a/core/vm/precompiles/precompiles.go b/core/vm/precompiles/precompiles.go new file mode 100644 index 0000000000..8a841502a3 --- /dev/null +++ b/core/vm/precompiles/precompiles.go @@ -0,0 +1,35 @@ +package precompiles + +import ( + "maps" + + "github.com/ethereum/go-ethereum/common" +) + +// PrecompiledContract is the basic interface for native Go contracts. The implementation +// requires a deterministic gas count based on the input size of the Run method of the +// contract. +type PrecompiledContract interface { + Address() common.Address + RequiredGas(input []byte) uint64 // RequiredPrice calculates the contract gas use + Run(input []byte) ([]byte, error) // Run runs the precompiled contract +} + +// PrecompiledContracts contains the precompiled contracts supported at the given fork. +type PrecompiledContracts map[common.Address]PrecompiledContract + +var CustomPrecompiledContracts = PrecompiledContracts{} + +// WithCustomPrecompiles merge given precompiles with custom precompiles +func WithCustomPrecompiles(base PrecompiledContracts) PrecompiledContracts { + result := make(PrecompiledContracts) + maps.Copy(result, base) + for k, v := range CustomPrecompiledContracts { + if _, exists := result[k]; !exists { + result[k] = v + } else { + panic("Precompile address collision") + } + } + return result +} diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index f3975d35a0..ca1a1eef93 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -37,6 +37,7 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/gasestimator" "github.com/ethereum/go-ethereum/eth/tracers/logger" @@ -688,7 +689,7 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S return applyMessage(ctx, b, args, state, header, timeout, gp, &blockCtx, &vm.Config{NoBaseFee: true}, precompiles, true) } -func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *state.StateDB, header *types.Header, timeout time.Duration, gp *core.GasPool, blockContext *vm.BlockContext, vmConfig *vm.Config, precompiles vm.PrecompiledContracts, skipChecks bool) (*core.ExecutionResult, error) { +func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *state.StateDB, header *types.Header, timeout time.Duration, gp *core.GasPool, blockContext *vm.BlockContext, vmConfig *vm.Config, precompiles precompiles.PrecompiledContracts, skipChecks bool) (*core.ExecutionResult, error) { // Get a new instance of the EVM. if err := args.CallDefaults(gp.Gas(), blockContext.BaseFee, b.ChainConfig().ChainID); err != nil { return nil, err diff --git a/internal/ethapi/override/override.go b/internal/ethapi/override/override.go index f6a8a94ffd..5f425577c9 100644 --- a/internal/ethapi/override/override.go +++ b/internal/ethapi/override/override.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/holiman/uint256" ) @@ -53,7 +54,7 @@ func (diff *StateOverride) has(address common.Address) bool { } // Apply overrides the fields of specified accounts into the given state. -func (diff *StateOverride) Apply(statedb *state.StateDB, precompiles vm.PrecompiledContracts) error { +func (diff *StateOverride) Apply(statedb *state.StateDB, precompiles precompiles.PrecompiledContracts) error { if diff == nil { return nil } diff --git a/internal/ethapi/override/override_test.go b/internal/ethapi/override/override_test.go index 02a17c1331..a6321467c8 100644 --- a/internal/ethapi/override/override_test.go +++ b/internal/ethapi/override/override_test.go @@ -25,12 +25,16 @@ import ( "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/triedb" ) type precompileContract struct{} +func (precompileContract) Address() common.Address { + return common.BytesToAddress([]byte{0x1}) +} + func (p *precompileContract) RequiredGas(input []byte) uint64 { return 0 } func (p *precompileContract) Run(input []byte) ([]byte, error) { return nil, nil } @@ -41,7 +45,7 @@ func TestStateOverrideMovePrecompile(t *testing.T) { if err != nil { t.Fatalf("failed to create statedb: %v", err) } - precompiles := map[common.Address]vm.PrecompiledContract{ + precompiles := map[common.Address]precompiles.PrecompiledContract{ common.BytesToAddress([]byte{0x1}): &precompileContract{}, common.BytesToAddress([]byte{0x2}): &precompileContract{}, } diff --git a/internal/ethapi/simulate.go b/internal/ethapi/simulate.go index ac76372424..e8a931e187 100644 --- a/internal/ethapi/simulate.go +++ b/internal/ethapi/simulate.go @@ -33,6 +33,7 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/internal/ethapi/override" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" @@ -315,7 +316,7 @@ func (sim *simulator) sanitizeCall(call *TransactionArgs, state vm.StateDB, head return nil } -func (sim *simulator) activePrecompiles(base *types.Header) vm.PrecompiledContracts { +func (sim *simulator) activePrecompiles(base *types.Header) precompiles.PrecompiledContracts { var ( isMerge = (base.Difficulty.Sign() == 0) rules = sim.chainConfig.Rules(base.Number, isMerge, base.Time) From eca91aa939d4330ba3d5cde682b8fd763b97f0be Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Tue, 25 Mar 2025 05:39:15 +0800 Subject: [PATCH 02/11] refactor: stateful precompiles --- core/vm/contracts.go | 144 +++++++++++++++------- core/vm/contracts_fuzz_test.go | 3 +- core/vm/contracts_test.go | 12 +- core/vm/evm.go | 15 ++- core/vm/precompiles/precompiles.go | 35 ------ internal/ethapi/api.go | 3 +- internal/ethapi/override/override.go | 3 +- internal/ethapi/override/override_test.go | 8 +- internal/ethapi/simulate.go | 3 +- 9 files changed, 120 insertions(+), 106 deletions(-) delete mode 100644 core/vm/precompiles/precompiles.go diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 2202fcca85..438833a56e 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -31,18 +31,46 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/tracing" - "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/blake2b" "github.com/ethereum/go-ethereum/crypto/bn256" "github.com/ethereum/go-ethereum/crypto/kzg4844" "github.com/ethereum/go-ethereum/params" + "github.com/holiman/uint256" "golang.org/x/crypto/ripemd160" ) +// PrecompiledContract is the basic interface for native Go contracts. The implementation +// requires a deterministic gas count based on the input size of the Run method of the +// contract. +type PrecompiledContract interface { + Address() common.Address + RequiredGas(input []byte) uint64 // RequiredPrice calculates the contract gas use + Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) +} + +// PrecompiledContracts contains the precompiled contracts supported at the given fork. +type PrecompiledContracts map[common.Address]PrecompiledContract + +var CustomPrecompiledContracts = PrecompiledContracts{} + +// WithCustomPrecompiles merge given precompiles with custom precompiles +func WithCustomPrecompiles(base PrecompiledContracts) PrecompiledContracts { + result := make(PrecompiledContracts) + maps.Copy(result, base) + for k, v := range CustomPrecompiledContracts { + if _, exists := result[k]; !exists { + result[k] = v + } else { + panic("Precompile address collision") + } + } + return result +} + // PrecompiledContractsHomestead contains the default set of pre-compiled Ethereum // contracts used in the Frontier and Homestead releases. -var PrecompiledContractsHomestead = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ +var PrecompiledContractsHomestead = WithCustomPrecompiles(PrecompiledContracts{ (&ecrecover{}).Address(): &ecrecover{}, (&sha256hash{}).Address(): &sha256hash{}, (&ripemd160hash{}).Address(): &ripemd160hash{}, @@ -51,7 +79,7 @@ var PrecompiledContractsHomestead = precompiles.WithCustomPrecompiles(precompile // PrecompiledContractsByzantium contains the default set of pre-compiled Ethereum // contracts used in the Byzantium release. -var PrecompiledContractsByzantium = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ +var PrecompiledContractsByzantium = WithCustomPrecompiles(PrecompiledContracts{ (&ecrecover{}).Address(): &ecrecover{}, (&sha256hash{}).Address(): &sha256hash{}, (&ripemd160hash{}).Address(): &ripemd160hash{}, @@ -64,7 +92,7 @@ var PrecompiledContractsByzantium = precompiles.WithCustomPrecompiles(precompile // PrecompiledContractsIstanbul contains the default set of pre-compiled Ethereum // contracts used in the Istanbul release. -var PrecompiledContractsIstanbul = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ +var PrecompiledContractsIstanbul = WithCustomPrecompiles(PrecompiledContracts{ (&ecrecover{}).Address(): &ecrecover{}, (&sha256hash{}).Address(): &sha256hash{}, (&ripemd160hash{}).Address(): &ripemd160hash{}, @@ -78,7 +106,7 @@ var PrecompiledContractsIstanbul = precompiles.WithCustomPrecompiles(precompiles // PrecompiledContractsBerlin contains the default set of pre-compiled Ethereum // contracts used in the Berlin release. -var PrecompiledContractsBerlin = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ +var PrecompiledContractsBerlin = WithCustomPrecompiles(PrecompiledContracts{ (&ecrecover{}).Address(): &ecrecover{}, (&sha256hash{}).Address(): &sha256hash{}, (&ripemd160hash{}).Address(): &ripemd160hash{}, @@ -92,7 +120,7 @@ var PrecompiledContractsBerlin = precompiles.WithCustomPrecompiles(precompiles.P // PrecompiledContractsCancun contains the default set of pre-compiled Ethereum // contracts used in the Cancun release. -var PrecompiledContractsCancun = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ +var PrecompiledContractsCancun = WithCustomPrecompiles(PrecompiledContracts{ (&ecrecover{}).Address(): &ecrecover{}, (&sha256hash{}).Address(): &sha256hash{}, (&ripemd160hash{}).Address(): &ripemd160hash{}, @@ -107,7 +135,7 @@ var PrecompiledContractsCancun = precompiles.WithCustomPrecompiles(precompiles.P // PrecompiledContractsPrague contains the set of pre-compiled Ethereum // contracts used in the Prague release. -var PrecompiledContractsPrague = precompiles.WithCustomPrecompiles(precompiles.PrecompiledContracts{ +var PrecompiledContractsPrague = WithCustomPrecompiles(PrecompiledContracts{ (&ecrecover{}).Address(): &ecrecover{}, (&sha256hash{}).Address(): &sha256hash{}, (&ripemd160hash{}).Address(): &ripemd160hash{}, @@ -161,7 +189,7 @@ func init() { } } -func activePrecompiledContracts(rules params.Rules) precompiles.PrecompiledContracts { +func activePrecompiledContracts(rules params.Rules) PrecompiledContracts { switch { case rules.IsVerkle: return PrecompiledContractsVerkle @@ -181,7 +209,7 @@ func activePrecompiledContracts(rules params.Rules) precompiles.PrecompiledContr } // ActivePrecompiledContracts returns a copy of precompiled contracts enabled with the current configuration. -func ActivePrecompiledContracts(rules params.Rules) precompiles.PrecompiledContracts { +func ActivePrecompiledContracts(rules params.Rules) PrecompiledContracts { return maps.Clone(activePrecompiledContracts(rules)) } @@ -208,17 +236,29 @@ func ActivePrecompiles(rules params.Rules) []common.Address { // - the returned bytes, // - the _remaining_ gas, // - any error that occurred -func RunPrecompiledContract(p precompiles.PrecompiledContract, input []byte, suppliedGas uint64, logger *tracing.Hooks) (ret []byte, remainingGas uint64, err error) { +func RunPrecompiledContract( + evm *EVM, + p PrecompiledContract, + caller common.Address, + input []byte, + suppliedGas uint64, + value *uint256.Int, + readOnly bool, + logger *tracing.Hooks, +) (ret []byte, remainingGas uint64, err error) { + inputCopy := make([]byte, len(input)) + copy(inputCopy, input) + + contract := NewContract(caller, p.Address(), value, suppliedGas, evm.jumpDests) + contract.Input = inputCopy + gasCost := p.RequiredGas(input) - if suppliedGas < gasCost { + if !contract.UseGas(gasCost, logger, tracing.GasChangeCallPrecompiledContract) { return nil, 0, ErrOutOfGas } - if logger != nil && logger.OnGasChange != nil { - logger.OnGasChange(suppliedGas, suppliedGas-gasCost, tracing.GasChangeCallPrecompiledContract) - } - suppliedGas -= gasCost - output, err := p.Run(input) - return output, suppliedGas, err + + output, err := p.Run(evm, contract, readOnly) + return output, contract.Gas, err } // ecrecover implemented as a native contract. @@ -234,10 +274,10 @@ func (c *ecrecover) RequiredGas(input []byte) uint64 { return params.EcrecoverGas } -func (c *ecrecover) Run(input []byte) ([]byte, error) { +func (c *ecrecover) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { const ecRecoverInputLength = 128 - input = common.RightPadBytes(input, ecRecoverInputLength) + input := common.RightPadBytes(contract.Input, ecRecoverInputLength) // "input" is (hash, v, r, s), each 32 bytes // but for ecrecover we want (r, s, v) @@ -281,8 +321,8 @@ func (*sha256hash) Address() common.Address { func (c *sha256hash) RequiredGas(input []byte) uint64 { return uint64(len(input)+31)/32*params.Sha256PerWordGas + params.Sha256BaseGas } -func (c *sha256hash) Run(input []byte) ([]byte, error) { - h := sha256.Sum256(input) +func (c *sha256hash) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + h := sha256.Sum256(contract.Input) return h[:], nil } @@ -302,9 +342,9 @@ func (*ripemd160hash) Address() common.Address { func (c *ripemd160hash) RequiredGas(input []byte) uint64 { return uint64(len(input)+31)/32*params.Ripemd160PerWordGas + params.Ripemd160BaseGas } -func (c *ripemd160hash) Run(input []byte) ([]byte, error) { +func (c *ripemd160hash) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { ripemd := ripemd160.New() - ripemd.Write(input) + ripemd.Write(contract.Input) return common.LeftPadBytes(ripemd.Sum(nil), 32), nil } @@ -324,8 +364,8 @@ func (*dataCopy) Address() common.Address { func (c *dataCopy) RequiredGas(input []byte) uint64 { return uint64(len(input)+31)/32*params.IdentityPerWordGas + params.IdentityBaseGas } -func (c *dataCopy) Run(in []byte) ([]byte, error) { - return common.CopyBytes(in), nil +func (c *dataCopy) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + return common.CopyBytes(contract.Input), nil } // bigModExp implements a native big integer exponential modular operation. @@ -461,7 +501,8 @@ func (c *bigModExp) RequiredGas(input []byte) uint64 { return gas.Uint64() } -func (c *bigModExp) Run(input []byte) ([]byte, error) { +func (c *bigModExp) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input var ( baseLen = new(big.Int).SetBytes(getData(input, 0, 32)).Uint64() expLen = new(big.Int).SetBytes(getData(input, 32, 32)).Uint64() @@ -547,8 +588,8 @@ func (c *bn256AddIstanbul) RequiredGas(input []byte) uint64 { return params.Bn256AddGasIstanbul } -func (c *bn256AddIstanbul) Run(input []byte) ([]byte, error) { - return runBn256Add(input) +func (c *bn256AddIstanbul) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + return runBn256Add(contract.Input) } // bn256AddByzantium implements a native elliptic curve point addition @@ -566,8 +607,8 @@ func (c *bn256AddByzantium) RequiredGas(input []byte) uint64 { return params.Bn256AddGasByzantium } -func (c *bn256AddByzantium) Run(input []byte) ([]byte, error) { - return runBn256Add(input) +func (c *bn256AddByzantium) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + return runBn256Add(contract.Input) } // runBn256ScalarMul implements the Bn256ScalarMul precompile, referenced by @@ -597,8 +638,8 @@ func (c *bn256ScalarMulIstanbul) RequiredGas(input []byte) uint64 { return params.Bn256ScalarMulGasIstanbul } -func (c *bn256ScalarMulIstanbul) Run(input []byte) ([]byte, error) { - return runBn256ScalarMul(input) +func (c *bn256ScalarMulIstanbul) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + return runBn256ScalarMul(contract.Input) } // bn256ScalarMulByzantium implements a native elliptic curve scalar @@ -616,8 +657,8 @@ func (c *bn256ScalarMulByzantium) RequiredGas(input []byte) uint64 { return params.Bn256ScalarMulGasByzantium } -func (c *bn256ScalarMulByzantium) Run(input []byte) ([]byte, error) { - return runBn256ScalarMul(input) +func (c *bn256ScalarMulByzantium) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + return runBn256ScalarMul(contract.Input) } var ( @@ -677,8 +718,8 @@ func (c *bn256PairingIstanbul) RequiredGas(input []byte) uint64 { return params.Bn256PairingBaseGasIstanbul + uint64(len(input)/192)*params.Bn256PairingPerPointGasIstanbul } -func (c *bn256PairingIstanbul) Run(input []byte) ([]byte, error) { - return runBn256Pairing(input) +func (c *bn256PairingIstanbul) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + return runBn256Pairing(contract.Input) } // bn256PairingByzantium implements a pairing pre-compile for the bn256 curve @@ -696,8 +737,8 @@ func (c *bn256PairingByzantium) RequiredGas(input []byte) uint64 { return params.Bn256PairingBaseGasByzantium + uint64(len(input)/192)*params.Bn256PairingPerPointGasByzantium } -func (c *bn256PairingByzantium) Run(input []byte) ([]byte, error) { - return runBn256Pairing(input) +func (c *bn256PairingByzantium) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + return runBn256Pairing(contract.Input) } type blake2F struct{} @@ -728,7 +769,8 @@ var ( errBlake2FInvalidFinalFlag = errors.New("invalid final flag") ) -func (c *blake2F) Run(input []byte) ([]byte, error) { +func (c *blake2F) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input // Make sure the input is valid (correct length and final flag) if len(input) != blake2FInputLength { return nil, errBlake2FInvalidInputLength @@ -788,7 +830,8 @@ func (c *bls12381G1Add) RequiredGas(input []byte) uint64 { return params.Bls12381G1AddGas } -func (c *bls12381G1Add) Run(input []byte) ([]byte, error) { +func (c *bls12381G1Add) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input // Implements EIP-2537 G1Add precompile. // > G1 addition call expects `256` bytes as an input that is interpreted as byte concatenation of two G1 points (`128` bytes each). // > Output is an encoding of addition operation result - single G1 point (`128` bytes). @@ -844,7 +887,8 @@ func (c *bls12381G1MultiExp) RequiredGas(input []byte) uint64 { return (uint64(k) * params.Bls12381G1MulGas * discount) / 1000 } -func (c *bls12381G1MultiExp) Run(input []byte) ([]byte, error) { +func (c *bls12381G1MultiExp) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input // Implements EIP-2537 G1MultiExp precompile. // G1 multiplication call expects `160*k` bytes as an input that is interpreted as byte concatenation of `k` slices each of them being a byte concatenation of encoding of G1 point (`128` bytes) and encoding of a scalar value (`32` bytes). // Output is an encoding of multiexponentiation operation result - single G1 point (`128` bytes). @@ -896,7 +940,8 @@ func (c *bls12381G2Add) RequiredGas(input []byte) uint64 { return params.Bls12381G2AddGas } -func (c *bls12381G2Add) Run(input []byte) ([]byte, error) { +func (c *bls12381G2Add) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input // Implements EIP-2537 G2Add precompile. // > G2 addition call expects `512` bytes as an input that is interpreted as byte concatenation of two G2 points (`256` bytes each). // > Output is an encoding of addition operation result - single G2 point (`256` bytes). @@ -953,7 +998,8 @@ func (c *bls12381G2MultiExp) RequiredGas(input []byte) uint64 { return (uint64(k) * params.Bls12381G2MulGas * discount) / 1000 } -func (c *bls12381G2MultiExp) Run(input []byte) ([]byte, error) { +func (c *bls12381G2MultiExp) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input // Implements EIP-2537 G2MultiExp precompile logic // > G2 multiplication call expects `288*k` bytes as an input that is interpreted as byte concatenation of `k` slices each of them being a byte concatenation of encoding of G2 point (`256` bytes) and encoding of a scalar value (`32` bytes). // > Output is an encoding of multiexponentiation operation result - single G2 point (`256` bytes). @@ -1005,7 +1051,8 @@ func (c *bls12381Pairing) RequiredGas(input []byte) uint64 { return params.Bls12381PairingBaseGas + uint64(len(input)/384)*params.Bls12381PairingPerPairGas } -func (c *bls12381Pairing) Run(input []byte) ([]byte, error) { +func (c *bls12381Pairing) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input // Implements EIP-2537 Pairing precompile logic. // > Pairing call expects `384*k` bytes as an inputs that is interpreted as byte concatenation of `k` slices. Each slice has the following structure: // > - `128` bytes of G1 point encoding @@ -1163,7 +1210,8 @@ func (c *bls12381MapG1) RequiredGas(input []byte) uint64 { return params.Bls12381MapG1Gas } -func (c *bls12381MapG1) Run(input []byte) ([]byte, error) { +func (c *bls12381MapG1) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input // Implements EIP-2537 Map_To_G1 precompile. // > Field-to-curve call expects an `64` bytes input that is interpreted as an element of the base field. // > Output of this call is `128` bytes and is G1 point following respective encoding rules. @@ -1198,7 +1246,8 @@ func (c *bls12381MapG2) RequiredGas(input []byte) uint64 { return params.Bls12381MapG2Gas } -func (c *bls12381MapG2) Run(input []byte) ([]byte, error) { +func (c *bls12381MapG2) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input // Implements EIP-2537 Map_FP2_TO_G2 precompile logic. // > Field-to-curve call expects an `128` bytes input that is interpreted as an element of the quadratic extension field. // > Output of this call is `256` bytes and is G2 point following respective encoding rules. @@ -1250,7 +1299,8 @@ var ( ) // Run executes the point evaluation precompile. -func (b *kzgPointEvaluation) Run(input []byte) ([]byte, error) { +func (b *kzgPointEvaluation) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + input := contract.Input if len(input) != blobVerifyInputLength { return nil, errBlobVerifyInvalidInputLength } diff --git a/core/vm/contracts_fuzz_test.go b/core/vm/contracts_fuzz_test.go index 1e5cc80074..d1a32f8ea2 100644 --- a/core/vm/contracts_fuzz_test.go +++ b/core/vm/contracts_fuzz_test.go @@ -20,6 +20,7 @@ import ( "testing" "github.com/ethereum/go-ethereum/common" + "github.com/holiman/uint256" ) func FuzzPrecompiledContracts(f *testing.F) { @@ -36,7 +37,7 @@ func FuzzPrecompiledContracts(f *testing.F) { return } inWant := string(input) - RunPrecompiledContract(p, input, gas, nil) + RunPrecompiledContract(nil, p, common.Address{}, input, gas, uint256.NewInt(0), false, nil) if inHave := string(input); inWant != inHave { t.Errorf("Precompiled %v modified input data", a) } diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index e9c063e036..69957783c5 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -25,7 +25,7 @@ import ( "time" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm/precompiles" + "github.com/holiman/uint256" ) // precompiledTest defines the input/output pairs for precompiled contract tests. @@ -46,7 +46,7 @@ type precompiledFailureTest struct { // allPrecompiles does not map to the actual set of precompiles, as it also contains // repriced versions of precompiles at certain slots -var allPrecompiles = map[common.Address]precompiles.PrecompiledContract{ +var allPrecompiles = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{1}): &ecrecover{}, common.BytesToAddress([]byte{2}): &sha256hash{}, common.BytesToAddress([]byte{3}): &ripemd160hash{}, @@ -97,7 +97,7 @@ func testPrecompiled(addr string, test precompiledTest, t *testing.T) { in := common.Hex2Bytes(test.Input) gas := p.RequiredGas(in) t.Run(fmt.Sprintf("%s-Gas=%d", test.Name, gas), func(t *testing.T) { - if res, _, err := RunPrecompiledContract(p, in, gas, nil); err != nil { + if res, _, err := RunPrecompiledContract(nil, p, common.Address{}, in, gas, uint256.NewInt(0), false, nil); err != nil { t.Error(err) } else if common.Bytes2Hex(res) != test.Expected { t.Errorf("Expected %v, got %v", test.Expected, common.Bytes2Hex(res)) @@ -119,7 +119,7 @@ func testPrecompiledOOG(addr string, test precompiledTest, t *testing.T) { gas := p.RequiredGas(in) - 1 t.Run(fmt.Sprintf("%s-Gas=%d", test.Name, gas), func(t *testing.T) { - _, _, err := RunPrecompiledContract(p, in, gas, nil) + _, _, err := RunPrecompiledContract(nil, p, common.Address{}, in, gas, uint256.NewInt(0), false, nil) if err.Error() != "out of gas" { t.Errorf("Expected error [out of gas], got [%v]", err) } @@ -136,7 +136,7 @@ func testPrecompiledFailure(addr string, test precompiledFailureTest, t *testing in := common.Hex2Bytes(test.Input) gas := p.RequiredGas(in) t.Run(test.Name, func(t *testing.T) { - _, _, err := RunPrecompiledContract(p, in, gas, nil) + _, _, err := RunPrecompiledContract(nil, p, common.Address{}, in, gas, uint256.NewInt(0), false, nil) if err.Error() != test.ExpectedError { t.Errorf("Expected error [%v], got [%v]", test.ExpectedError, err) } @@ -168,7 +168,7 @@ func benchmarkPrecompiled(addr string, test precompiledTest, bench *testing.B) { bench.ResetTimer() for i := 0; i < bench.N; i++ { copy(data, in) - res, _, err = RunPrecompiledContract(p, data, reqGas, nil) + res, _, err = RunPrecompiledContract(nil, p, common.Address{}, data, reqGas, uint256.NewInt(0), false, nil) } bench.StopTimer() elapsed := uint64(time.Since(start)) diff --git a/core/vm/evm.go b/core/vm/evm.go index 18ceb98fad..6b60812d92 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -25,7 +25,6 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/params" "github.com/holiman/uint256" @@ -41,7 +40,7 @@ type ( GetHashFunc func(uint64) common.Hash ) -func (evm *EVM) precompile(addr common.Address) (precompiles.PrecompiledContract, bool) { +func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) { p, ok := evm.precompiles[addr] return p, ok } @@ -121,7 +120,7 @@ type EVM struct { callGasTemp uint64 // precompiles holds the precompiled contracts for the current epoch - precompiles map[common.Address]precompiles.PrecompiledContract + precompiles map[common.Address]PrecompiledContract // jumpDests is the aggregated result of JUMPDEST analysis made through // the life cycle of EVM. @@ -149,7 +148,7 @@ func NewEVM(blockCtx BlockContext, statedb StateDB, chainConfig *params.ChainCon // SetPrecompiles sets the precompiled contracts for the EVM. // This method is only used through RPC calls. // It is not thread-safe. -func (evm *EVM) SetPrecompiles(precompiles precompiles.PrecompiledContracts) { +func (evm *EVM) SetPrecompiles(precompiles PrecompiledContracts) { evm.precompiles = precompiles } @@ -225,7 +224,7 @@ func (evm *EVM) Call(caller common.Address, addr common.Address, input []byte, g evm.Context.Transfer(evm.StateDB, caller, addr, value) if isPrecompile { - ret, gas, err = RunPrecompiledContract(p, input, gas, evm.Config.Tracer) + ret, gas, err = RunPrecompiledContract(evm, p, caller, input, gas, value, false, evm.Config.Tracer) } else { // Initialise a new contract and set the code that is to be used by the EVM. code := evm.resolveCode(addr) @@ -289,7 +288,7 @@ func (evm *EVM) CallCode(caller common.Address, addr common.Address, input []byt // It is allowed to call precompiles, even via delegatecall if p, isPrecompile := evm.precompile(addr); isPrecompile { - ret, gas, err = RunPrecompiledContract(p, input, gas, evm.Config.Tracer) + ret, gas, err = RunPrecompiledContract(evm, p, caller, input, gas, value, true, evm.Config.Tracer) } else { // Initialise a new contract and set the code that is to be used by the EVM. // The contract is a scoped environment for this execution context only. @@ -332,7 +331,7 @@ func (evm *EVM) DelegateCall(originCaller common.Address, caller common.Address, // It is allowed to call precompiles, even via delegatecall if p, isPrecompile := evm.precompile(addr); isPrecompile { - ret, gas, err = RunPrecompiledContract(p, input, gas, evm.Config.Tracer) + ret, gas, err = RunPrecompiledContract(evm, p, caller, input, gas, value, true, evm.Config.Tracer) } else { // Initialise a new contract and make initialise the delegate values // @@ -384,7 +383,7 @@ func (evm *EVM) StaticCall(caller common.Address, addr common.Address, input []b evm.StateDB.AddBalance(addr, new(uint256.Int), tracing.BalanceChangeTouchAccount) if p, isPrecompile := evm.precompile(addr); isPrecompile { - ret, gas, err = RunPrecompiledContract(p, input, gas, evm.Config.Tracer) + ret, gas, err = RunPrecompiledContract(evm, p, caller, input, gas, new(uint256.Int), true, evm.Config.Tracer) } else { // Initialise a new contract and set the code that is to be used by the EVM. // The contract is a scoped environment for this execution context only. diff --git a/core/vm/precompiles/precompiles.go b/core/vm/precompiles/precompiles.go deleted file mode 100644 index 8a841502a3..0000000000 --- a/core/vm/precompiles/precompiles.go +++ /dev/null @@ -1,35 +0,0 @@ -package precompiles - -import ( - "maps" - - "github.com/ethereum/go-ethereum/common" -) - -// PrecompiledContract is the basic interface for native Go contracts. The implementation -// requires a deterministic gas count based on the input size of the Run method of the -// contract. -type PrecompiledContract interface { - Address() common.Address - RequiredGas(input []byte) uint64 // RequiredPrice calculates the contract gas use - Run(input []byte) ([]byte, error) // Run runs the precompiled contract -} - -// PrecompiledContracts contains the precompiled contracts supported at the given fork. -type PrecompiledContracts map[common.Address]PrecompiledContract - -var CustomPrecompiledContracts = PrecompiledContracts{} - -// WithCustomPrecompiles merge given precompiles with custom precompiles -func WithCustomPrecompiles(base PrecompiledContracts) PrecompiledContracts { - result := make(PrecompiledContracts) - maps.Copy(result, base) - for k, v := range CustomPrecompiledContracts { - if _, exists := result[k]; !exists { - result[k] = v - } else { - panic("Precompile address collision") - } - } - return result -} diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index ca1a1eef93..f3975d35a0 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -37,7 +37,6 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth/gasestimator" "github.com/ethereum/go-ethereum/eth/tracers/logger" @@ -689,7 +688,7 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S return applyMessage(ctx, b, args, state, header, timeout, gp, &blockCtx, &vm.Config{NoBaseFee: true}, precompiles, true) } -func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *state.StateDB, header *types.Header, timeout time.Duration, gp *core.GasPool, blockContext *vm.BlockContext, vmConfig *vm.Config, precompiles precompiles.PrecompiledContracts, skipChecks bool) (*core.ExecutionResult, error) { +func applyMessage(ctx context.Context, b Backend, args TransactionArgs, state *state.StateDB, header *types.Header, timeout time.Duration, gp *core.GasPool, blockContext *vm.BlockContext, vmConfig *vm.Config, precompiles vm.PrecompiledContracts, skipChecks bool) (*core.ExecutionResult, error) { // Get a new instance of the EVM. if err := args.CallDefaults(gp.Gas(), blockContext.BaseFee, b.ChainConfig().ChainID); err != nil { return nil, err diff --git a/internal/ethapi/override/override.go b/internal/ethapi/override/override.go index 5f425577c9..f6a8a94ffd 100644 --- a/internal/ethapi/override/override.go +++ b/internal/ethapi/override/override.go @@ -26,7 +26,6 @@ import ( "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/holiman/uint256" ) @@ -54,7 +53,7 @@ func (diff *StateOverride) has(address common.Address) bool { } // Apply overrides the fields of specified accounts into the given state. -func (diff *StateOverride) Apply(statedb *state.StateDB, precompiles precompiles.PrecompiledContracts) error { +func (diff *StateOverride) Apply(statedb *state.StateDB, precompiles vm.PrecompiledContracts) error { if diff == nil { return nil } diff --git a/internal/ethapi/override/override_test.go b/internal/ethapi/override/override_test.go index a6321467c8..ec151f7dd5 100644 --- a/internal/ethapi/override/override_test.go +++ b/internal/ethapi/override/override_test.go @@ -25,7 +25,7 @@ import ( "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/core/vm/precompiles" + "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/triedb" ) @@ -37,7 +37,9 @@ func (precompileContract) Address() common.Address { func (p *precompileContract) RequiredGas(input []byte) uint64 { return 0 } -func (p *precompileContract) Run(input []byte) ([]byte, error) { return nil, nil } +func (p *precompileContract) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ([]byte, error) { + return nil, nil +} func TestStateOverrideMovePrecompile(t *testing.T) { db := state.NewDatabase(triedb.NewDatabase(rawdb.NewMemoryDatabase(), nil), nil) @@ -45,7 +47,7 @@ func TestStateOverrideMovePrecompile(t *testing.T) { if err != nil { t.Fatalf("failed to create statedb: %v", err) } - precompiles := map[common.Address]precompiles.PrecompiledContract{ + precompiles := map[common.Address]vm.PrecompiledContract{ common.BytesToAddress([]byte{0x1}): &precompileContract{}, common.BytesToAddress([]byte{0x2}): &precompileContract{}, } diff --git a/internal/ethapi/simulate.go b/internal/ethapi/simulate.go index e8a931e187..ac76372424 100644 --- a/internal/ethapi/simulate.go +++ b/internal/ethapi/simulate.go @@ -33,7 +33,6 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/core/vm/precompiles" "github.com/ethereum/go-ethereum/internal/ethapi/override" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" @@ -316,7 +315,7 @@ func (sim *simulator) sanitizeCall(call *TransactionArgs, state vm.StateDB, head return nil } -func (sim *simulator) activePrecompiles(base *types.Header) precompiles.PrecompiledContracts { +func (sim *simulator) activePrecompiles(base *types.Header) vm.PrecompiledContracts { var ( isMerge = (base.Difficulty.Sign() == 0) rules = sim.chainConfig.Rules(base.Number, isMerge, base.Time) From c8b9013ac6528a81d6b4b6af386286f87ad7e857 Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Thu, 27 Mar 2025 06:28:19 +0800 Subject: [PATCH 03/11] feat: dasigners precompile --- .gitignore | 3 + common/bn254util/bn254util.go | 166 + common/types.go | 7 + core/vm/contracts.go | 38 + core/vm/dasigners.go | 633 ++++ core/vm/precompiles/dasigners/contract.go | 882 +++++ core/vm/precompiles/dasigners/errors.go | 14 + core/vm/precompiles/dasigners/signature.go | 63 + core/vm/precompiles/dasigners/types.go | 87 + core/vm/precompiles/errors.go | 7 + core/vm/precompiles/interfaces/.solhint.json | 18 + .../interfaces/abis/IDASigners.json | 475 +++ .../interfaces/abis/IWrappedA0GIBase.json | 87 + .../377589efa765dec208356377872d3755.json | 1 + .../c79ff14473359160d0c7a65892d5cb52.json | 1 + .../contracts/IDASigners.sol/BN254.dbg.json | 4 + .../contracts/IDASigners.sol/BN254.json | 10 + .../IDASigners.sol/IDASigners.dbg.json | 4 + .../contracts/IDASigners.sol/IDASigners.json | 484 +++ .../IWrappedA0GIBase.dbg.json | 4 + .../IWrappedA0GIBase.json | 96 + .../build/cache/solidity-files-cache.json | 78 + .../interfaces/contracts/IDASigners.sol | 90 + .../interfaces/contracts/IWrappedA0GIBase.sol | 57 + .../precompiles/interfaces/hardhat.config.ts | 33 + core/vm/precompiles/interfaces/package.json | 27 + core/vm/precompiles/interfaces/yarn.lock | 3152 +++++++++++++++++ core/vm/statedb_utils.go | 46 + go.mod | 2 + go.sum | 4 + tests/fuzzers/bls12381/precompile_fuzzer.go | 2 +- 31 files changed, 6574 insertions(+), 1 deletion(-) create mode 100644 common/bn254util/bn254util.go create mode 100644 core/vm/dasigners.go create mode 100644 core/vm/precompiles/dasigners/contract.go create mode 100644 core/vm/precompiles/dasigners/errors.go create mode 100644 core/vm/precompiles/dasigners/signature.go create mode 100644 core/vm/precompiles/dasigners/types.go create mode 100644 core/vm/precompiles/errors.go create mode 100644 core/vm/precompiles/interfaces/.solhint.json create mode 100644 core/vm/precompiles/interfaces/abis/IDASigners.json create mode 100644 core/vm/precompiles/interfaces/abis/IWrappedA0GIBase.json create mode 100644 core/vm/precompiles/interfaces/build/artifacts/build-info/377589efa765dec208356377872d3755.json create mode 100644 core/vm/precompiles/interfaces/build/artifacts/build-info/c79ff14473359160d0c7a65892d5cb52.json create mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.dbg.json create mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.json create mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.dbg.json create mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.json create mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.dbg.json create mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.json create mode 100644 core/vm/precompiles/interfaces/build/cache/solidity-files-cache.json create mode 100644 core/vm/precompiles/interfaces/contracts/IDASigners.sol create mode 100644 core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol create mode 100644 core/vm/precompiles/interfaces/hardhat.config.ts create mode 100644 core/vm/precompiles/interfaces/package.json create mode 100644 core/vm/precompiles/interfaces/yarn.lock create mode 100644 core/vm/statedb_utils.go diff --git a/.gitignore b/.gitignore index 7000fedd25..c77b4ec853 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,6 @@ profile.cov .vscode tests/spec-tests/ + +# Precompiles +core/vm/Precompiles/interfaces/node_modules diff --git a/common/bn254util/bn254util.go b/common/bn254util/bn254util.go new file mode 100644 index 0000000000..ea03660a2f --- /dev/null +++ b/common/bn254util/bn254util.go @@ -0,0 +1,166 @@ +package bn254util + +import ( + "math/big" + + "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/consensys/gnark-crypto/ecc/bn254/fp" + "github.com/consensys/gnark-crypto/ecc/bn254/fr" + "github.com/ethereum/go-ethereum/crypto" +) + +const ( + G1PointSize = 32 * 2 + G2PointSize = 32 * 2 * 2 +) + +var ( + FR_MODULUS, _ = new(big.Int).SetString("21888242871839275222246405745257275088548364400416034343698204186575808495617", 10) +) + +func VerifySig(sig *bn254.G1Affine, pubkey *bn254.G2Affine, msgBytes [32]byte) (bool, error) { + + g2Gen := GetG2Generator() + + msgPoint := MapToCurve(msgBytes) + + var negSig bn254.G1Affine + negSig.Neg((*bn254.G1Affine)(sig)) + + P := [2]bn254.G1Affine{*msgPoint, negSig} + Q := [2]bn254.G2Affine{*pubkey, *g2Gen} + + ok, err := bn254.PairingCheck(P[:], Q[:]) + if err != nil { + return false, nil + } + return ok, nil + +} + +func MapToCurve(digest [32]byte) *bn254.G1Affine { + + one := new(big.Int).SetUint64(1) + three := new(big.Int).SetUint64(3) + x := new(big.Int) + x.SetBytes(digest[:]) + for { + // y = x^3 + 3 + xP3 := new(big.Int).Exp(x, big.NewInt(3), fp.Modulus()) + y := new(big.Int).Add(xP3, three) + y.Mod(y, fp.Modulus()) + + if y.ModSqrt(y, fp.Modulus()) == nil { + x.Add(x, one).Mod(x, fp.Modulus()) + } else { + var fpX, fpY fp.Element + fpX.SetBigInt(x) + fpY.SetBigInt(y) + return &bn254.G1Affine{ + X: fpX, + Y: fpY, + } + } + } +} + +func CheckG1AndG2DiscreteLogEquality(pointG1 *bn254.G1Affine, pointG2 *bn254.G2Affine) (bool, error) { + negGenG1 := new(bn254.G1Affine).Neg(GetG1Generator()) + return bn254.PairingCheck([]bn254.G1Affine{*pointG1, *negGenG1}, []bn254.G2Affine{*GetG2Generator(), *pointG2}) +} + +func GetG1Generator() *bn254.G1Affine { + g1Gen := new(bn254.G1Affine) + _, err := g1Gen.X.SetString("1") + if err != nil { + return nil + } + _, err = g1Gen.Y.SetString("2") + if err != nil { + return nil + } + return g1Gen +} + +func GetG2Generator() *bn254.G2Affine { + g2Gen := new(bn254.G2Affine) + g2Gen.X.SetString("10857046999023057135944570762232829481370756359578518086990519993285655852781", + "11559732032986387107991004021392285783925812861821192530917403151452391805634") + g2Gen.Y.SetString("8495653923123431417604973247489272438418190587263600148770280649306958101930", + "4082367875863433681332203403145435568316851327593401208105741076214120093531") + return g2Gen +} + +func MulByGeneratorG1(a *fr.Element) *bn254.G1Affine { + g1Gen := GetG1Generator() + return new(bn254.G1Affine).ScalarMultiplication(g1Gen, a.BigInt(new(big.Int))) +} + +func MulByGeneratorG2(a *fr.Element) *bn254.G2Affine { + g2Gen := GetG2Generator() + return new(bn254.G2Affine).ScalarMultiplication(g2Gen, a.BigInt(new(big.Int))) +} + +func SerializeG1(p *bn254.G1Affine) []byte { + b := make([]byte, 0) + tmp := p.X.Bytes() + for i := 0; i < 32; i++ { + b = append(b, tmp[i]) + } + tmp = p.Y.Bytes() + for i := 0; i < 32; i++ { + b = append(b, tmp[i]) + } + return b +} + +func DeserializeG1(b []byte) *bn254.G1Affine { + p := new(bn254.G1Affine) + p.X.SetBytes(b[0:32]) + p.Y.SetBytes(b[32:64]) + return p +} + +func SerializeG2(p *bn254.G2Affine) []byte { + b := make([]byte, 0) + tmp := p.X.A0.Bytes() + for i := 0; i < 32; i++ { + b = append(b, tmp[i]) + } + tmp = p.X.A1.Bytes() + for i := 0; i < 32; i++ { + b = append(b, tmp[i]) + } + tmp = p.Y.A0.Bytes() + for i := 0; i < 32; i++ { + b = append(b, tmp[i]) + } + tmp = p.Y.A1.Bytes() + for i := 0; i < 32; i++ { + b = append(b, tmp[i]) + } + return b +} + +func DeserializeG2(b []byte) *bn254.G2Affine { + p := new(bn254.G2Affine) + p.X.A0.SetBytes(b[0:32]) + p.X.A1.SetBytes(b[32:64]) + p.Y.A0.SetBytes(b[64:96]) + p.Y.A1.SetBytes(b[96:128]) + return p +} + +func Gamma(hash *bn254.G1Affine, signature *bn254.G1Affine, pkG1 *bn254.G1Affine, pkG2 *bn254.G2Affine) *big.Int { + toHash := make([]byte, 0) + toHash = append(toHash, SerializeG1(hash)...) + toHash = append(toHash, SerializeG1(signature)...) + toHash = append(toHash, SerializeG1(pkG1)...) + toHash = append(toHash, SerializeG2(pkG2)...) + + msgHash := crypto.Keccak256(toHash) + gamma := new(big.Int) + gamma.SetBytes(msgHash) + gamma.Mod(gamma, FR_MODULUS) + return gamma +} diff --git a/common/types.go b/common/types.go index fdb25f1b34..cf46188701 100644 --- a/common/types.go +++ b/common/types.go @@ -19,6 +19,7 @@ package common import ( "bytes" "database/sql/driver" + "encoding/binary" "encoding/hex" "encoding/json" "errors" @@ -486,3 +487,9 @@ func (b PrettyBytes) TerminalString() string { } return fmt.Sprintf("%#x...%x (%dB)", b[:3], b[len(b)-3:], len(b)) } + +func Uint64ToBytes(i uint64) []byte { + b := make([]byte, 8) + binary.BigEndian.PutUint64(b, i) + return b +} diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 438833a56e..3d414e8206 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -29,6 +29,7 @@ import ( bls12381 "github.com/consensys/gnark-crypto/ecc/bls12-381" "github.com/consensys/gnark-crypto/ecc/bls12-381/fp" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/tracing" "github.com/ethereum/go-ethereum/crypto" @@ -68,6 +69,43 @@ func WithCustomPrecompiles(base PrecompiledContracts) PrecompiledContracts { return result } +// PrecompiledContract is the basic interface for custom precompile contracts. +type StatefulPrecompiledContract interface { + PrecompiledContract + Abi() *abi.ABI + IsTx(string) bool +} + +func InitializeStatefulPrecompileCall( + p StatefulPrecompiledContract, + evm *EVM, + contract *Contract, + readonly bool, +) ( + method *abi.Method, + args []interface{}, + err error, +) { + // parse input + if len(contract.Input) < 4 { + return nil, nil, ErrExecutionReverted + } + method, err = p.Abi().MethodById(contract.Input[:4]) + if err != nil { + return nil, nil, ErrExecutionReverted + } + args, err = method.Inputs.Unpack(contract.Input[4:]) + if err != nil { + return nil, nil, ErrExecutionReverted + } + // readonly check + if readonly && p.IsTx(method.Name) { + return nil, nil, ErrExecutionReverted + } + + return method, args, nil +} + // PrecompiledContractsHomestead contains the default set of pre-compiled Ethereum // contracts used in the Frontier and Homestead releases. var PrecompiledContractsHomestead = WithCustomPrecompiles(PrecompiledContracts{ diff --git a/core/vm/dasigners.go b/core/vm/dasigners.go new file mode 100644 index 0000000000..8fb8712a59 --- /dev/null +++ b/core/vm/dasigners.go @@ -0,0 +1,633 @@ +package vm + +import ( + "bytes" + "math/big" + "sort" + "strings" + + "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bn254util" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm/precompiles" + "github.com/ethereum/go-ethereum/core/vm/precompiles/dasigners" + "github.com/ethereum/go-ethereum/crypto" + "github.com/vmihailenco/msgpack/v5" +) + +const ( + requiredGasMax uint64 = 1000_000_000 + + DASignersFunctionParams = "params" + DASignersFunctionEpochNumber = "epochNumber" + DASignersFunctionQuorumCount = "quorumCount" + DASignersFunctionGetSigner = "getSigner" + DASignersFunctionGetQuorum = "getQuorum" + DASignersFunctionGetQuorumRow = "getQuorumRow" + DASignersFunctionRegisterSigner = "registerSigner" + DASignersFunctionUpdateSocket = "updateSocket" + DASignersFunctionRegisterNextEpoch = "registerNextEpoch" + DASignersFunctionGetAggPkG1 = "getAggPkG1" + DASignersFunctionIsSigner = "isSigner" + DASignersFunctionRegisteredEpoch = "registeredEpoch" + DASignersFunctionMakeEpoch = "makeEpoch" +) + +var RequiredGasBasic = map[string]uint64{ + DASignersFunctionParams: 1_000, + DASignersFunctionEpochNumber: 1_000, + DASignersFunctionQuorumCount: 1_000, + DASignersFunctionGetSigner: 100_000, + DASignersFunctionGetQuorum: 100_000, + DASignersFunctionGetQuorumRow: 10_000, + DASignersFunctionRegisterSigner: 100_000, + DASignersFunctionUpdateSocket: 50_000, + DASignersFunctionRegisterNextEpoch: 100_000, + DASignersFunctionGetAggPkG1: 1_000_000, + DASignersFunctionIsSigner: 10_000, + DASignersFunctionRegisteredEpoch: 10_000, + DASignersFunctionMakeEpoch: 100_000, +} + +const ( + NewSignerEvent = "NewSigner" + SocketUpdatedEvent = "SocketUpdated" +) + +var _ StatefulPrecompiledContract = &DASignersPrecompile{} + +type DASignersPrecompile struct { + abi abi.ABI +} + +func NewDASignersPrecompile() (*DASignersPrecompile, error) { + abi, err := abi.JSON(strings.NewReader(dasigners.DASignersABI)) + if err != nil { + return nil, err + } + return &DASignersPrecompile{ + abi: abi, + }, nil +} + +// Address implements vm.PrecompiledContract. +func (d *DASignersPrecompile) Address() common.Address { + return common.HexToAddress("0x0000000000000000000000000000000000001000") +} + +// RequiredGas implements vm.PrecompiledContract. +func (d *DASignersPrecompile) RequiredGas(input []byte) uint64 { + method, err := d.abi.MethodById(input[:4]) + if err != nil { + return requiredGasMax + } + if gas, ok := RequiredGasBasic[method.Name]; ok { + return gas + } + return requiredGasMax +} + +func (d *DASignersPrecompile) IsTx(method string) bool { + switch method { + case DASignersFunctionUpdateSocket, + DASignersFunctionRegisterSigner, + DASignersFunctionRegisterNextEpoch: + return true + default: + return false + } +} + +func (d *DASignersPrecompile) Abi() *abi.ABI { + return &d.abi +} + +// Run implements vm.PrecompiledContract. +func (d *DASignersPrecompile) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + method, args, err := InitializeStatefulPrecompileCall(d, evm, contract, readonly) + if err != nil { + return nil, err + } + + var bz []byte + switch method.Name { + // queries + case DASignersFunctionParams: + bz, err = d.Params(evm, method, args) + case DASignersFunctionEpochNumber: + bz, err = d.EpochNumber(evm, method, args) + case DASignersFunctionQuorumCount: + bz, err = d.QuorumCount(evm, method, args) + case DASignersFunctionGetSigner: + bz, err = d.GetSigner(evm, method, args) + case DASignersFunctionGetQuorum: + bz, err = d.GetQuorum(evm, method, args) + case DASignersFunctionGetQuorumRow: + bz, err = d.GetQuorumRow(evm, method, args) + case DASignersFunctionGetAggPkG1: + bz, err = d.GetAggPkG1(evm, method, args) + case DASignersFunctionIsSigner: + bz, err = d.IsSigner(evm, method, args) + case DASignersFunctionRegisteredEpoch: + bz, err = d.RegisteredEpoch(evm, method, args) + // txs + case DASignersFunctionRegisterSigner: + bz, err = d.RegisterSigner(evm, contract, method, args) + case DASignersFunctionRegisterNextEpoch: + bz, err = d.RegisterNextEpoch(evm, contract, method, args) + case DASignersFunctionUpdateSocket: + bz, err = d.UpdateSocket(evm, contract, method, args) + case DASignersFunctionMakeEpoch: + bz, err = d.MakeEpoch(evm, contract, method, args) + } + + if err != nil { + return nil, err + } + + return bz, nil +} + +func (d *DASignersPrecompile) EmitNewSignerEvent(evm *EVM, signer dasigners.IDASignersSignerDetail) error { + event := d.abi.Events[NewSignerEvent] + quries := make([]interface{}, 2) + quries[0] = event.ID + quries[1] = signer.Signer + topics, err := abi.MakeTopics(quries) + if err != nil { + return err + } + arguments := abi.Arguments{event.Inputs[1], event.Inputs[2]} + b, err := arguments.Pack(signer.PkG1, signer.PkG2) + if err != nil { + return err + } + evm.StateDB.AddLog(&types.Log{ + Address: d.Address(), + Topics: topics[0], + Data: b, + BlockNumber: evm.Context.BlockNumber.Uint64(), + }) + return d.EmitSocketUpdatedEvent(evm, signer.Signer, signer.Socket) +} + +func (d *DASignersPrecompile) EmitSocketUpdatedEvent(evm *EVM, signer common.Address, socket string) error { + event := d.abi.Events[SocketUpdatedEvent] + quries := make([]interface{}, 2) + quries[0] = event.ID + quries[1] = signer + topics, err := abi.MakeTopics(quries) + if err != nil { + return err + } + arguments := abi.Arguments{event.Inputs[1]} + b, err := arguments.Pack(socket) + if err != nil { + return err + } + evm.StateDB.AddLog(&types.Log{ + Address: d.Address(), + Topics: topics[0], + Data: b, + BlockNumber: evm.Context.BlockNumber.Uint64(), + }) + return nil +} + +type Ballot struct { + account common.Address + content []byte +} + +func (d *DASignersPrecompile) MakeEpoch( + evm *EVM, + contract *Contract, + method *abi.Method, + args []interface{}, +) ([]byte, error) { + if len(args) != 0 { + return nil, ErrExecutionReverted + } + params := d.params() + epoch := d.epochNumber(evm) + epochBlock := d.epochBlock(evm, epoch) + blockHeight := evm.Context.BlockNumber.Uint64() + if epochBlock > 0 && blockHeight < epochBlock+params.EpochBlocks.Uint64() { + // not yet to the next epoch + return method.Outputs.Pack() + } + // new epoch + epoch += 1 + cnt := d.epochRegistration(evm, epoch) + ballots := make([]Ballot, cnt) + for index := range cnt { + account := d.epochRegisteredSigner(evm, epoch, index) + sigHash, _ := d.getRegistration(evm, epoch, account) + ballots[index] = Ballot{ + account: account, + content: sigHash, + } + } + // TODO: calculate ballots based on staked amount + sort.Slice(ballots, func(i, j int) bool { + return bytes.Compare(ballots[i].content, ballots[j].content) < 0 + }) + + quorums := make([][]common.Address, 0) + encodedSlices := params.EncodedSlices.Uint64() + maxQuorums := params.MaxQuorums.Uint64() + if len(ballots) >= int(encodedSlices) { + for i := 0; i+int(encodedSlices) <= len(ballots); i += int(encodedSlices) { + if int(maxQuorums) <= len(quorums) { + break + } + quorum := make([]common.Address, encodedSlices) + for j := 0; j < int(encodedSlices); j += 1 { + quorum[j] = ballots[i+j].account + } + quorums = append(quorums, quorum) + } + if len(ballots)%int(encodedSlices) != 0 && int(maxQuorums) > len(quorums) { + quorum := make([]common.Address, 0) + for j := len(ballots) - int(encodedSlices); j < len(ballots); j += 1 { + quorum = append(quorum, ballots[j].account) + } + quorums = append(quorums, quorum) + } + } else if len(ballots) > 0 { + quorum := make([]common.Address, encodedSlices) + n := len(ballots) + for i := 0; i < int(encodedSlices); i += 1 { + quorum[i] = ballots[i%n].account + } + quorums = append(quorums, quorum) + } + + // save quorums + for index, quorum := range quorums { + b, err := msgpack.Marshal(quorum) + if err != nil { + return nil, err + } + StoreBytes(evm.StateDB, d.Address(), dasigners.QuorumKey(epoch+1, uint64(index)), b) + } + // save epoch number & block height + evm.StateDB.SetState(d.Address(), dasigners.EpochNumberKey(), common.BigToHash(big.NewInt(int64(epoch)))) + evm.StateDB.SetState(d.Address(), dasigners.EpochBlockKey(epoch), common.BigToHash(big.NewInt(int64(blockHeight)))) + return method.Outputs.Pack() +} + +func (d *DASignersPrecompile) setSigner(evm *EVM, signer dasigners.IDASignersSignerDetail) error { + b, err := msgpack.Marshal(signer) + if err != nil { + return err + } + StoreBytes(evm.StateDB, d.Address(), dasigners.SignerKey(signer.Signer), b) + return nil +} + +func (d *DASignersPrecompile) RegisterSigner( + evm *EVM, + contract *Contract, + method *abi.Method, + args []interface{}, +) ([]byte, error) { + if len(args) != 2 { + return nil, ErrExecutionReverted + } + signer := args[0].(dasigners.IDASignersSignerDetail) + signature := dasigners.SerializeG1(args[1].(dasigners.BN254G1Point)) + // validation + if evm.Origin != signer.Signer { + return nil, dasigners.ErrInvalidSender + } + if contract.caller != evm.Origin { + return nil, precompiles.ErrSenderNotOrigin + } + // execute + // validate sender + // TODO: check staked + _, found, err := d.getSigner(evm, signer.Signer) + if err != nil { + return nil, err + } + if found { + return nil, dasigners.ErrSignerExists + } + // validate signature + chainID := evm.chainConfig.ChainID + hash := dasigners.PubkeyRegistrationHash(signer.Signer, chainID) + if !dasigners.ValidateSignature(signer, hash, bn254util.DeserializeG1(signature)) { + return nil, dasigners.ErrInvalidSignature + } + // save signer + if err := d.setSigner(evm, signer); err != nil { + return nil, err + } + // emit events + err = d.EmitNewSignerEvent(evm, signer) + if err != nil { + return nil, err + } + return method.Outputs.Pack() +} + +func (d *DASignersPrecompile) epochRegistration(evm *EVM, epoch uint64) uint64 { + return evm.StateDB.GetState(d.Address(), dasigners.EpochRegistrationKey(epoch)).Big().Uint64() +} + +func (d *DASignersPrecompile) epochRegisteredSigner(evm *EVM, epoch uint64, index uint64) common.Address { + h := evm.StateDB.GetState(d.Address(), dasigners.EpochRegisteredSignerKey(epoch, index)) + return common.Address(h[12:]) +} + +func (d *DASignersPrecompile) storeRegistration(evm *EVM, epoch uint64, signer common.Address, signature []byte) error { + if _, found := d.getRegistration(evm, epoch, signer); found { + return nil + } + // save signature hash + evm.StateDB.SetState(d.Address(), dasigners.RegistrationKey(epoch, signer), crypto.Keccak256Hash(signature)) + // increment epoch registration count + registration := d.epochRegistration(evm, epoch) + evm.StateDB.SetState(d.Address(), dasigners.EpochRegistrationKey(epoch), common.BigToHash(big.NewInt(int64(registration+1)))) + // save registered signer address + evm.StateDB.SetState(d.Address(), dasigners.EpochRegisteredSignerKey(epoch, registration), common.BytesToHash(signer.Bytes())) + return nil +} + +func (d *DASignersPrecompile) RegisterNextEpoch( + evm *EVM, + contract *Contract, + method *abi.Method, + args []interface{}, +) ([]byte, error) { + if len(args) != 1 { + return nil, ErrExecutionReverted + } + signature := dasigners.SerializeG1(args[0].(dasigners.BN254G1Point)) + // validation + if contract.caller != evm.Origin { + return nil, precompiles.ErrSenderNotOrigin + } + // execute + // get signer + // TODO: check staked + signer, found, err := d.getSigner(evm, contract.caller) + if err != nil { + return nil, err + } + if !found { + return nil, dasigners.ErrSignerNotFound + } + // validate signature + epochNumber := d.epochNumber(evm) + chainID := evm.chainConfig.ChainID + hash := dasigners.EpochRegistrationHash(contract.caller, epochNumber+1, chainID) + if !dasigners.ValidateSignature(signer, hash, bn254util.DeserializeG1(signature)) { + return nil, dasigners.ErrInvalidSignature + } + // save registration + if err := d.storeRegistration(evm, epochNumber+1, contract.caller, signature); err != nil { + return nil, err + } + return method.Outputs.Pack() +} + +func (d *DASignersPrecompile) UpdateSocket( + evm *EVM, + contract *Contract, + method *abi.Method, + args []interface{}, +) ([]byte, error) { + if len(args) != 1 { + return nil, ErrExecutionReverted + } + socket := args[0].(string) + // validation + if contract.caller != evm.Origin { + return nil, precompiles.ErrSenderNotOrigin + } + // execute + signer, found, err := d.getSigner(evm, contract.caller) + if err != nil { + return nil, err + } + if !found { + return nil, dasigners.ErrSignerNotFound + } + signer.Socket = socket + if err := d.setSigner(evm, signer); err != nil { + return nil, err + } + // emit events + err = d.EmitSocketUpdatedEvent(evm, contract.caller, socket) + if err != nil { + return nil, err + } + return method.Outputs.Pack() +} + +func (d *DASignersPrecompile) params() dasigners.IDASignersParams { + return dasigners.IDASignersParams{ + TokensPerVote: big.NewInt(10), + MaxVotesPerSigner: big.NewInt(1024), + MaxQuorums: big.NewInt(10), + EpochBlocks: big.NewInt(5760), + EncodedSlices: big.NewInt(3072), + } +} + +func (d *DASignersPrecompile) Params(evm *EVM, method *abi.Method, _ []interface{}) ([]byte, error) { + return method.Outputs.Pack(d.params()) +} + +func (d *DASignersPrecompile) epochBlock(evm *EVM, epoch uint64) uint64 { + return evm.StateDB.GetState(d.Address(), dasigners.EpochBlockKey(epoch)).Big().Uint64() +} + +func (d *DASignersPrecompile) epochNumber(evm *EVM) uint64 { + return evm.StateDB.GetState(d.Address(), dasigners.EpochNumberKey()).Big().Uint64() +} + +func (d *DASignersPrecompile) EpochNumber(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 0 { + return nil, ErrExecutionReverted + } + return method.Outputs.Pack(big.NewInt(int64(d.epochNumber(evm)))) +} + +func (d *DASignersPrecompile) quorumCount(evm *EVM, epochNumber uint64) uint64 { + return evm.StateDB.GetState(d.Address(), dasigners.QuorumCountKey(epochNumber)).Big().Uint64() +} + +func (d *DASignersPrecompile) QuorumCount(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 1 { + return nil, ErrExecutionReverted + } + epochNumber := args[0].(*big.Int).Uint64() + return method.Outputs.Pack(big.NewInt(int64(d.quorumCount(evm, epochNumber)))) +} + +func (d *DASignersPrecompile) getSigner(evm *EVM, account common.Address) (dasigners.IDASignersSignerDetail, bool, error) { + b := LoadBytes(evm.StateDB, d.Address(), dasigners.SignerKey(account)) + if len(b) == 0 { + return dasigners.IDASignersSignerDetail{}, false, nil + } + + var signer dasigners.IDASignersSignerDetail + err := msgpack.Unmarshal(b, &signer) + if err != nil { + return dasigners.IDASignersSignerDetail{}, false, err + } + return signer, false, nil +} + +func (d *DASignersPrecompile) GetSigner(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 1 { + return nil, ErrExecutionReverted + } + accounts := args[0].([]common.Address) + signers := make([]dasigners.IDASignersSignerDetail, len(accounts)) + for i, account := range accounts { + signer, found, err := d.getSigner(evm, account) + if err != nil { + return nil, err + } + if !found { + return nil, dasigners.ErrSignerNotFound + } + signers[i] = signer + } + return method.Outputs.Pack(signers) +} + +func (d *DASignersPrecompile) IsSigner(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 1 { + return nil, ErrExecutionReverted + } + account := args[0].(common.Address) + _, found, err := d.getSigner(evm, account) + if err != nil { + return nil, err + } + return method.Outputs.Pack(found) +} + +func (d *DASignersPrecompile) getRegistration(evm *EVM, epoch uint64, account common.Address) ([]byte, bool) { + h := evm.StateDB.GetState(d.Address(), dasigners.RegistrationKey(epoch, account)) + if h == (common.Hash{}) { + return nil, false + } + return h.Bytes(), true +} + +func (d *DASignersPrecompile) RegisteredEpoch(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 2 { + return nil, ErrExecutionReverted + } + account := args[0].(common.Address) + epoch := args[1].(*big.Int).Uint64() + _, found := d.getRegistration(evm, epoch, account) + return method.Outputs.Pack(found) +} + +func (d *DASignersPrecompile) getQuorum(evm *EVM, epochNumber uint64, quorumId uint64) ([]common.Address, error) { + if d.quorumCount(evm, epochNumber) <= quorumId { + return nil, dasigners.ErrQuorumIdOutOfBound + } + if d.epochNumber(evm) < epochNumber { + return nil, dasigners.ErrEpochOutOfBound + } + b := LoadBytes(evm.StateDB, d.Address(), dasigners.QuorumKey(epochNumber, quorumId)) + var quorum []common.Address + err := msgpack.Unmarshal(b, &quorum) + if err != nil { + return nil, err + } + return quorum, nil +} + +func (d *DASignersPrecompile) GetQuorum(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 2 { + return nil, ErrExecutionReverted + } + epochNumber := args[0].(*big.Int).Uint64() + quorumId := args[1].(*big.Int).Uint64() + quorum, err := d.getQuorum(evm, epochNumber, quorumId) + if err != nil { + return nil, err + } + return method.Outputs.Pack(quorum) +} + +func (d *DASignersPrecompile) GetQuorumRow(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 3 { + return nil, ErrExecutionReverted + } + epochNumber := args[0].(*big.Int).Uint64() + quorumId := args[1].(*big.Int).Uint64() + rowIndex := args[2].(uint32) + quorum, err := d.getQuorum(evm, epochNumber, quorumId) + if err != nil { + return nil, err + } + if int(rowIndex) >= len(quorum) { + return nil, dasigners.ErrRowIdOfBound + } + return method.Outputs.Pack(quorum[rowIndex]) +} + +func (d *DASignersPrecompile) getAggPkG1( + evm *EVM, + epochNumber uint64, + quorumId uint64, + quorumBitmap []byte, +) (dasigners.BN254G1Point, *big.Int, *big.Int, error) { + quorum, err := d.getQuorum(evm, epochNumber, quorumId) + if err != nil { + return dasigners.BN254G1Point{}, nil, nil, err + } + if (len(quorum)+7)/8 != len(quorumBitmap) { + return dasigners.BN254G1Point{}, nil, nil, dasigners.ErrQuorumBitmapLengthMismatch + } + aggPubkeyG1 := new(bn254.G1Affine) + hit := 0 + added := make(map[common.Address]struct{}) + for i, signer := range quorum { + if _, ok := added[signer]; ok { + hit += 1 + continue + } + b := quorumBitmap[i/8] & (1 << (i % 8)) + if b == 0 { + continue + } + hit += 1 + added[signer] = struct{}{} + signer, found, err := d.getSigner(evm, signer) + if err != nil { + return dasigners.BN254G1Point{}, nil, nil, err + } + if !found { + return dasigners.BN254G1Point{}, nil, nil, dasigners.ErrSignerNotFound + } + aggPubkeyG1.Add(aggPubkeyG1, bn254util.DeserializeG1(dasigners.SerializeG1(signer.PkG1))) + } + return dasigners.NewBN254G1Point(bn254util.SerializeG1(aggPubkeyG1)), big.NewInt(int64(len(quorum))), big.NewInt(int64(hit)), nil +} + +func (d *DASignersPrecompile) GetAggPkG1(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 3 { + return nil, ErrExecutionReverted + } + epochNumber := args[0].(*big.Int).Uint64() + quorumId := args[1].(*big.Int).Uint64() + quorumBitmap := args[2].([]byte) + aggPkG1, total, hit, err := d.getAggPkG1(evm, epochNumber, quorumId, quorumBitmap) + if err != nil { + return nil, err + } + return method.Outputs.Pack(aggPkG1, total, hit) +} diff --git a/core/vm/precompiles/dasigners/contract.go b/core/vm/precompiles/dasigners/contract.go new file mode 100644 index 0000000000..5b01731c38 --- /dev/null +++ b/core/vm/precompiles/dasigners/contract.go @@ -0,0 +1,882 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package dasigners + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// BN254G1Point is an auto generated low-level Go binding around an user-defined struct. +type BN254G1Point struct { + X *big.Int + Y *big.Int +} + +// BN254G2Point is an auto generated low-level Go binding around an user-defined struct. +type BN254G2Point struct { + X [2]*big.Int + Y [2]*big.Int +} + +// IDASignersParams is an auto generated low-level Go binding around an user-defined struct. +type IDASignersParams struct { + TokensPerVote *big.Int + MaxVotesPerSigner *big.Int + MaxQuorums *big.Int + EpochBlocks *big.Int + EncodedSlices *big.Int +} + +// IDASignersSignerDetail is an auto generated low-level Go binding around an user-defined struct. +type IDASignersSignerDetail struct { + Signer common.Address + Socket string + PkG1 BN254G1Point + PkG2 BN254G2Point +} + +// DASignersMetaData contains all meta data concerning the DASigners contract. +var DASignersMetaData = &bind.MetaData{ + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"makeEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"structIDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// DASignersABI is the input ABI used to generate the binding from. +// Deprecated: Use DASignersMetaData.ABI instead. +var DASignersABI = DASignersMetaData.ABI + +// DASigners is an auto generated Go binding around an Ethereum contract. +type DASigners struct { + DASignersCaller // Read-only binding to the contract + DASignersTransactor // Write-only binding to the contract + DASignersFilterer // Log filterer for contract events +} + +// DASignersCaller is an auto generated read-only Go binding around an Ethereum contract. +type DASignersCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DASignersTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DASignersTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DASignersFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DASignersFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DASignersSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DASignersSession struct { + Contract *DASigners // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DASignersCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DASignersCallerSession struct { + Contract *DASignersCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DASignersTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DASignersTransactorSession struct { + Contract *DASignersTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DASignersRaw is an auto generated low-level Go binding around an Ethereum contract. +type DASignersRaw struct { + Contract *DASigners // Generic contract binding to access the raw methods on +} + +// DASignersCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DASignersCallerRaw struct { + Contract *DASignersCaller // Generic read-only contract binding to access the raw methods on +} + +// DASignersTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DASignersTransactorRaw struct { + Contract *DASignersTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDASigners creates a new instance of DASigners, bound to a specific deployed contract. +func NewDASigners(address common.Address, backend bind.ContractBackend) (*DASigners, error) { + contract, err := bindDASigners(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DASigners{DASignersCaller: DASignersCaller{contract: contract}, DASignersTransactor: DASignersTransactor{contract: contract}, DASignersFilterer: DASignersFilterer{contract: contract}}, nil +} + +// NewDASignersCaller creates a new read-only instance of DASigners, bound to a specific deployed contract. +func NewDASignersCaller(address common.Address, caller bind.ContractCaller) (*DASignersCaller, error) { + contract, err := bindDASigners(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DASignersCaller{contract: contract}, nil +} + +// NewDASignersTransactor creates a new write-only instance of DASigners, bound to a specific deployed contract. +func NewDASignersTransactor(address common.Address, transactor bind.ContractTransactor) (*DASignersTransactor, error) { + contract, err := bindDASigners(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DASignersTransactor{contract: contract}, nil +} + +// NewDASignersFilterer creates a new log filterer instance of DASigners, bound to a specific deployed contract. +func NewDASignersFilterer(address common.Address, filterer bind.ContractFilterer) (*DASignersFilterer, error) { + contract, err := bindDASigners(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DASignersFilterer{contract: contract}, nil +} + +// bindDASigners binds a generic wrapper to an already deployed contract. +func bindDASigners(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DASignersABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DASigners *DASignersRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DASigners.Contract.DASignersCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DASigners *DASignersRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DASigners.Contract.DASignersTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DASigners *DASignersRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DASigners.Contract.DASignersTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_DASigners *DASignersCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _DASigners.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_DASigners *DASignersTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DASigners.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DASigners *DASignersTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DASigners.Contract.contract.Transact(opts, method, params...) +} + +// EpochNumber is a free data retrieval call binding the contract method 0xf4145a83. +// +// Solidity: function epochNumber() view returns(uint256) +func (_DASigners *DASignersCaller) EpochNumber(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "epochNumber") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// EpochNumber is a free data retrieval call binding the contract method 0xf4145a83. +// +// Solidity: function epochNumber() view returns(uint256) +func (_DASigners *DASignersSession) EpochNumber() (*big.Int, error) { + return _DASigners.Contract.EpochNumber(&_DASigners.CallOpts) +} + +// EpochNumber is a free data retrieval call binding the contract method 0xf4145a83. +// +// Solidity: function epochNumber() view returns(uint256) +func (_DASigners *DASignersCallerSession) EpochNumber() (*big.Int, error) { + return _DASigners.Contract.EpochNumber(&_DASigners.CallOpts) +} + +// GetAggPkG1 is a free data retrieval call binding the contract method 0x50b73739. +// +// Solidity: function getAggPkG1(uint256 _epoch, uint256 _quorumId, bytes _quorumBitmap) view returns((uint256,uint256) aggPkG1, uint256 total, uint256 hit) +func (_DASigners *DASignersCaller) GetAggPkG1(opts *bind.CallOpts, _epoch *big.Int, _quorumId *big.Int, _quorumBitmap []byte) (struct { + AggPkG1 BN254G1Point + Total *big.Int + Hit *big.Int +}, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "getAggPkG1", _epoch, _quorumId, _quorumBitmap) + + outstruct := new(struct { + AggPkG1 BN254G1Point + Total *big.Int + Hit *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.AggPkG1 = *abi.ConvertType(out[0], new(BN254G1Point)).(*BN254G1Point) + outstruct.Total = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.Hit = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// GetAggPkG1 is a free data retrieval call binding the contract method 0x50b73739. +// +// Solidity: function getAggPkG1(uint256 _epoch, uint256 _quorumId, bytes _quorumBitmap) view returns((uint256,uint256) aggPkG1, uint256 total, uint256 hit) +func (_DASigners *DASignersSession) GetAggPkG1(_epoch *big.Int, _quorumId *big.Int, _quorumBitmap []byte) (struct { + AggPkG1 BN254G1Point + Total *big.Int + Hit *big.Int +}, error) { + return _DASigners.Contract.GetAggPkG1(&_DASigners.CallOpts, _epoch, _quorumId, _quorumBitmap) +} + +// GetAggPkG1 is a free data retrieval call binding the contract method 0x50b73739. +// +// Solidity: function getAggPkG1(uint256 _epoch, uint256 _quorumId, bytes _quorumBitmap) view returns((uint256,uint256) aggPkG1, uint256 total, uint256 hit) +func (_DASigners *DASignersCallerSession) GetAggPkG1(_epoch *big.Int, _quorumId *big.Int, _quorumBitmap []byte) (struct { + AggPkG1 BN254G1Point + Total *big.Int + Hit *big.Int +}, error) { + return _DASigners.Contract.GetAggPkG1(&_DASigners.CallOpts, _epoch, _quorumId, _quorumBitmap) +} + +// GetQuorum is a free data retrieval call binding the contract method 0x6ab6f654. +// +// Solidity: function getQuorum(uint256 _epoch, uint256 _quorumId) view returns(address[]) +func (_DASigners *DASignersCaller) GetQuorum(opts *bind.CallOpts, _epoch *big.Int, _quorumId *big.Int) ([]common.Address, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "getQuorum", _epoch, _quorumId) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetQuorum is a free data retrieval call binding the contract method 0x6ab6f654. +// +// Solidity: function getQuorum(uint256 _epoch, uint256 _quorumId) view returns(address[]) +func (_DASigners *DASignersSession) GetQuorum(_epoch *big.Int, _quorumId *big.Int) ([]common.Address, error) { + return _DASigners.Contract.GetQuorum(&_DASigners.CallOpts, _epoch, _quorumId) +} + +// GetQuorum is a free data retrieval call binding the contract method 0x6ab6f654. +// +// Solidity: function getQuorum(uint256 _epoch, uint256 _quorumId) view returns(address[]) +func (_DASigners *DASignersCallerSession) GetQuorum(_epoch *big.Int, _quorumId *big.Int) ([]common.Address, error) { + return _DASigners.Contract.GetQuorum(&_DASigners.CallOpts, _epoch, _quorumId) +} + +// GetQuorumRow is a free data retrieval call binding the contract method 0xfa6fcba6. +// +// Solidity: function getQuorumRow(uint256 _epoch, uint256 _quorumId, uint32 _rowIndex) view returns(address) +func (_DASigners *DASignersCaller) GetQuorumRow(opts *bind.CallOpts, _epoch *big.Int, _quorumId *big.Int, _rowIndex uint32) (common.Address, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "getQuorumRow", _epoch, _quorumId, _rowIndex) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetQuorumRow is a free data retrieval call binding the contract method 0xfa6fcba6. +// +// Solidity: function getQuorumRow(uint256 _epoch, uint256 _quorumId, uint32 _rowIndex) view returns(address) +func (_DASigners *DASignersSession) GetQuorumRow(_epoch *big.Int, _quorumId *big.Int, _rowIndex uint32) (common.Address, error) { + return _DASigners.Contract.GetQuorumRow(&_DASigners.CallOpts, _epoch, _quorumId, _rowIndex) +} + +// GetQuorumRow is a free data retrieval call binding the contract method 0xfa6fcba6. +// +// Solidity: function getQuorumRow(uint256 _epoch, uint256 _quorumId, uint32 _rowIndex) view returns(address) +func (_DASigners *DASignersCallerSession) GetQuorumRow(_epoch *big.Int, _quorumId *big.Int, _rowIndex uint32) (common.Address, error) { + return _DASigners.Contract.GetQuorumRow(&_DASigners.CallOpts, _epoch, _quorumId, _rowIndex) +} + +// GetSigner is a free data retrieval call binding the contract method 0xd1f5e5f8. +// +// Solidity: function getSigner(address[] _account) view returns((address,string,(uint256,uint256),(uint256[2],uint256[2]))[]) +func (_DASigners *DASignersCaller) GetSigner(opts *bind.CallOpts, _account []common.Address) ([]IDASignersSignerDetail, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "getSigner", _account) + + if err != nil { + return *new([]IDASignersSignerDetail), err + } + + out0 := *abi.ConvertType(out[0], new([]IDASignersSignerDetail)).(*[]IDASignersSignerDetail) + + return out0, err + +} + +// GetSigner is a free data retrieval call binding the contract method 0xd1f5e5f8. +// +// Solidity: function getSigner(address[] _account) view returns((address,string,(uint256,uint256),(uint256[2],uint256[2]))[]) +func (_DASigners *DASignersSession) GetSigner(_account []common.Address) ([]IDASignersSignerDetail, error) { + return _DASigners.Contract.GetSigner(&_DASigners.CallOpts, _account) +} + +// GetSigner is a free data retrieval call binding the contract method 0xd1f5e5f8. +// +// Solidity: function getSigner(address[] _account) view returns((address,string,(uint256,uint256),(uint256[2],uint256[2]))[]) +func (_DASigners *DASignersCallerSession) GetSigner(_account []common.Address) ([]IDASignersSignerDetail, error) { + return _DASigners.Contract.GetSigner(&_DASigners.CallOpts, _account) +} + +// IsSigner is a free data retrieval call binding the contract method 0x7df73e27. +// +// Solidity: function isSigner(address _account) view returns(bool) +func (_DASigners *DASignersCaller) IsSigner(opts *bind.CallOpts, _account common.Address) (bool, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "isSigner", _account) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsSigner is a free data retrieval call binding the contract method 0x7df73e27. +// +// Solidity: function isSigner(address _account) view returns(bool) +func (_DASigners *DASignersSession) IsSigner(_account common.Address) (bool, error) { + return _DASigners.Contract.IsSigner(&_DASigners.CallOpts, _account) +} + +// IsSigner is a free data retrieval call binding the contract method 0x7df73e27. +// +// Solidity: function isSigner(address _account) view returns(bool) +func (_DASigners *DASignersCallerSession) IsSigner(_account common.Address) (bool, error) { + return _DASigners.Contract.IsSigner(&_DASigners.CallOpts, _account) +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns((uint256,uint256,uint256,uint256,uint256)) +func (_DASigners *DASignersCaller) Params(opts *bind.CallOpts) (IDASignersParams, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "params") + + if err != nil { + return *new(IDASignersParams), err + } + + out0 := *abi.ConvertType(out[0], new(IDASignersParams)).(*IDASignersParams) + + return out0, err + +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns((uint256,uint256,uint256,uint256,uint256)) +func (_DASigners *DASignersSession) Params() (IDASignersParams, error) { + return _DASigners.Contract.Params(&_DASigners.CallOpts) +} + +// Params is a free data retrieval call binding the contract method 0xcff0ab96. +// +// Solidity: function params() view returns((uint256,uint256,uint256,uint256,uint256)) +func (_DASigners *DASignersCallerSession) Params() (IDASignersParams, error) { + return _DASigners.Contract.Params(&_DASigners.CallOpts) +} + +// QuorumCount is a free data retrieval call binding the contract method 0x5ecba503. +// +// Solidity: function quorumCount(uint256 _epoch) view returns(uint256) +func (_DASigners *DASignersCaller) QuorumCount(opts *bind.CallOpts, _epoch *big.Int) (*big.Int, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "quorumCount", _epoch) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// QuorumCount is a free data retrieval call binding the contract method 0x5ecba503. +// +// Solidity: function quorumCount(uint256 _epoch) view returns(uint256) +func (_DASigners *DASignersSession) QuorumCount(_epoch *big.Int) (*big.Int, error) { + return _DASigners.Contract.QuorumCount(&_DASigners.CallOpts, _epoch) +} + +// QuorumCount is a free data retrieval call binding the contract method 0x5ecba503. +// +// Solidity: function quorumCount(uint256 _epoch) view returns(uint256) +func (_DASigners *DASignersCallerSession) QuorumCount(_epoch *big.Int) (*big.Int, error) { + return _DASigners.Contract.QuorumCount(&_DASigners.CallOpts, _epoch) +} + +// RegisteredEpoch is a free data retrieval call binding the contract method 0x6c9e560c. +// +// Solidity: function registeredEpoch(address _account, uint256 _epoch) view returns(bool) +func (_DASigners *DASignersCaller) RegisteredEpoch(opts *bind.CallOpts, _account common.Address, _epoch *big.Int) (bool, error) { + var out []interface{} + err := _DASigners.contract.Call(opts, &out, "registeredEpoch", _account, _epoch) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// RegisteredEpoch is a free data retrieval call binding the contract method 0x6c9e560c. +// +// Solidity: function registeredEpoch(address _account, uint256 _epoch) view returns(bool) +func (_DASigners *DASignersSession) RegisteredEpoch(_account common.Address, _epoch *big.Int) (bool, error) { + return _DASigners.Contract.RegisteredEpoch(&_DASigners.CallOpts, _account, _epoch) +} + +// RegisteredEpoch is a free data retrieval call binding the contract method 0x6c9e560c. +// +// Solidity: function registeredEpoch(address _account, uint256 _epoch) view returns(bool) +func (_DASigners *DASignersCallerSession) RegisteredEpoch(_account common.Address, _epoch *big.Int) (bool, error) { + return _DASigners.Contract.RegisteredEpoch(&_DASigners.CallOpts, _account, _epoch) +} + +// MakeEpoch is a paid mutator transaction binding the contract method 0x5a889f0c. +// +// Solidity: function makeEpoch() returns() +func (_DASigners *DASignersTransactor) MakeEpoch(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DASigners.contract.Transact(opts, "makeEpoch") +} + +// MakeEpoch is a paid mutator transaction binding the contract method 0x5a889f0c. +// +// Solidity: function makeEpoch() returns() +func (_DASigners *DASignersSession) MakeEpoch() (*types.Transaction, error) { + return _DASigners.Contract.MakeEpoch(&_DASigners.TransactOpts) +} + +// MakeEpoch is a paid mutator transaction binding the contract method 0x5a889f0c. +// +// Solidity: function makeEpoch() returns() +func (_DASigners *DASignersTransactorSession) MakeEpoch() (*types.Transaction, error) { + return _DASigners.Contract.MakeEpoch(&_DASigners.TransactOpts) +} + +// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x56a32372. +// +// Solidity: function registerNextEpoch((uint256,uint256) _signature) returns() +func (_DASigners *DASignersTransactor) RegisterNextEpoch(opts *bind.TransactOpts, _signature BN254G1Point) (*types.Transaction, error) { + return _DASigners.contract.Transact(opts, "registerNextEpoch", _signature) +} + +// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x56a32372. +// +// Solidity: function registerNextEpoch((uint256,uint256) _signature) returns() +func (_DASigners *DASignersSession) RegisterNextEpoch(_signature BN254G1Point) (*types.Transaction, error) { + return _DASigners.Contract.RegisterNextEpoch(&_DASigners.TransactOpts, _signature) +} + +// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x56a32372. +// +// Solidity: function registerNextEpoch((uint256,uint256) _signature) returns() +func (_DASigners *DASignersTransactorSession) RegisterNextEpoch(_signature BN254G1Point) (*types.Transaction, error) { + return _DASigners.Contract.RegisterNextEpoch(&_DASigners.TransactOpts, _signature) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0x7ca4dd5e. +// +// Solidity: function registerSigner((address,string,(uint256,uint256),(uint256[2],uint256[2])) _signer, (uint256,uint256) _signature) returns() +func (_DASigners *DASignersTransactor) RegisterSigner(opts *bind.TransactOpts, _signer IDASignersSignerDetail, _signature BN254G1Point) (*types.Transaction, error) { + return _DASigners.contract.Transact(opts, "registerSigner", _signer, _signature) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0x7ca4dd5e. +// +// Solidity: function registerSigner((address,string,(uint256,uint256),(uint256[2],uint256[2])) _signer, (uint256,uint256) _signature) returns() +func (_DASigners *DASignersSession) RegisterSigner(_signer IDASignersSignerDetail, _signature BN254G1Point) (*types.Transaction, error) { + return _DASigners.Contract.RegisterSigner(&_DASigners.TransactOpts, _signer, _signature) +} + +// RegisterSigner is a paid mutator transaction binding the contract method 0x7ca4dd5e. +// +// Solidity: function registerSigner((address,string,(uint256,uint256),(uint256[2],uint256[2])) _signer, (uint256,uint256) _signature) returns() +func (_DASigners *DASignersTransactorSession) RegisterSigner(_signer IDASignersSignerDetail, _signature BN254G1Point) (*types.Transaction, error) { + return _DASigners.Contract.RegisterSigner(&_DASigners.TransactOpts, _signer, _signature) +} + +// UpdateSocket is a paid mutator transaction binding the contract method 0x0cf4b767. +// +// Solidity: function updateSocket(string _socket) returns() +func (_DASigners *DASignersTransactor) UpdateSocket(opts *bind.TransactOpts, _socket string) (*types.Transaction, error) { + return _DASigners.contract.Transact(opts, "updateSocket", _socket) +} + +// UpdateSocket is a paid mutator transaction binding the contract method 0x0cf4b767. +// +// Solidity: function updateSocket(string _socket) returns() +func (_DASigners *DASignersSession) UpdateSocket(_socket string) (*types.Transaction, error) { + return _DASigners.Contract.UpdateSocket(&_DASigners.TransactOpts, _socket) +} + +// UpdateSocket is a paid mutator transaction binding the contract method 0x0cf4b767. +// +// Solidity: function updateSocket(string _socket) returns() +func (_DASigners *DASignersTransactorSession) UpdateSocket(_socket string) (*types.Transaction, error) { + return _DASigners.Contract.UpdateSocket(&_DASigners.TransactOpts, _socket) +} + +// DASignersNewSignerIterator is returned from FilterNewSigner and is used to iterate over the raw logs and unpacked data for NewSigner events raised by the DASigners contract. +type DASignersNewSignerIterator struct { + Event *DASignersNewSigner // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *DASignersNewSignerIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DASignersNewSigner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DASignersNewSigner) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DASignersNewSignerIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DASignersNewSignerIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DASignersNewSigner represents a NewSigner event raised by the DASigners contract. +type DASignersNewSigner struct { + Signer common.Address + PkG1 BN254G1Point + PkG2 BN254G2Point + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewSigner is a free log retrieval operation binding the contract event 0x679917c2006df1daaa987a56bf1d66e99764d5ad317892d9e83a6eb4e3f051e7. +// +// Solidity: event NewSigner(address indexed signer, (uint256,uint256) pkG1, (uint256[2],uint256[2]) pkG2) +func (_DASigners *DASignersFilterer) FilterNewSigner(opts *bind.FilterOpts, signer []common.Address) (*DASignersNewSignerIterator, error) { + + var signerRule []interface{} + for _, signerItem := range signer { + signerRule = append(signerRule, signerItem) + } + + logs, sub, err := _DASigners.contract.FilterLogs(opts, "NewSigner", signerRule) + if err != nil { + return nil, err + } + return &DASignersNewSignerIterator{contract: _DASigners.contract, event: "NewSigner", logs: logs, sub: sub}, nil +} + +// WatchNewSigner is a free log subscription operation binding the contract event 0x679917c2006df1daaa987a56bf1d66e99764d5ad317892d9e83a6eb4e3f051e7. +// +// Solidity: event NewSigner(address indexed signer, (uint256,uint256) pkG1, (uint256[2],uint256[2]) pkG2) +func (_DASigners *DASignersFilterer) WatchNewSigner(opts *bind.WatchOpts, sink chan<- *DASignersNewSigner, signer []common.Address) (event.Subscription, error) { + + var signerRule []interface{} + for _, signerItem := range signer { + signerRule = append(signerRule, signerItem) + } + + logs, sub, err := _DASigners.contract.WatchLogs(opts, "NewSigner", signerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DASignersNewSigner) + if err := _DASigners.contract.UnpackLog(event, "NewSigner", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseNewSigner is a log parse operation binding the contract event 0x679917c2006df1daaa987a56bf1d66e99764d5ad317892d9e83a6eb4e3f051e7. +// +// Solidity: event NewSigner(address indexed signer, (uint256,uint256) pkG1, (uint256[2],uint256[2]) pkG2) +func (_DASigners *DASignersFilterer) ParseNewSigner(log types.Log) (*DASignersNewSigner, error) { + event := new(DASignersNewSigner) + if err := _DASigners.contract.UnpackLog(event, "NewSigner", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// DASignersSocketUpdatedIterator is returned from FilterSocketUpdated and is used to iterate over the raw logs and unpacked data for SocketUpdated events raised by the DASigners contract. +type DASignersSocketUpdatedIterator struct { + Event *DASignersSocketUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *DASignersSocketUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(DASignersSocketUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(DASignersSocketUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *DASignersSocketUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DASignersSocketUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DASignersSocketUpdated represents a SocketUpdated event raised by the DASigners contract. +type DASignersSocketUpdated struct { + Signer common.Address + Socket string + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSocketUpdated is a free log retrieval operation binding the contract event 0x09617a966176a40f8f1410768b118506db0096484acd5811064fcc12038798de. +// +// Solidity: event SocketUpdated(address indexed signer, string socket) +func (_DASigners *DASignersFilterer) FilterSocketUpdated(opts *bind.FilterOpts, signer []common.Address) (*DASignersSocketUpdatedIterator, error) { + + var signerRule []interface{} + for _, signerItem := range signer { + signerRule = append(signerRule, signerItem) + } + + logs, sub, err := _DASigners.contract.FilterLogs(opts, "SocketUpdated", signerRule) + if err != nil { + return nil, err + } + return &DASignersSocketUpdatedIterator{contract: _DASigners.contract, event: "SocketUpdated", logs: logs, sub: sub}, nil +} + +// WatchSocketUpdated is a free log subscription operation binding the contract event 0x09617a966176a40f8f1410768b118506db0096484acd5811064fcc12038798de. +// +// Solidity: event SocketUpdated(address indexed signer, string socket) +func (_DASigners *DASignersFilterer) WatchSocketUpdated(opts *bind.WatchOpts, sink chan<- *DASignersSocketUpdated, signer []common.Address) (event.Subscription, error) { + + var signerRule []interface{} + for _, signerItem := range signer { + signerRule = append(signerRule, signerItem) + } + + logs, sub, err := _DASigners.contract.WatchLogs(opts, "SocketUpdated", signerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(DASignersSocketUpdated) + if err := _DASigners.contract.UnpackLog(event, "SocketUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSocketUpdated is a log parse operation binding the contract event 0x09617a966176a40f8f1410768b118506db0096484acd5811064fcc12038798de. +// +// Solidity: event SocketUpdated(address indexed signer, string socket) +func (_DASigners *DASignersFilterer) ParseSocketUpdated(log types.Log) (*DASignersSocketUpdated, error) { + event := new(DASignersSocketUpdated) + if err := _DASigners.contract.UnpackLog(event, "SocketUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/core/vm/precompiles/dasigners/errors.go b/core/vm/precompiles/dasigners/errors.go new file mode 100644 index 0000000000..e500a41403 --- /dev/null +++ b/core/vm/precompiles/dasigners/errors.go @@ -0,0 +1,14 @@ +package dasigners + +import "errors" + +var ( + ErrQuorumIdOutOfBound = errors.New("quorum id out of bound") + ErrEpochOutOfBound = errors.New("epoch out of bound") + ErrRowIdOfBound = errors.New("row id out of bound") + ErrQuorumBitmapLengthMismatch = errors.New("quorum bitmap length mismatch") + ErrSignerNotFound = errors.New("signer not found") + ErrInvalidSender = errors.New("invalid sender") + ErrSignerExists = errors.New("signer exists") + ErrInvalidSignature = errors.New("invalid signature") +) diff --git a/core/vm/precompiles/dasigners/signature.go b/core/vm/precompiles/dasigners/signature.go new file mode 100644 index 0000000000..380367a355 --- /dev/null +++ b/core/vm/precompiles/dasigners/signature.go @@ -0,0 +1,63 @@ +package dasigners + +import ( + "math/big" + + "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bn254util" + "github.com/ethereum/go-ethereum/crypto" +) + +func PubkeyRegistrationHash(operatorAddress common.Address, chainId *big.Int) *bn254.G1Affine { + toHash := make([]byte, 0) + toHash = append(toHash, operatorAddress.Bytes()...) + // make sure chainId is 32 bytes + toHash = append(toHash, common.LeftPadBytes(chainId.Bytes(), 32)...) + toHash = append(toHash, []byte("0G_BN254_Pubkey_Registration")...) + + msgHash := crypto.Keccak256(toHash) + // convert to [32]byte + var msgHash32 [32]byte + copy(msgHash32[:], msgHash) + + // hash to G1 + return bn254util.MapToCurve(msgHash32) +} + +func EpochRegistrationHash(operatorAddress common.Address, epoch uint64, chainId *big.Int) *bn254.G1Affine { + toHash := make([]byte, 0) + toHash = append(toHash, operatorAddress.Bytes()...) + toHash = append(toHash, common.Uint64ToBytes(epoch)...) + toHash = append(toHash, common.LeftPadBytes(chainId.Bytes(), 32)...) + + msgHash := crypto.Keccak256(toHash) + // convert to [32]byte + var msgHash32 [32]byte + copy(msgHash32[:], msgHash) + + // hash to G1 + return bn254util.MapToCurve(msgHash32) +} + +func ValidateSignature(s IDASignersSignerDetail, hash *bn254.G1Affine, signature *bn254.G1Affine) bool { + pubkeyG1 := bn254util.DeserializeG1(SerializeG1(s.PkG1)) + pubkeyG2 := bn254util.DeserializeG2(SerializeG2(s.PkG2)) + gamma := bn254util.Gamma(hash, signature, pubkeyG1, pubkeyG2) + + // pairing + P := [2]bn254.G1Affine{ + *new(bn254.G1Affine).Add(signature, new(bn254.G1Affine).ScalarMultiplication(pubkeyG1, gamma)), + *new(bn254.G1Affine).Add(hash, new(bn254.G1Affine).ScalarMultiplication(bn254util.GetG1Generator(), gamma)), + } + Q := [2]bn254.G2Affine{ + *new(bn254.G2Affine).Neg(bn254util.GetG2Generator()), + *pubkeyG2, + } + + ok, err := bn254.PairingCheck(P[:], Q[:]) + if err != nil { + return false + } + return ok +} diff --git a/core/vm/precompiles/dasigners/types.go b/core/vm/precompiles/dasigners/types.go new file mode 100644 index 0000000000..de4af31b92 --- /dev/null +++ b/core/vm/precompiles/dasigners/types.go @@ -0,0 +1,87 @@ +package dasigners + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" +) + +func NewBN254G1Point(b []byte) BN254G1Point { + return BN254G1Point{ + X: new(big.Int).SetBytes(b[:32]), + Y: new(big.Int).SetBytes(b[32:64]), + } +} + +func SerializeG1(p BN254G1Point) []byte { + b := make([]byte, 0) + b = append(b, common.LeftPadBytes(p.X.Bytes(), 32)...) + b = append(b, common.LeftPadBytes(p.Y.Bytes(), 32)...) + return b +} + +func NewBN254G2Point(b []byte) BN254G2Point { + return BN254G2Point{ + X: [2]*big.Int{ + new(big.Int).SetBytes(b[:32]), + new(big.Int).SetBytes(b[32:64]), + }, + Y: [2]*big.Int{ + new(big.Int).SetBytes(b[64:96]), + new(big.Int).SetBytes(b[96:128]), + }, + } +} + +func SerializeG2(p BN254G2Point) []byte { + b := make([]byte, 0) + b = append(b, common.LeftPadBytes(p.X[0].Bytes(), 32)...) + b = append(b, common.LeftPadBytes(p.X[1].Bytes(), 32)...) + b = append(b, common.LeftPadBytes(p.Y[0].Bytes(), 32)...) + b = append(b, common.LeftPadBytes(p.Y[1].Bytes(), 32)...) + return b +} + +var ( + signerKey = []byte{0x00} // signer => registered signer info + quorumKey = []byte{0x01} // epoch => quorumId => quorum + registrationKey = []byte{0x02} // signer => signature hash + quorumCountKey = []byte{0x03} // epoch => quorum count + epochNumberKey = []byte{0x04} // epoch number + epochBlockKey = []byte{0x05} // epoch number => block number + epochRegistrationKey = []byte{0x06} // epoch number => registration count + epochRegisteredSignerKey = []byte{0x07} // epoch number => index => signer +) + +func SignerKey(account common.Address) common.Hash { + return crypto.Keccak256Hash(append(quorumCountKey, account.Bytes()...)) +} + +func QuorumKey(epochNumber uint64, quorumId uint64) common.Hash { + return crypto.Keccak256Hash(append(append(quorumKey, common.Uint64ToBytes(epochNumber)...), common.Uint64ToBytes(quorumId)...)) +} + +func RegistrationKey(epochNumber uint64, account common.Address) common.Hash { + return crypto.Keccak256Hash(append(append(registrationKey, common.Uint64ToBytes(epochNumber)...), account.Bytes()...)) +} + +func QuorumCountKey(epochNumber uint64) common.Hash { + return crypto.Keccak256Hash(append(quorumCountKey, common.Uint64ToBytes(epochNumber)...)) +} + +func EpochNumberKey() common.Hash { + return crypto.Keccak256Hash(epochNumberKey) +} + +func EpochBlockKey(epochNumber uint64) common.Hash { + return crypto.Keccak256Hash(append(epochBlockKey, common.Uint64ToBytes(epochNumber)...)) +} + +func EpochRegistrationKey(epochNumber uint64) common.Hash { + return crypto.Keccak256Hash(append(epochRegistrationKey, common.Uint64ToBytes(epochNumber)...)) +} + +func EpochRegisteredSignerKey(epochNumber uint64, index uint64) common.Hash { + return crypto.Keccak256Hash(append(append(epochRegisteredSignerKey, common.Uint64ToBytes(epochNumber)...), common.Uint64ToBytes(index)...)) +} diff --git a/core/vm/precompiles/errors.go b/core/vm/precompiles/errors.go new file mode 100644 index 0000000000..c2b23b44f6 --- /dev/null +++ b/core/vm/precompiles/errors.go @@ -0,0 +1,7 @@ +package precompiles + +import "errors" + +var ( + ErrSenderNotOrigin = errors.New("sender not origin") +) diff --git a/core/vm/precompiles/interfaces/.solhint.json b/core/vm/precompiles/interfaces/.solhint.json new file mode 100644 index 0000000000..47c4d151bc --- /dev/null +++ b/core/vm/precompiles/interfaces/.solhint.json @@ -0,0 +1,18 @@ +{ + "extends": "solhint:recommended", + "plugins": ["prettier"], + "rules": { + "avoid-low-level-calls": "off", + "compiler-version": "off", + "gas-custom-errors": "off", + "explicit-types": ["warn", "implicit"], + "func-visibility": ["warn", { "ignoreConstructors": true }], + "max-states-count": "off", + "no-empty-blocks": "off", + "no-global-import": "off", + "no-inline-assembly": "off", + "not-rely-on-time": "off", + "prettier/prettier": "error", + "reason-string": "off" + } +} diff --git a/core/vm/precompiles/interfaces/abis/IDASigners.json b/core/vm/precompiles/interfaces/abis/IDASigners.json new file mode 100644 index 0000000000..d75f52ee55 --- /dev/null +++ b/core/vm/precompiles/interfaces/abis/IDASigners.json @@ -0,0 +1,475 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct BN254.G1Point", + "name": "pkG1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "X", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "Y", + "type": "uint256[2]" + } + ], + "indexed": false, + "internalType": "struct BN254.G2Point", + "name": "pkG2", + "type": "tuple" + } + ], + "name": "NewSigner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "socket", + "type": "string" + } + ], + "name": "SocketUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "epochNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorumId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_quorumBitmap", + "type": "bytes" + } + ], + "name": "getAggPkG1", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "aggPkG1", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorumId", + "type": "uint256" + } + ], + "name": "getQuorum", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorumId", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "_rowIndex", + "type": "uint32" + } + ], + "name": "getQuorumRow", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_account", + "type": "address[]" + } + ], + "name": "getSigner", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "string", + "name": "socket", + "type": "string" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "pkG1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "X", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "Y", + "type": "uint256[2]" + } + ], + "internalType": "struct BN254.G2Point", + "name": "pkG2", + "type": "tuple" + } + ], + "internalType": "struct IDASigners.SignerDetail[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "isSigner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "makeEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "params", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensPerVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVotesPerSigner", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxQuorums", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epochBlocks", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "encodedSlices", + "type": "uint256" + } + ], + "internalType": "struct IDASigners.Params", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "quorumCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "_signature", + "type": "tuple" + } + ], + "name": "registerNextEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "string", + "name": "socket", + "type": "string" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "pkG1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "X", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "Y", + "type": "uint256[2]" + } + ], + "internalType": "struct BN254.G2Point", + "name": "pkG2", + "type": "tuple" + } + ], + "internalType": "struct IDASigners.SignerDetail", + "name": "_signer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "_signature", + "type": "tuple" + } + ], + "name": "registerSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "registeredEpoch", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_socket", + "type": "string" + } + ], + "name": "updateSocket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/core/vm/precompiles/interfaces/abis/IWrappedA0GIBase.json b/core/vm/precompiles/interfaces/abis/IWrappedA0GIBase.json new file mode 100644 index 0000000000..064863b1f1 --- /dev/null +++ b/core/vm/precompiles/interfaces/abis/IWrappedA0GIBase.json @@ -0,0 +1,87 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getWA0GI", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "minterSupply", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supply", + "type": "uint256" + } + ], + "internalType": "struct Supply", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/core/vm/precompiles/interfaces/build/artifacts/build-info/377589efa765dec208356377872d3755.json b/core/vm/precompiles/interfaces/build/artifacts/build-info/377589efa765dec208356377872d3755.json new file mode 100644 index 0000000000..a92cda566d --- /dev/null +++ b/core/vm/precompiles/interfaces/build/artifacts/build-info/377589efa765dec208356377872d3755.json @@ -0,0 +1 @@ +{"id":"377589efa765dec208356377872d3755","_format":"hh-sol-build-info-1","solcVersion":"0.8.20","solcLongVersion":"0.8.20+commit.a1b79de6","input":{"language":"Solidity","sources":{"contracts/IDASigners.sol":{"content":"// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\nlibrary BN254 {\n struct G1Point {\n uint X;\n uint Y;\n }\n\n // Encoding of field elements is: X[1] * i + X[0]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n}\n\ninterface IDASigners {\n /*=== struct ===*/\n struct SignerDetail {\n address signer;\n string socket;\n BN254.G1Point pkG1;\n BN254.G2Point pkG2;\n }\n\n struct Params {\n uint tokensPerVote;\n uint maxVotesPerSigner;\n uint maxQuorums;\n uint epochBlocks;\n uint encodedSlices;\n }\n\n /*=== event ===*/\n event NewSigner(\n address indexed signer,\n BN254.G1Point pkG1,\n BN254.G2Point pkG2\n );\n event SocketUpdated(address indexed signer, string socket);\n\n /*=== function ===*/\n function params() external view returns (Params memory);\n\n function epochNumber() external view returns (uint);\n\n function quorumCount(uint _epoch) external view returns (uint);\n\n function isSigner(address _account) external view returns (bool);\n\n function getSigner(\n address[] memory _account\n ) external view returns (SignerDetail[] memory);\n\n function getQuorum(\n uint _epoch,\n uint _quorumId\n ) external view returns (address[] memory);\n\n function getQuorumRow(\n uint _epoch,\n uint _quorumId,\n uint32 _rowIndex\n ) external view returns (address);\n\n function registerSigner(\n SignerDetail memory _signer,\n BN254.G1Point memory _signature\n ) external;\n\n function updateSocket(string memory _socket) external;\n\n function registeredEpoch(\n address _account,\n uint _epoch\n ) external view returns (bool);\n\n function registerNextEpoch(BN254.G1Point memory _signature) external;\n\n function makeEpoch() external;\n\n function getAggPkG1(\n uint _epoch,\n uint _quorumId,\n bytes memory _quorumBitmap\n )\n external\n view\n returns (BN254.G1Point memory aggPkG1, uint total, uint hit);\n}\n"}},"settings":{"evmVersion":"istanbul","optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}}}},"output":{"sources":{"contracts/IDASigners.sol":{"ast":{"absolutePath":"contracts/IDASigners.sol","exportedSymbols":{"BN254":[16],"IDASigners":[159]},"id":160,"license":"LGPL-3.0-only","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.8",".0"],"nodeType":"PragmaDirective","src":"42:24:0"},{"abstract":false,"baseContracts":[],"canonicalName":"BN254","contractDependencies":[],"contractKind":"library","fullyImplemented":true,"id":16,"linearizedBaseContracts":[16],"name":"BN254","nameLocation":"76:5:0","nodeType":"ContractDefinition","nodes":[{"canonicalName":"BN254.G1Point","id":6,"members":[{"constant":false,"id":3,"mutability":"mutable","name":"X","nameLocation":"118:1:0","nodeType":"VariableDeclaration","scope":6,"src":"113:6:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":2,"name":"uint","nodeType":"ElementaryTypeName","src":"113:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":5,"mutability":"mutable","name":"Y","nameLocation":"134:1:0","nodeType":"VariableDeclaration","scope":6,"src":"129:6:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":4,"name":"uint","nodeType":"ElementaryTypeName","src":"129:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"G1Point","nameLocation":"95:7:0","nodeType":"StructDefinition","scope":16,"src":"88:54:0","visibility":"public"},{"canonicalName":"BN254.G2Point","id":15,"members":[{"constant":false,"id":10,"mutability":"mutable","name":"X","nameLocation":"235:1:0","nodeType":"VariableDeclaration","scope":15,"src":"227:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"},"typeName":{"baseType":{"id":7,"name":"uint","nodeType":"ElementaryTypeName","src":"227:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":9,"length":{"hexValue":"32","id":8,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"232:1:0","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"nodeType":"ArrayTypeName","src":"227:7:0","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"}},"visibility":"internal"},{"constant":false,"id":14,"mutability":"mutable","name":"Y","nameLocation":"254:1:0","nodeType":"VariableDeclaration","scope":15,"src":"246:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"},"typeName":{"baseType":{"id":11,"name":"uint","nodeType":"ElementaryTypeName","src":"246:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":13,"length":{"hexValue":"32","id":12,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"251:1:0","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"nodeType":"ArrayTypeName","src":"246:7:0","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"}},"visibility":"internal"}],"name":"G2Point","nameLocation":"209:7:0","nodeType":"StructDefinition","scope":16,"src":"202:60:0","visibility":"public"}],"scope":160,"src":"68:196:0","usedErrors":[],"usedEvents":[]},{"abstract":false,"baseContracts":[],"canonicalName":"IDASigners","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":159,"linearizedBaseContracts":[159],"name":"IDASigners","nameLocation":"276:10:0","nodeType":"ContractDefinition","nodes":[{"canonicalName":"IDASigners.SignerDetail","id":27,"members":[{"constant":false,"id":18,"mutability":"mutable","name":"signer","nameLocation":"354:6:0","nodeType":"VariableDeclaration","scope":27,"src":"346:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":17,"name":"address","nodeType":"ElementaryTypeName","src":"346:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":20,"mutability":"mutable","name":"socket","nameLocation":"377:6:0","nodeType":"VariableDeclaration","scope":27,"src":"370:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"},"typeName":{"id":19,"name":"string","nodeType":"ElementaryTypeName","src":"370:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":23,"mutability":"mutable","name":"pkG1","nameLocation":"407:4:0","nodeType":"VariableDeclaration","scope":27,"src":"393:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":22,"nodeType":"UserDefinedTypeName","pathNode":{"id":21,"name":"BN254.G1Point","nameLocations":["393:5:0","399:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"393:13:0"},"referencedDeclaration":6,"src":"393:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":26,"mutability":"mutable","name":"pkG2","nameLocation":"435:4:0","nodeType":"VariableDeclaration","scope":27,"src":"421:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"},"typeName":{"id":25,"nodeType":"UserDefinedTypeName","pathNode":{"id":24,"name":"BN254.G2Point","nameLocations":["421:5:0","427:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":15,"src":"421:13:0"},"referencedDeclaration":15,"src":"421:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"}},"visibility":"internal"}],"name":"SignerDetail","nameLocation":"323:12:0","nodeType":"StructDefinition","scope":159,"src":"316:130:0","visibility":"public"},{"canonicalName":"IDASigners.Params","id":38,"members":[{"constant":false,"id":29,"mutability":"mutable","name":"tokensPerVote","nameLocation":"481:13:0","nodeType":"VariableDeclaration","scope":38,"src":"476:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":28,"name":"uint","nodeType":"ElementaryTypeName","src":"476:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":31,"mutability":"mutable","name":"maxVotesPerSigner","nameLocation":"509:17:0","nodeType":"VariableDeclaration","scope":38,"src":"504:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":30,"name":"uint","nodeType":"ElementaryTypeName","src":"504:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":33,"mutability":"mutable","name":"maxQuorums","nameLocation":"541:10:0","nodeType":"VariableDeclaration","scope":38,"src":"536:15:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":32,"name":"uint","nodeType":"ElementaryTypeName","src":"536:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":35,"mutability":"mutable","name":"epochBlocks","nameLocation":"566:11:0","nodeType":"VariableDeclaration","scope":38,"src":"561:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":34,"name":"uint","nodeType":"ElementaryTypeName","src":"561:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":37,"mutability":"mutable","name":"encodedSlices","nameLocation":"592:13:0","nodeType":"VariableDeclaration","scope":38,"src":"587:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":36,"name":"uint","nodeType":"ElementaryTypeName","src":"587:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"Params","nameLocation":"459:6:0","nodeType":"StructDefinition","scope":159,"src":"452:160:0","visibility":"public"},{"anonymous":false,"eventSelector":"679917c2006df1daaa987a56bf1d66e99764d5ad317892d9e83a6eb4e3f051e7","id":48,"name":"NewSigner","nameLocation":"646:9:0","nodeType":"EventDefinition","parameters":{"id":47,"nodeType":"ParameterList","parameters":[{"constant":false,"id":40,"indexed":true,"mutability":"mutable","name":"signer","nameLocation":"681:6:0","nodeType":"VariableDeclaration","scope":48,"src":"665:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":39,"name":"address","nodeType":"ElementaryTypeName","src":"665:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":43,"indexed":false,"mutability":"mutable","name":"pkG1","nameLocation":"711:4:0","nodeType":"VariableDeclaration","scope":48,"src":"697:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":42,"nodeType":"UserDefinedTypeName","pathNode":{"id":41,"name":"BN254.G1Point","nameLocations":["697:5:0","703:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"697:13:0"},"referencedDeclaration":6,"src":"697:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":46,"indexed":false,"mutability":"mutable","name":"pkG2","nameLocation":"739:4:0","nodeType":"VariableDeclaration","scope":48,"src":"725:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_memory_ptr","typeString":"struct BN254.G2Point"},"typeName":{"id":45,"nodeType":"UserDefinedTypeName","pathNode":{"id":44,"name":"BN254.G2Point","nameLocations":["725:5:0","731:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":15,"src":"725:13:0"},"referencedDeclaration":15,"src":"725:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"}},"visibility":"internal"}],"src":"655:94:0"},"src":"640:110:0"},{"anonymous":false,"eventSelector":"09617a966176a40f8f1410768b118506db0096484acd5811064fcc12038798de","id":54,"name":"SocketUpdated","nameLocation":"761:13:0","nodeType":"EventDefinition","parameters":{"id":53,"nodeType":"ParameterList","parameters":[{"constant":false,"id":50,"indexed":true,"mutability":"mutable","name":"signer","nameLocation":"791:6:0","nodeType":"VariableDeclaration","scope":54,"src":"775:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":49,"name":"address","nodeType":"ElementaryTypeName","src":"775:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":52,"indexed":false,"mutability":"mutable","name":"socket","nameLocation":"806:6:0","nodeType":"VariableDeclaration","scope":54,"src":"799:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":51,"name":"string","nodeType":"ElementaryTypeName","src":"799:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"774:39:0"},"src":"755:59:0"},{"functionSelector":"cff0ab96","id":60,"implemented":false,"kind":"function","modifiers":[],"name":"params","nameLocation":"854:6:0","nodeType":"FunctionDefinition","parameters":{"id":55,"nodeType":"ParameterList","parameters":[],"src":"860:2:0"},"returnParameters":{"id":59,"nodeType":"ParameterList","parameters":[{"constant":false,"id":58,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":60,"src":"886:13:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Params_$38_memory_ptr","typeString":"struct IDASigners.Params"},"typeName":{"id":57,"nodeType":"UserDefinedTypeName","pathNode":{"id":56,"name":"Params","nameLocations":["886:6:0"],"nodeType":"IdentifierPath","referencedDeclaration":38,"src":"886:6:0"},"referencedDeclaration":38,"src":"886:6:0","typeDescriptions":{"typeIdentifier":"t_struct$_Params_$38_storage_ptr","typeString":"struct IDASigners.Params"}},"visibility":"internal"}],"src":"885:15:0"},"scope":159,"src":"845:56:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"f4145a83","id":65,"implemented":false,"kind":"function","modifiers":[],"name":"epochNumber","nameLocation":"916:11:0","nodeType":"FunctionDefinition","parameters":{"id":61,"nodeType":"ParameterList","parameters":[],"src":"927:2:0"},"returnParameters":{"id":64,"nodeType":"ParameterList","parameters":[{"constant":false,"id":63,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":65,"src":"953:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":62,"name":"uint","nodeType":"ElementaryTypeName","src":"953:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"952:6:0"},"scope":159,"src":"907:52:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"5ecba503","id":72,"implemented":false,"kind":"function","modifiers":[],"name":"quorumCount","nameLocation":"974:11:0","nodeType":"FunctionDefinition","parameters":{"id":68,"nodeType":"ParameterList","parameters":[{"constant":false,"id":67,"mutability":"mutable","name":"_epoch","nameLocation":"991:6:0","nodeType":"VariableDeclaration","scope":72,"src":"986:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":66,"name":"uint","nodeType":"ElementaryTypeName","src":"986:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"985:13:0"},"returnParameters":{"id":71,"nodeType":"ParameterList","parameters":[{"constant":false,"id":70,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":72,"src":"1022:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":69,"name":"uint","nodeType":"ElementaryTypeName","src":"1022:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1021:6:0"},"scope":159,"src":"965:63:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"7df73e27","id":79,"implemented":false,"kind":"function","modifiers":[],"name":"isSigner","nameLocation":"1043:8:0","nodeType":"FunctionDefinition","parameters":{"id":75,"nodeType":"ParameterList","parameters":[{"constant":false,"id":74,"mutability":"mutable","name":"_account","nameLocation":"1060:8:0","nodeType":"VariableDeclaration","scope":79,"src":"1052:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":73,"name":"address","nodeType":"ElementaryTypeName","src":"1052:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1051:18:0"},"returnParameters":{"id":78,"nodeType":"ParameterList","parameters":[{"constant":false,"id":77,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":79,"src":"1093:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":76,"name":"bool","nodeType":"ElementaryTypeName","src":"1093:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1092:6:0"},"scope":159,"src":"1034:65:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"d1f5e5f8","id":89,"implemented":false,"kind":"function","modifiers":[],"name":"getSigner","nameLocation":"1114:9:0","nodeType":"FunctionDefinition","parameters":{"id":83,"nodeType":"ParameterList","parameters":[{"constant":false,"id":82,"mutability":"mutable","name":"_account","nameLocation":"1150:8:0","nodeType":"VariableDeclaration","scope":89,"src":"1133:25:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":80,"name":"address","nodeType":"ElementaryTypeName","src":"1133:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":81,"nodeType":"ArrayTypeName","src":"1133:9:0","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"1123:41:0"},"returnParameters":{"id":88,"nodeType":"ParameterList","parameters":[{"constant":false,"id":87,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":89,"src":"1188:21:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_struct$_SignerDetail_$27_memory_ptr_$dyn_memory_ptr","typeString":"struct IDASigners.SignerDetail[]"},"typeName":{"baseType":{"id":85,"nodeType":"UserDefinedTypeName","pathNode":{"id":84,"name":"SignerDetail","nameLocations":["1188:12:0"],"nodeType":"IdentifierPath","referencedDeclaration":27,"src":"1188:12:0"},"referencedDeclaration":27,"src":"1188:12:0","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_storage_ptr","typeString":"struct IDASigners.SignerDetail"}},"id":86,"nodeType":"ArrayTypeName","src":"1188:14:0","typeDescriptions":{"typeIdentifier":"t_array$_t_struct$_SignerDetail_$27_storage_$dyn_storage_ptr","typeString":"struct IDASigners.SignerDetail[]"}},"visibility":"internal"}],"src":"1187:23:0"},"scope":159,"src":"1105:106:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"6ab6f654","id":99,"implemented":false,"kind":"function","modifiers":[],"name":"getQuorum","nameLocation":"1226:9:0","nodeType":"FunctionDefinition","parameters":{"id":94,"nodeType":"ParameterList","parameters":[{"constant":false,"id":91,"mutability":"mutable","name":"_epoch","nameLocation":"1250:6:0","nodeType":"VariableDeclaration","scope":99,"src":"1245:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90,"name":"uint","nodeType":"ElementaryTypeName","src":"1245:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":93,"mutability":"mutable","name":"_quorumId","nameLocation":"1271:9:0","nodeType":"VariableDeclaration","scope":99,"src":"1266:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":92,"name":"uint","nodeType":"ElementaryTypeName","src":"1266:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1235:51:0"},"returnParameters":{"id":98,"nodeType":"ParameterList","parameters":[{"constant":false,"id":97,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":99,"src":"1310:16:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":95,"name":"address","nodeType":"ElementaryTypeName","src":"1310:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":96,"nodeType":"ArrayTypeName","src":"1310:9:0","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"1309:18:0"},"scope":159,"src":"1217:111:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"fa6fcba6","id":110,"implemented":false,"kind":"function","modifiers":[],"name":"getQuorumRow","nameLocation":"1343:12:0","nodeType":"FunctionDefinition","parameters":{"id":106,"nodeType":"ParameterList","parameters":[{"constant":false,"id":101,"mutability":"mutable","name":"_epoch","nameLocation":"1370:6:0","nodeType":"VariableDeclaration","scope":110,"src":"1365:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":100,"name":"uint","nodeType":"ElementaryTypeName","src":"1365:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":103,"mutability":"mutable","name":"_quorumId","nameLocation":"1391:9:0","nodeType":"VariableDeclaration","scope":110,"src":"1386:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":102,"name":"uint","nodeType":"ElementaryTypeName","src":"1386:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":105,"mutability":"mutable","name":"_rowIndex","nameLocation":"1417:9:0","nodeType":"VariableDeclaration","scope":110,"src":"1410:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"},"typeName":{"id":104,"name":"uint32","nodeType":"ElementaryTypeName","src":"1410:6:0","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}},"visibility":"internal"}],"src":"1355:77:0"},"returnParameters":{"id":109,"nodeType":"ParameterList","parameters":[{"constant":false,"id":108,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":110,"src":"1456:7:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":107,"name":"address","nodeType":"ElementaryTypeName","src":"1456:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1455:9:0"},"scope":159,"src":"1334:131:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"7ca4dd5e","id":119,"implemented":false,"kind":"function","modifiers":[],"name":"registerSigner","nameLocation":"1480:14:0","nodeType":"FunctionDefinition","parameters":{"id":117,"nodeType":"ParameterList","parameters":[{"constant":false,"id":113,"mutability":"mutable","name":"_signer","nameLocation":"1524:7:0","nodeType":"VariableDeclaration","scope":119,"src":"1504:27:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_memory_ptr","typeString":"struct IDASigners.SignerDetail"},"typeName":{"id":112,"nodeType":"UserDefinedTypeName","pathNode":{"id":111,"name":"SignerDetail","nameLocations":["1504:12:0"],"nodeType":"IdentifierPath","referencedDeclaration":27,"src":"1504:12:0"},"referencedDeclaration":27,"src":"1504:12:0","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_storage_ptr","typeString":"struct IDASigners.SignerDetail"}},"visibility":"internal"},{"constant":false,"id":116,"mutability":"mutable","name":"_signature","nameLocation":"1562:10:0","nodeType":"VariableDeclaration","scope":119,"src":"1541:31:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":115,"nodeType":"UserDefinedTypeName","pathNode":{"id":114,"name":"BN254.G1Point","nameLocations":["1541:5:0","1547:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1541:13:0"},"referencedDeclaration":6,"src":"1541:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"}],"src":"1494:84:0"},"returnParameters":{"id":118,"nodeType":"ParameterList","parameters":[],"src":"1587:0:0"},"scope":159,"src":"1471:117:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"0cf4b767","id":124,"implemented":false,"kind":"function","modifiers":[],"name":"updateSocket","nameLocation":"1603:12:0","nodeType":"FunctionDefinition","parameters":{"id":122,"nodeType":"ParameterList","parameters":[{"constant":false,"id":121,"mutability":"mutable","name":"_socket","nameLocation":"1630:7:0","nodeType":"VariableDeclaration","scope":124,"src":"1616:21:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":120,"name":"string","nodeType":"ElementaryTypeName","src":"1616:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"1615:23:0"},"returnParameters":{"id":123,"nodeType":"ParameterList","parameters":[],"src":"1647:0:0"},"scope":159,"src":"1594:54:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"6c9e560c","id":133,"implemented":false,"kind":"function","modifiers":[],"name":"registeredEpoch","nameLocation":"1663:15:0","nodeType":"FunctionDefinition","parameters":{"id":129,"nodeType":"ParameterList","parameters":[{"constant":false,"id":126,"mutability":"mutable","name":"_account","nameLocation":"1696:8:0","nodeType":"VariableDeclaration","scope":133,"src":"1688:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":125,"name":"address","nodeType":"ElementaryTypeName","src":"1688:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":128,"mutability":"mutable","name":"_epoch","nameLocation":"1719:6:0","nodeType":"VariableDeclaration","scope":133,"src":"1714:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":127,"name":"uint","nodeType":"ElementaryTypeName","src":"1714:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1678:53:0"},"returnParameters":{"id":132,"nodeType":"ParameterList","parameters":[{"constant":false,"id":131,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":133,"src":"1755:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":130,"name":"bool","nodeType":"ElementaryTypeName","src":"1755:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1754:6:0"},"scope":159,"src":"1654:107:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"56a32372","id":139,"implemented":false,"kind":"function","modifiers":[],"name":"registerNextEpoch","nameLocation":"1776:17:0","nodeType":"FunctionDefinition","parameters":{"id":137,"nodeType":"ParameterList","parameters":[{"constant":false,"id":136,"mutability":"mutable","name":"_signature","nameLocation":"1815:10:0","nodeType":"VariableDeclaration","scope":139,"src":"1794:31:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":135,"nodeType":"UserDefinedTypeName","pathNode":{"id":134,"name":"BN254.G1Point","nameLocations":["1794:5:0","1800:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1794:13:0"},"referencedDeclaration":6,"src":"1794:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"}],"src":"1793:33:0"},"returnParameters":{"id":138,"nodeType":"ParameterList","parameters":[],"src":"1835:0:0"},"scope":159,"src":"1767:69:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"5a889f0c","id":142,"implemented":false,"kind":"function","modifiers":[],"name":"makeEpoch","nameLocation":"1851:9:0","nodeType":"FunctionDefinition","parameters":{"id":140,"nodeType":"ParameterList","parameters":[],"src":"1860:2:0"},"returnParameters":{"id":141,"nodeType":"ParameterList","parameters":[],"src":"1871:0:0"},"scope":159,"src":"1842:30:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"50b73739","id":158,"implemented":false,"kind":"function","modifiers":[],"name":"getAggPkG1","nameLocation":"1887:10:0","nodeType":"FunctionDefinition","parameters":{"id":149,"nodeType":"ParameterList","parameters":[{"constant":false,"id":144,"mutability":"mutable","name":"_epoch","nameLocation":"1912:6:0","nodeType":"VariableDeclaration","scope":158,"src":"1907:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":143,"name":"uint","nodeType":"ElementaryTypeName","src":"1907:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":146,"mutability":"mutable","name":"_quorumId","nameLocation":"1933:9:0","nodeType":"VariableDeclaration","scope":158,"src":"1928:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":145,"name":"uint","nodeType":"ElementaryTypeName","src":"1928:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":148,"mutability":"mutable","name":"_quorumBitmap","nameLocation":"1965:13:0","nodeType":"VariableDeclaration","scope":158,"src":"1952:26:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":147,"name":"bytes","nodeType":"ElementaryTypeName","src":"1952:5:0","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"1897:87:0"},"returnParameters":{"id":157,"nodeType":"ParameterList","parameters":[{"constant":false,"id":152,"mutability":"mutable","name":"aggPkG1","nameLocation":"2053:7:0","nodeType":"VariableDeclaration","scope":158,"src":"2032:28:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":151,"nodeType":"UserDefinedTypeName","pathNode":{"id":150,"name":"BN254.G1Point","nameLocations":["2032:5:0","2038:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"2032:13:0"},"referencedDeclaration":6,"src":"2032:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":154,"mutability":"mutable","name":"total","nameLocation":"2067:5:0","nodeType":"VariableDeclaration","scope":158,"src":"2062:10:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":153,"name":"uint","nodeType":"ElementaryTypeName","src":"2062:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":156,"mutability":"mutable","name":"hit","nameLocation":"2079:3:0","nodeType":"VariableDeclaration","scope":158,"src":"2074:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":155,"name":"uint","nodeType":"ElementaryTypeName","src":"2074:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"2031:52:0"},"scope":159,"src":"1878:206:0","stateMutability":"view","virtual":false,"visibility":"external"}],"scope":160,"src":"266:1820:0","usedErrors":[],"usedEvents":[48,54]}],"src":"42:2045:0"},"id":0}},"contracts":{"contracts/IDASigners.sol":{"BN254":{"abi":[],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220abc43d74fec9de74f3b7a60ee2e0337c23369163d8fb7a1e1cb0037a16d8abfb64736f6c63430008140033","opcodes":"PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xAB 0xC4 RETURNDATASIZE PUSH21 0xFEC9DE74F3B7A60EE2E0337C23369163D8FB7A1E1C 0xB0 SUB PUSH27 0x16D8ABFB64736F6C63430008140033000000000000000000000000 ","sourceMap":"68:196:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;68:196:0;;;;;;;;;;;;;;;;;"},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220abc43d74fec9de74f3b7a60ee2e0337c23369163d8fb7a1e1cb0037a16d8abfb64736f6c63430008140033","opcodes":"PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xAB 0xC4 RETURNDATASIZE PUSH21 0xFEC9DE74F3B7A60EE2E0337C23369163D8FB7A1E1C 0xB0 SUB PUSH27 0x16D8ABFB64736F6C63430008140033000000000000000000000000 ","sourceMap":"68:196:0:-:0;;;;;;;;"},"methodIdentifiers":{}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IDASigners.sol\":\"BN254\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IDASigners.sol\":{\"keccak256\":\"0x77f38cecc2dd928cbbad6168d05b0aed9fd8b949a3b84cf2c00bc35ecae451e7\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://c9c7363b995c112920f863e74f7b14a61731dd6c0e4eee072e3e7f850bd37ada\",\"dweb:/ipfs/QmXGXVWVaNJDw1b4Fv7b1GEdgpeTtnuPSEq8m8Z5dtuucE\"]}},\"version\":1}"},"IDASigners":{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"indexed":false,"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"indexed":false,"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"name":"NewSigner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"string","name":"socket","type":"string"}],"name":"SocketUpdated","type":"event"},{"inputs":[],"name":"epochNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"},{"internalType":"bytes","name":"_quorumBitmap","type":"bytes"}],"name":"getAggPkG1","outputs":[{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"aggPkG1","type":"tuple"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"hit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"}],"name":"getQuorum","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"},{"internalType":"uint32","name":"_rowIndex","type":"uint32"}],"name":"getQuorumRow","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_account","type":"address[]"}],"name":"getSigner","outputs":[{"components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"string","name":"socket","type":"string"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"internalType":"struct IDASigners.SignerDetail[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"makeEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"params","outputs":[{"components":[{"internalType":"uint256","name":"tokensPerVote","type":"uint256"},{"internalType":"uint256","name":"maxVotesPerSigner","type":"uint256"},{"internalType":"uint256","name":"maxQuorums","type":"uint256"},{"internalType":"uint256","name":"epochBlocks","type":"uint256"},{"internalType":"uint256","name":"encodedSlices","type":"uint256"}],"internalType":"struct IDASigners.Params","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"quorumCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"_signature","type":"tuple"}],"name":"registerNextEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"string","name":"socket","type":"string"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"internalType":"struct IDASigners.SignerDetail","name":"_signer","type":"tuple"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"_signature","type":"tuple"}],"name":"registerSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"registeredEpoch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_socket","type":"string"}],"name":"updateSocket","outputs":[],"stateMutability":"nonpayable","type":"function"}],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"methodIdentifiers":{"epochNumber()":"f4145a83","getAggPkG1(uint256,uint256,bytes)":"50b73739","getQuorum(uint256,uint256)":"6ab6f654","getQuorumRow(uint256,uint256,uint32)":"fa6fcba6","getSigner(address[])":"d1f5e5f8","isSigner(address)":"7df73e27","makeEpoch()":"5a889f0c","params()":"cff0ab96","quorumCount(uint256)":"5ecba503","registerNextEpoch((uint256,uint256))":"56a32372","registerSigner((address,string,(uint256,uint256),(uint256[2],uint256[2])),(uint256,uint256))":"7ca4dd5e","registeredEpoch(address,uint256)":"6c9e560c","updateSocket(string)":"0cf4b767"}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"struct IDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"makeEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"struct IDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"struct IDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IDASigners.sol\":\"IDASigners\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IDASigners.sol\":{\"keccak256\":\"0x77f38cecc2dd928cbbad6168d05b0aed9fd8b949a3b84cf2c00bc35ecae451e7\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://c9c7363b995c112920f863e74f7b14a61731dd6c0e4eee072e3e7f850bd37ada\",\"dweb:/ipfs/QmXGXVWVaNJDw1b4Fv7b1GEdgpeTtnuPSEq8m8Z5dtuucE\"]}},\"version\":1}"}}}}} \ No newline at end of file diff --git a/core/vm/precompiles/interfaces/build/artifacts/build-info/c79ff14473359160d0c7a65892d5cb52.json b/core/vm/precompiles/interfaces/build/artifacts/build-info/c79ff14473359160d0c7a65892d5cb52.json new file mode 100644 index 0000000000..4c4f7657d0 --- /dev/null +++ b/core/vm/precompiles/interfaces/build/artifacts/build-info/c79ff14473359160d0c7a65892d5cb52.json @@ -0,0 +1 @@ +{"id":"c79ff14473359160d0c7a65892d5cb52","_format":"hh-sol-build-info-1","solcVersion":"0.8.20","solcLongVersion":"0.8.20+commit.a1b79de6","input":{"language":"Solidity","sources":{"contracts/IDASigners.sol":{"content":"// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\nlibrary BN254 {\n struct G1Point {\n uint X;\n uint Y;\n }\n\n // Encoding of field elements is: X[1] * i + X[0]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n}\n\ninterface IDASigners {\n /*=== struct ===*/\n struct SignerDetail {\n address signer;\n string socket;\n BN254.G1Point pkG1;\n BN254.G2Point pkG2;\n }\n\n struct Params {\n uint tokensPerVote;\n uint maxVotesPerSigner;\n uint maxQuorums;\n uint epochBlocks;\n uint encodedSlices;\n }\n\n /*=== event ===*/\n event NewSigner(\n address indexed signer,\n BN254.G1Point pkG1,\n BN254.G2Point pkG2\n );\n event SocketUpdated(address indexed signer, string socket);\n\n /*=== function ===*/\n function params() external view returns (Params memory);\n\n function epochNumber() external view returns (uint);\n\n function quorumCount(uint _epoch) external view returns (uint);\n\n function isSigner(address _account) external view returns (bool);\n\n function getSigner(\n address[] memory _account\n ) external view returns (SignerDetail[] memory);\n\n function getQuorum(\n uint _epoch,\n uint _quorumId\n ) external view returns (address[] memory);\n\n function getQuorumRow(\n uint _epoch,\n uint _quorumId,\n uint32 _rowIndex\n ) external view returns (address);\n\n function registerSigner(\n SignerDetail memory _signer,\n BN254.G1Point memory _signature\n ) external;\n\n function updateSocket(string memory _socket) external;\n\n function registeredEpoch(\n address _account,\n uint _epoch\n ) external view returns (bool);\n\n function registerNextEpoch(BN254.G1Point memory _signature) external;\n\n function getAggPkG1(\n uint _epoch,\n uint _quorumId,\n bytes memory _quorumBitmap\n )\n external\n view\n returns (BN254.G1Point memory aggPkG1, uint total, uint hit);\n}\n"},"contracts/IWrappedA0GIBase.sol":{"content":"// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\nstruct Supply {\n uint256 cap;\n uint256 initialSupply;\n uint256 supply;\n}\n\n/**\n * @title WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly.\n */\ninterface IWrappedA0GIBase {\n /**\n * @dev set the wA0GI address.\n * It is designed to be called by governance module only so it's not implemented at EVM precompile side.\n * @param addr address of wA0GI\n */\n // function setWA0GI(address addr) external;\n\n /**\n * @dev get the wA0GI address.\n */\n function getWA0GI() external view returns (address);\n\n /**\n * @dev set the cap and initial supply for a minter.\n * It is designed to be called by governance module only so it's not implemented at EVM precompile side.\n * @param minter minter address\n * @param cap mint cap\n * @param initialSupply initial mint supply\n */\n // function setMinterCap(address minter, uint256 cap, uint256 initialSupply) external;\n\n /**\n * @dev get the mint supply of given address\n * @param minter minter address\n */\n function minterSupply(address minter) external view returns (Supply memory);\n\n /**\n * @dev mint a0gi to this precompile, add corresponding amount to minter's mint supply.\n * If sender's final mint supply exceeds its mint cap, the transaction will revert.\n * Can only be called by WA0GI.\n * @param minter minter address\n * @param amount amount to mint\n */\n function mint(address minter, uint256 amount) external;\n\n /**\n * @dev burn given amount of a0gi on behalf of minter, reduce corresponding amount from sender's mint supply.\n * Can only be called by WA0GI.\n * @param minter minter address\n * @param amount amount to burn\n */\n function burn(address minter, uint256 amount) external;\n}\n"}},"settings":{"evmVersion":"istanbul","optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}}}},"output":{"sources":{"contracts/IDASigners.sol":{"ast":{"absolutePath":"contracts/IDASigners.sol","exportedSymbols":{"BN254":[16],"IDASigners":[156]},"id":157,"license":"LGPL-3.0-only","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.8",".0"],"nodeType":"PragmaDirective","src":"42:24:0"},{"abstract":false,"baseContracts":[],"canonicalName":"BN254","contractDependencies":[],"contractKind":"library","fullyImplemented":true,"id":16,"linearizedBaseContracts":[16],"name":"BN254","nameLocation":"76:5:0","nodeType":"ContractDefinition","nodes":[{"canonicalName":"BN254.G1Point","id":6,"members":[{"constant":false,"id":3,"mutability":"mutable","name":"X","nameLocation":"118:1:0","nodeType":"VariableDeclaration","scope":6,"src":"113:6:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":2,"name":"uint","nodeType":"ElementaryTypeName","src":"113:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":5,"mutability":"mutable","name":"Y","nameLocation":"134:1:0","nodeType":"VariableDeclaration","scope":6,"src":"129:6:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":4,"name":"uint","nodeType":"ElementaryTypeName","src":"129:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"G1Point","nameLocation":"95:7:0","nodeType":"StructDefinition","scope":16,"src":"88:54:0","visibility":"public"},{"canonicalName":"BN254.G2Point","id":15,"members":[{"constant":false,"id":10,"mutability":"mutable","name":"X","nameLocation":"235:1:0","nodeType":"VariableDeclaration","scope":15,"src":"227:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"},"typeName":{"baseType":{"id":7,"name":"uint","nodeType":"ElementaryTypeName","src":"227:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":9,"length":{"hexValue":"32","id":8,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"232:1:0","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"nodeType":"ArrayTypeName","src":"227:7:0","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"}},"visibility":"internal"},{"constant":false,"id":14,"mutability":"mutable","name":"Y","nameLocation":"254:1:0","nodeType":"VariableDeclaration","scope":15,"src":"246:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"},"typeName":{"baseType":{"id":11,"name":"uint","nodeType":"ElementaryTypeName","src":"246:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":13,"length":{"hexValue":"32","id":12,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"251:1:0","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"nodeType":"ArrayTypeName","src":"246:7:0","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"}},"visibility":"internal"}],"name":"G2Point","nameLocation":"209:7:0","nodeType":"StructDefinition","scope":16,"src":"202:60:0","visibility":"public"}],"scope":157,"src":"68:196:0","usedErrors":[],"usedEvents":[]},{"abstract":false,"baseContracts":[],"canonicalName":"IDASigners","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":156,"linearizedBaseContracts":[156],"name":"IDASigners","nameLocation":"276:10:0","nodeType":"ContractDefinition","nodes":[{"canonicalName":"IDASigners.SignerDetail","id":27,"members":[{"constant":false,"id":18,"mutability":"mutable","name":"signer","nameLocation":"354:6:0","nodeType":"VariableDeclaration","scope":27,"src":"346:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":17,"name":"address","nodeType":"ElementaryTypeName","src":"346:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":20,"mutability":"mutable","name":"socket","nameLocation":"377:6:0","nodeType":"VariableDeclaration","scope":27,"src":"370:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"},"typeName":{"id":19,"name":"string","nodeType":"ElementaryTypeName","src":"370:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":23,"mutability":"mutable","name":"pkG1","nameLocation":"407:4:0","nodeType":"VariableDeclaration","scope":27,"src":"393:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":22,"nodeType":"UserDefinedTypeName","pathNode":{"id":21,"name":"BN254.G1Point","nameLocations":["393:5:0","399:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"393:13:0"},"referencedDeclaration":6,"src":"393:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":26,"mutability":"mutable","name":"pkG2","nameLocation":"435:4:0","nodeType":"VariableDeclaration","scope":27,"src":"421:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"},"typeName":{"id":25,"nodeType":"UserDefinedTypeName","pathNode":{"id":24,"name":"BN254.G2Point","nameLocations":["421:5:0","427:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":15,"src":"421:13:0"},"referencedDeclaration":15,"src":"421:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"}},"visibility":"internal"}],"name":"SignerDetail","nameLocation":"323:12:0","nodeType":"StructDefinition","scope":156,"src":"316:130:0","visibility":"public"},{"canonicalName":"IDASigners.Params","id":38,"members":[{"constant":false,"id":29,"mutability":"mutable","name":"tokensPerVote","nameLocation":"481:13:0","nodeType":"VariableDeclaration","scope":38,"src":"476:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":28,"name":"uint","nodeType":"ElementaryTypeName","src":"476:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":31,"mutability":"mutable","name":"maxVotesPerSigner","nameLocation":"509:17:0","nodeType":"VariableDeclaration","scope":38,"src":"504:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":30,"name":"uint","nodeType":"ElementaryTypeName","src":"504:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":33,"mutability":"mutable","name":"maxQuorums","nameLocation":"541:10:0","nodeType":"VariableDeclaration","scope":38,"src":"536:15:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":32,"name":"uint","nodeType":"ElementaryTypeName","src":"536:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":35,"mutability":"mutable","name":"epochBlocks","nameLocation":"566:11:0","nodeType":"VariableDeclaration","scope":38,"src":"561:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":34,"name":"uint","nodeType":"ElementaryTypeName","src":"561:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":37,"mutability":"mutable","name":"encodedSlices","nameLocation":"592:13:0","nodeType":"VariableDeclaration","scope":38,"src":"587:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":36,"name":"uint","nodeType":"ElementaryTypeName","src":"587:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"Params","nameLocation":"459:6:0","nodeType":"StructDefinition","scope":156,"src":"452:160:0","visibility":"public"},{"anonymous":false,"eventSelector":"679917c2006df1daaa987a56bf1d66e99764d5ad317892d9e83a6eb4e3f051e7","id":48,"name":"NewSigner","nameLocation":"646:9:0","nodeType":"EventDefinition","parameters":{"id":47,"nodeType":"ParameterList","parameters":[{"constant":false,"id":40,"indexed":true,"mutability":"mutable","name":"signer","nameLocation":"681:6:0","nodeType":"VariableDeclaration","scope":48,"src":"665:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":39,"name":"address","nodeType":"ElementaryTypeName","src":"665:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":43,"indexed":false,"mutability":"mutable","name":"pkG1","nameLocation":"711:4:0","nodeType":"VariableDeclaration","scope":48,"src":"697:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":42,"nodeType":"UserDefinedTypeName","pathNode":{"id":41,"name":"BN254.G1Point","nameLocations":["697:5:0","703:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"697:13:0"},"referencedDeclaration":6,"src":"697:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":46,"indexed":false,"mutability":"mutable","name":"pkG2","nameLocation":"739:4:0","nodeType":"VariableDeclaration","scope":48,"src":"725:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_memory_ptr","typeString":"struct BN254.G2Point"},"typeName":{"id":45,"nodeType":"UserDefinedTypeName","pathNode":{"id":44,"name":"BN254.G2Point","nameLocations":["725:5:0","731:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":15,"src":"725:13:0"},"referencedDeclaration":15,"src":"725:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"}},"visibility":"internal"}],"src":"655:94:0"},"src":"640:110:0"},{"anonymous":false,"eventSelector":"09617a966176a40f8f1410768b118506db0096484acd5811064fcc12038798de","id":54,"name":"SocketUpdated","nameLocation":"761:13:0","nodeType":"EventDefinition","parameters":{"id":53,"nodeType":"ParameterList","parameters":[{"constant":false,"id":50,"indexed":true,"mutability":"mutable","name":"signer","nameLocation":"791:6:0","nodeType":"VariableDeclaration","scope":54,"src":"775:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":49,"name":"address","nodeType":"ElementaryTypeName","src":"775:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":52,"indexed":false,"mutability":"mutable","name":"socket","nameLocation":"806:6:0","nodeType":"VariableDeclaration","scope":54,"src":"799:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":51,"name":"string","nodeType":"ElementaryTypeName","src":"799:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"774:39:0"},"src":"755:59:0"},{"functionSelector":"cff0ab96","id":60,"implemented":false,"kind":"function","modifiers":[],"name":"params","nameLocation":"854:6:0","nodeType":"FunctionDefinition","parameters":{"id":55,"nodeType":"ParameterList","parameters":[],"src":"860:2:0"},"returnParameters":{"id":59,"nodeType":"ParameterList","parameters":[{"constant":false,"id":58,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":60,"src":"886:13:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Params_$38_memory_ptr","typeString":"struct IDASigners.Params"},"typeName":{"id":57,"nodeType":"UserDefinedTypeName","pathNode":{"id":56,"name":"Params","nameLocations":["886:6:0"],"nodeType":"IdentifierPath","referencedDeclaration":38,"src":"886:6:0"},"referencedDeclaration":38,"src":"886:6:0","typeDescriptions":{"typeIdentifier":"t_struct$_Params_$38_storage_ptr","typeString":"struct IDASigners.Params"}},"visibility":"internal"}],"src":"885:15:0"},"scope":156,"src":"845:56:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"f4145a83","id":65,"implemented":false,"kind":"function","modifiers":[],"name":"epochNumber","nameLocation":"916:11:0","nodeType":"FunctionDefinition","parameters":{"id":61,"nodeType":"ParameterList","parameters":[],"src":"927:2:0"},"returnParameters":{"id":64,"nodeType":"ParameterList","parameters":[{"constant":false,"id":63,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":65,"src":"953:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":62,"name":"uint","nodeType":"ElementaryTypeName","src":"953:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"952:6:0"},"scope":156,"src":"907:52:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"5ecba503","id":72,"implemented":false,"kind":"function","modifiers":[],"name":"quorumCount","nameLocation":"974:11:0","nodeType":"FunctionDefinition","parameters":{"id":68,"nodeType":"ParameterList","parameters":[{"constant":false,"id":67,"mutability":"mutable","name":"_epoch","nameLocation":"991:6:0","nodeType":"VariableDeclaration","scope":72,"src":"986:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":66,"name":"uint","nodeType":"ElementaryTypeName","src":"986:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"985:13:0"},"returnParameters":{"id":71,"nodeType":"ParameterList","parameters":[{"constant":false,"id":70,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":72,"src":"1022:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":69,"name":"uint","nodeType":"ElementaryTypeName","src":"1022:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1021:6:0"},"scope":156,"src":"965:63:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"7df73e27","id":79,"implemented":false,"kind":"function","modifiers":[],"name":"isSigner","nameLocation":"1043:8:0","nodeType":"FunctionDefinition","parameters":{"id":75,"nodeType":"ParameterList","parameters":[{"constant":false,"id":74,"mutability":"mutable","name":"_account","nameLocation":"1060:8:0","nodeType":"VariableDeclaration","scope":79,"src":"1052:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":73,"name":"address","nodeType":"ElementaryTypeName","src":"1052:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1051:18:0"},"returnParameters":{"id":78,"nodeType":"ParameterList","parameters":[{"constant":false,"id":77,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":79,"src":"1093:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":76,"name":"bool","nodeType":"ElementaryTypeName","src":"1093:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1092:6:0"},"scope":156,"src":"1034:65:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"d1f5e5f8","id":89,"implemented":false,"kind":"function","modifiers":[],"name":"getSigner","nameLocation":"1114:9:0","nodeType":"FunctionDefinition","parameters":{"id":83,"nodeType":"ParameterList","parameters":[{"constant":false,"id":82,"mutability":"mutable","name":"_account","nameLocation":"1150:8:0","nodeType":"VariableDeclaration","scope":89,"src":"1133:25:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":80,"name":"address","nodeType":"ElementaryTypeName","src":"1133:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":81,"nodeType":"ArrayTypeName","src":"1133:9:0","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"1123:41:0"},"returnParameters":{"id":88,"nodeType":"ParameterList","parameters":[{"constant":false,"id":87,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":89,"src":"1188:21:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_struct$_SignerDetail_$27_memory_ptr_$dyn_memory_ptr","typeString":"struct IDASigners.SignerDetail[]"},"typeName":{"baseType":{"id":85,"nodeType":"UserDefinedTypeName","pathNode":{"id":84,"name":"SignerDetail","nameLocations":["1188:12:0"],"nodeType":"IdentifierPath","referencedDeclaration":27,"src":"1188:12:0"},"referencedDeclaration":27,"src":"1188:12:0","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_storage_ptr","typeString":"struct IDASigners.SignerDetail"}},"id":86,"nodeType":"ArrayTypeName","src":"1188:14:0","typeDescriptions":{"typeIdentifier":"t_array$_t_struct$_SignerDetail_$27_storage_$dyn_storage_ptr","typeString":"struct IDASigners.SignerDetail[]"}},"visibility":"internal"}],"src":"1187:23:0"},"scope":156,"src":"1105:106:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"6ab6f654","id":99,"implemented":false,"kind":"function","modifiers":[],"name":"getQuorum","nameLocation":"1226:9:0","nodeType":"FunctionDefinition","parameters":{"id":94,"nodeType":"ParameterList","parameters":[{"constant":false,"id":91,"mutability":"mutable","name":"_epoch","nameLocation":"1250:6:0","nodeType":"VariableDeclaration","scope":99,"src":"1245:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90,"name":"uint","nodeType":"ElementaryTypeName","src":"1245:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":93,"mutability":"mutable","name":"_quorumId","nameLocation":"1271:9:0","nodeType":"VariableDeclaration","scope":99,"src":"1266:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":92,"name":"uint","nodeType":"ElementaryTypeName","src":"1266:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1235:51:0"},"returnParameters":{"id":98,"nodeType":"ParameterList","parameters":[{"constant":false,"id":97,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":99,"src":"1310:16:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":95,"name":"address","nodeType":"ElementaryTypeName","src":"1310:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":96,"nodeType":"ArrayTypeName","src":"1310:9:0","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"1309:18:0"},"scope":156,"src":"1217:111:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"fa6fcba6","id":110,"implemented":false,"kind":"function","modifiers":[],"name":"getQuorumRow","nameLocation":"1343:12:0","nodeType":"FunctionDefinition","parameters":{"id":106,"nodeType":"ParameterList","parameters":[{"constant":false,"id":101,"mutability":"mutable","name":"_epoch","nameLocation":"1370:6:0","nodeType":"VariableDeclaration","scope":110,"src":"1365:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":100,"name":"uint","nodeType":"ElementaryTypeName","src":"1365:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":103,"mutability":"mutable","name":"_quorumId","nameLocation":"1391:9:0","nodeType":"VariableDeclaration","scope":110,"src":"1386:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":102,"name":"uint","nodeType":"ElementaryTypeName","src":"1386:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":105,"mutability":"mutable","name":"_rowIndex","nameLocation":"1417:9:0","nodeType":"VariableDeclaration","scope":110,"src":"1410:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"},"typeName":{"id":104,"name":"uint32","nodeType":"ElementaryTypeName","src":"1410:6:0","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}},"visibility":"internal"}],"src":"1355:77:0"},"returnParameters":{"id":109,"nodeType":"ParameterList","parameters":[{"constant":false,"id":108,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":110,"src":"1456:7:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":107,"name":"address","nodeType":"ElementaryTypeName","src":"1456:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1455:9:0"},"scope":156,"src":"1334:131:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"7ca4dd5e","id":119,"implemented":false,"kind":"function","modifiers":[],"name":"registerSigner","nameLocation":"1480:14:0","nodeType":"FunctionDefinition","parameters":{"id":117,"nodeType":"ParameterList","parameters":[{"constant":false,"id":113,"mutability":"mutable","name":"_signer","nameLocation":"1524:7:0","nodeType":"VariableDeclaration","scope":119,"src":"1504:27:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_memory_ptr","typeString":"struct IDASigners.SignerDetail"},"typeName":{"id":112,"nodeType":"UserDefinedTypeName","pathNode":{"id":111,"name":"SignerDetail","nameLocations":["1504:12:0"],"nodeType":"IdentifierPath","referencedDeclaration":27,"src":"1504:12:0"},"referencedDeclaration":27,"src":"1504:12:0","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_storage_ptr","typeString":"struct IDASigners.SignerDetail"}},"visibility":"internal"},{"constant":false,"id":116,"mutability":"mutable","name":"_signature","nameLocation":"1562:10:0","nodeType":"VariableDeclaration","scope":119,"src":"1541:31:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":115,"nodeType":"UserDefinedTypeName","pathNode":{"id":114,"name":"BN254.G1Point","nameLocations":["1541:5:0","1547:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1541:13:0"},"referencedDeclaration":6,"src":"1541:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"}],"src":"1494:84:0"},"returnParameters":{"id":118,"nodeType":"ParameterList","parameters":[],"src":"1587:0:0"},"scope":156,"src":"1471:117:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"0cf4b767","id":124,"implemented":false,"kind":"function","modifiers":[],"name":"updateSocket","nameLocation":"1603:12:0","nodeType":"FunctionDefinition","parameters":{"id":122,"nodeType":"ParameterList","parameters":[{"constant":false,"id":121,"mutability":"mutable","name":"_socket","nameLocation":"1630:7:0","nodeType":"VariableDeclaration","scope":124,"src":"1616:21:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":120,"name":"string","nodeType":"ElementaryTypeName","src":"1616:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"1615:23:0"},"returnParameters":{"id":123,"nodeType":"ParameterList","parameters":[],"src":"1647:0:0"},"scope":156,"src":"1594:54:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"6c9e560c","id":133,"implemented":false,"kind":"function","modifiers":[],"name":"registeredEpoch","nameLocation":"1663:15:0","nodeType":"FunctionDefinition","parameters":{"id":129,"nodeType":"ParameterList","parameters":[{"constant":false,"id":126,"mutability":"mutable","name":"_account","nameLocation":"1696:8:0","nodeType":"VariableDeclaration","scope":133,"src":"1688:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":125,"name":"address","nodeType":"ElementaryTypeName","src":"1688:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":128,"mutability":"mutable","name":"_epoch","nameLocation":"1719:6:0","nodeType":"VariableDeclaration","scope":133,"src":"1714:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":127,"name":"uint","nodeType":"ElementaryTypeName","src":"1714:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1678:53:0"},"returnParameters":{"id":132,"nodeType":"ParameterList","parameters":[{"constant":false,"id":131,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":133,"src":"1755:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":130,"name":"bool","nodeType":"ElementaryTypeName","src":"1755:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1754:6:0"},"scope":156,"src":"1654:107:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"56a32372","id":139,"implemented":false,"kind":"function","modifiers":[],"name":"registerNextEpoch","nameLocation":"1776:17:0","nodeType":"FunctionDefinition","parameters":{"id":137,"nodeType":"ParameterList","parameters":[{"constant":false,"id":136,"mutability":"mutable","name":"_signature","nameLocation":"1815:10:0","nodeType":"VariableDeclaration","scope":139,"src":"1794:31:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":135,"nodeType":"UserDefinedTypeName","pathNode":{"id":134,"name":"BN254.G1Point","nameLocations":["1794:5:0","1800:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1794:13:0"},"referencedDeclaration":6,"src":"1794:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"}],"src":"1793:33:0"},"returnParameters":{"id":138,"nodeType":"ParameterList","parameters":[],"src":"1835:0:0"},"scope":156,"src":"1767:69:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"50b73739","id":155,"implemented":false,"kind":"function","modifiers":[],"name":"getAggPkG1","nameLocation":"1851:10:0","nodeType":"FunctionDefinition","parameters":{"id":146,"nodeType":"ParameterList","parameters":[{"constant":false,"id":141,"mutability":"mutable","name":"_epoch","nameLocation":"1876:6:0","nodeType":"VariableDeclaration","scope":155,"src":"1871:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":140,"name":"uint","nodeType":"ElementaryTypeName","src":"1871:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":143,"mutability":"mutable","name":"_quorumId","nameLocation":"1897:9:0","nodeType":"VariableDeclaration","scope":155,"src":"1892:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":142,"name":"uint","nodeType":"ElementaryTypeName","src":"1892:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":145,"mutability":"mutable","name":"_quorumBitmap","nameLocation":"1929:13:0","nodeType":"VariableDeclaration","scope":155,"src":"1916:26:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":144,"name":"bytes","nodeType":"ElementaryTypeName","src":"1916:5:0","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"1861:87:0"},"returnParameters":{"id":154,"nodeType":"ParameterList","parameters":[{"constant":false,"id":149,"mutability":"mutable","name":"aggPkG1","nameLocation":"2017:7:0","nodeType":"VariableDeclaration","scope":155,"src":"1996:28:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":148,"nodeType":"UserDefinedTypeName","pathNode":{"id":147,"name":"BN254.G1Point","nameLocations":["1996:5:0","2002:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1996:13:0"},"referencedDeclaration":6,"src":"1996:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":151,"mutability":"mutable","name":"total","nameLocation":"2031:5:0","nodeType":"VariableDeclaration","scope":155,"src":"2026:10:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":150,"name":"uint","nodeType":"ElementaryTypeName","src":"2026:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":153,"mutability":"mutable","name":"hit","nameLocation":"2043:3:0","nodeType":"VariableDeclaration","scope":155,"src":"2038:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":152,"name":"uint","nodeType":"ElementaryTypeName","src":"2038:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1995:52:0"},"scope":156,"src":"1842:206:0","stateMutability":"view","virtual":false,"visibility":"external"}],"scope":157,"src":"266:1784:0","usedErrors":[],"usedEvents":[48,54]}],"src":"42:2009:0"},"id":0},"contracts/IWrappedA0GIBase.sol":{"ast":{"absolutePath":"contracts/IWrappedA0GIBase.sol","exportedSymbols":{"IWrappedA0GIBase":[198],"Supply":[165]},"id":199,"license":"LGPL-3.0-only","nodeType":"SourceUnit","nodes":[{"id":158,"literals":["solidity",">=","0.8",".0"],"nodeType":"PragmaDirective","src":"42:24:1"},{"canonicalName":"Supply","id":165,"members":[{"constant":false,"id":160,"mutability":"mutable","name":"cap","nameLocation":"96:3:1","nodeType":"VariableDeclaration","scope":165,"src":"88:11:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":159,"name":"uint256","nodeType":"ElementaryTypeName","src":"88:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":162,"mutability":"mutable","name":"initialSupply","nameLocation":"113:13:1","nodeType":"VariableDeclaration","scope":165,"src":"105:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":161,"name":"uint256","nodeType":"ElementaryTypeName","src":"105:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":164,"mutability":"mutable","name":"supply","nameLocation":"140:6:1","nodeType":"VariableDeclaration","scope":165,"src":"132:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":163,"name":"uint256","nodeType":"ElementaryTypeName","src":"132:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"Supply","nameLocation":"75:6:1","nodeType":"StructDefinition","scope":199,"src":"68:81:1","visibility":"public"},{"abstract":false,"baseContracts":[],"canonicalName":"IWrappedA0GIBase","contractDependencies":[],"contractKind":"interface","documentation":{"id":166,"nodeType":"StructuredDocumentation","src":"151:127:1","text":" @title WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly."},"fullyImplemented":false,"id":198,"linearizedBaseContracts":[198],"name":"IWrappedA0GIBase","nameLocation":"289:16:1","nodeType":"ContractDefinition","nodes":[{"documentation":{"id":167,"nodeType":"StructuredDocumentation","src":"558:46:1","text":" @dev get the wA0GI address."},"functionSelector":"a9283a7a","id":172,"implemented":false,"kind":"function","modifiers":[],"name":"getWA0GI","nameLocation":"618:8:1","nodeType":"FunctionDefinition","parameters":{"id":168,"nodeType":"ParameterList","parameters":[],"src":"626:2:1"},"returnParameters":{"id":171,"nodeType":"ParameterList","parameters":[{"constant":false,"id":170,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":172,"src":"652:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":169,"name":"address","nodeType":"ElementaryTypeName","src":"652:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"651:9:1"},"scope":198,"src":"609:52:1","stateMutability":"view","virtual":false,"visibility":"external"},{"documentation":{"id":173,"nodeType":"StructuredDocumentation","src":"1052:96:1","text":" @dev get the mint supply of given address\n @param minter minter address"},"functionSelector":"95609212","id":181,"implemented":false,"kind":"function","modifiers":[],"name":"minterSupply","nameLocation":"1162:12:1","nodeType":"FunctionDefinition","parameters":{"id":176,"nodeType":"ParameterList","parameters":[{"constant":false,"id":175,"mutability":"mutable","name":"minter","nameLocation":"1183:6:1","nodeType":"VariableDeclaration","scope":181,"src":"1175:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":174,"name":"address","nodeType":"ElementaryTypeName","src":"1175:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1174:16:1"},"returnParameters":{"id":180,"nodeType":"ParameterList","parameters":[{"constant":false,"id":179,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":181,"src":"1214:13:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Supply_$165_memory_ptr","typeString":"struct Supply"},"typeName":{"id":178,"nodeType":"UserDefinedTypeName","pathNode":{"id":177,"name":"Supply","nameLocations":["1214:6:1"],"nodeType":"IdentifierPath","referencedDeclaration":165,"src":"1214:6:1"},"referencedDeclaration":165,"src":"1214:6:1","typeDescriptions":{"typeIdentifier":"t_struct$_Supply_$165_storage_ptr","typeString":"struct Supply"}},"visibility":"internal"}],"src":"1213:15:1"},"scope":198,"src":"1153:76:1","stateMutability":"view","virtual":false,"visibility":"external"},{"documentation":{"id":182,"nodeType":"StructuredDocumentation","src":"1235:299:1","text":" @dev mint a0gi to this precompile, add corresponding amount to minter's mint supply.\n If sender's final mint supply exceeds its mint cap, the transaction will revert.\n Can only be called by WA0GI.\n @param minter minter address\n @param amount amount to mint"},"functionSelector":"40c10f19","id":189,"implemented":false,"kind":"function","modifiers":[],"name":"mint","nameLocation":"1548:4:1","nodeType":"FunctionDefinition","parameters":{"id":187,"nodeType":"ParameterList","parameters":[{"constant":false,"id":184,"mutability":"mutable","name":"minter","nameLocation":"1561:6:1","nodeType":"VariableDeclaration","scope":189,"src":"1553:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":183,"name":"address","nodeType":"ElementaryTypeName","src":"1553:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":186,"mutability":"mutable","name":"amount","nameLocation":"1577:6:1","nodeType":"VariableDeclaration","scope":189,"src":"1569:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":185,"name":"uint256","nodeType":"ElementaryTypeName","src":"1569:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1552:32:1"},"returnParameters":{"id":188,"nodeType":"ParameterList","parameters":[],"src":"1593:0:1"},"scope":198,"src":"1539:55:1","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"documentation":{"id":190,"nodeType":"StructuredDocumentation","src":"1600:233:1","text":" @dev burn given amount of a0gi on behalf of minter, reduce corresponding amount from sender's mint supply.\n Can only be called by WA0GI.\n @param minter minter address\n @param amount amount to burn"},"functionSelector":"9dc29fac","id":197,"implemented":false,"kind":"function","modifiers":[],"name":"burn","nameLocation":"1847:4:1","nodeType":"FunctionDefinition","parameters":{"id":195,"nodeType":"ParameterList","parameters":[{"constant":false,"id":192,"mutability":"mutable","name":"minter","nameLocation":"1860:6:1","nodeType":"VariableDeclaration","scope":197,"src":"1852:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":191,"name":"address","nodeType":"ElementaryTypeName","src":"1852:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":194,"mutability":"mutable","name":"amount","nameLocation":"1876:6:1","nodeType":"VariableDeclaration","scope":197,"src":"1868:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":193,"name":"uint256","nodeType":"ElementaryTypeName","src":"1868:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1851:32:1"},"returnParameters":{"id":196,"nodeType":"ParameterList","parameters":[],"src":"1892:0:1"},"scope":198,"src":"1838:55:1","stateMutability":"nonpayable","virtual":false,"visibility":"external"}],"scope":199,"src":"279:1616:1","usedErrors":[],"usedEvents":[]}],"src":"42:1854:1"},"id":1}},"contracts":{"contracts/IDASigners.sol":{"BN254":{"abi":[],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201bc5ce87162a146d69c64f0bea678aa6b635136c2b5b8de9f9f9621d903e8a3664736f6c63430008140033","opcodes":"PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SHL 0xC5 0xCE DUP8 AND 0x2A EQ PUSH14 0x69C64F0BEA678AA6B635136C2B5B DUP14 0xE9 0xF9 0xF9 PUSH3 0x1D903E DUP11 CALLDATASIZE PUSH5 0x736F6C6343 STOP ADDMOD EQ STOP CALLER ","sourceMap":"68:196:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;68:196:0;;;;;;;;;;;;;;;;;"},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201bc5ce87162a146d69c64f0bea678aa6b635136c2b5b8de9f9f9621d903e8a3664736f6c63430008140033","opcodes":"PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SHL 0xC5 0xCE DUP8 AND 0x2A EQ PUSH14 0x69C64F0BEA678AA6B635136C2B5B DUP14 0xE9 0xF9 0xF9 PUSH3 0x1D903E DUP11 CALLDATASIZE PUSH5 0x736F6C6343 STOP ADDMOD EQ STOP CALLER ","sourceMap":"68:196:0:-:0;;;;;;;;"},"methodIdentifiers":{}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IDASigners.sol\":\"BN254\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IDASigners.sol\":{\"keccak256\":\"0xcee17b82796cec7350837b097be51beb97b4b33b53b81c64206533e5027c2e36\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://15963ce1e8afb9c888be8ab6afdbee2e7e7f75e7af34644ad85965d3e97d7aaf\",\"dweb:/ipfs/QmUxw9EqN841nnMxTL5hBKSf8NNBPTxc3gzGXhyApUquDi\"]}},\"version\":1}"},"IDASigners":{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"indexed":false,"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"indexed":false,"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"name":"NewSigner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"string","name":"socket","type":"string"}],"name":"SocketUpdated","type":"event"},{"inputs":[],"name":"epochNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"},{"internalType":"bytes","name":"_quorumBitmap","type":"bytes"}],"name":"getAggPkG1","outputs":[{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"aggPkG1","type":"tuple"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"hit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"}],"name":"getQuorum","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"},{"internalType":"uint32","name":"_rowIndex","type":"uint32"}],"name":"getQuorumRow","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_account","type":"address[]"}],"name":"getSigner","outputs":[{"components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"string","name":"socket","type":"string"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"internalType":"struct IDASigners.SignerDetail[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"params","outputs":[{"components":[{"internalType":"uint256","name":"tokensPerVote","type":"uint256"},{"internalType":"uint256","name":"maxVotesPerSigner","type":"uint256"},{"internalType":"uint256","name":"maxQuorums","type":"uint256"},{"internalType":"uint256","name":"epochBlocks","type":"uint256"},{"internalType":"uint256","name":"encodedSlices","type":"uint256"}],"internalType":"struct IDASigners.Params","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"quorumCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"_signature","type":"tuple"}],"name":"registerNextEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"string","name":"socket","type":"string"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"internalType":"struct IDASigners.SignerDetail","name":"_signer","type":"tuple"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"_signature","type":"tuple"}],"name":"registerSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"registeredEpoch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_socket","type":"string"}],"name":"updateSocket","outputs":[],"stateMutability":"nonpayable","type":"function"}],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"methodIdentifiers":{"epochNumber()":"f4145a83","getAggPkG1(uint256,uint256,bytes)":"50b73739","getQuorum(uint256,uint256)":"6ab6f654","getQuorumRow(uint256,uint256,uint32)":"fa6fcba6","getSigner(address[])":"d1f5e5f8","isSigner(address)":"7df73e27","params()":"cff0ab96","quorumCount(uint256)":"5ecba503","registerNextEpoch((uint256,uint256))":"56a32372","registerSigner((address,string,(uint256,uint256),(uint256[2],uint256[2])),(uint256,uint256))":"7ca4dd5e","registeredEpoch(address,uint256)":"6c9e560c","updateSocket(string)":"0cf4b767"}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"struct IDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"struct IDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"struct IDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IDASigners.sol\":\"IDASigners\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IDASigners.sol\":{\"keccak256\":\"0xcee17b82796cec7350837b097be51beb97b4b33b53b81c64206533e5027c2e36\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://15963ce1e8afb9c888be8ab6afdbee2e7e7f75e7af34644ad85965d3e97d7aaf\",\"dweb:/ipfs/QmUxw9EqN841nnMxTL5hBKSf8NNBPTxc3gzGXhyApUquDi\"]}},\"version\":1}"}},"contracts/IWrappedA0GIBase.sol":{"IWrappedA0GIBase":{"abi":[{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getWA0GI","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"minterSupply","outputs":[{"components":[{"internalType":"uint256","name":"cap","type":"uint256"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"}],"internalType":"struct Supply","name":"","type":"tuple"}],"stateMutability":"view","type":"function"}],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"methodIdentifiers":{"burn(address,uint256)":"9dc29fac","getWA0GI()":"a9283a7a","mint(address,uint256)":"40c10f19","minterSupply(address)":"95609212"}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWA0GI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"}],\"internalType\":\"struct Supply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"burn(address,uint256)\":{\"details\":\"burn given amount of a0gi on behalf of minter, reduce corresponding amount from sender's mint supply. Can only be called by WA0GI.\",\"params\":{\"amount\":\"amount to burn\",\"minter\":\"minter address\"}},\"getWA0GI()\":{\"details\":\"get the wA0GI address.\"},\"mint(address,uint256)\":{\"details\":\"mint a0gi to this precompile, add corresponding amount to minter's mint supply. If sender's final mint supply exceeds its mint cap, the transaction will revert. Can only be called by WA0GI.\",\"params\":{\"amount\":\"amount to mint\",\"minter\":\"minter address\"}},\"minterSupply(address)\":{\"details\":\"get the mint supply of given address\",\"params\":{\"minter\":\"minter address\"}}},\"title\":\"WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IWrappedA0GIBase.sol\":\"IWrappedA0GIBase\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IWrappedA0GIBase.sol\":{\"keccak256\":\"0xc3d7651403ceec70fc2682ec6760f938a0a712c3a3c541fb0ab4166f9cb99760\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://7c3d3b6e2b1a928fac7761c30ce495f4f6d379b91eca90826317eda1eb62b544\",\"dweb:/ipfs/QmbNAYMDNv4UBNCZUTk6sDbvVoHn4hwabDAvQxet4g8C1b\"]}},\"version\":1}"}}}}} \ No newline at end of file diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.dbg.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.dbg.json new file mode 100644 index 0000000000..8bad1cfed3 --- /dev/null +++ b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.dbg.json @@ -0,0 +1,4 @@ +{ + "_format": "hh-sol-dbg-1", + "buildInfo": "../../build-info/377589efa765dec208356377872d3755.json" +} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.json new file mode 100644 index 0000000000..fe3a8cc615 --- /dev/null +++ b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.json @@ -0,0 +1,10 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "BN254", + "sourceName": "contracts/IDASigners.sol", + "abi": [], + "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220abc43d74fec9de74f3b7a60ee2e0337c23369163d8fb7a1e1cb0037a16d8abfb64736f6c63430008140033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220abc43d74fec9de74f3b7a60ee2e0337c23369163d8fb7a1e1cb0037a16d8abfb64736f6c63430008140033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.dbg.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.dbg.json new file mode 100644 index 0000000000..8bad1cfed3 --- /dev/null +++ b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.dbg.json @@ -0,0 +1,4 @@ +{ + "_format": "hh-sol-dbg-1", + "buildInfo": "../../build-info/377589efa765dec208356377872d3755.json" +} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.json new file mode 100644 index 0000000000..a9a679b4c2 --- /dev/null +++ b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.json @@ -0,0 +1,484 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "IDASigners", + "sourceName": "contracts/IDASigners.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "indexed": false, + "internalType": "struct BN254.G1Point", + "name": "pkG1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "X", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "Y", + "type": "uint256[2]" + } + ], + "indexed": false, + "internalType": "struct BN254.G2Point", + "name": "pkG2", + "type": "tuple" + } + ], + "name": "NewSigner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "string", + "name": "socket", + "type": "string" + } + ], + "name": "SocketUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "epochNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorumId", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "_quorumBitmap", + "type": "bytes" + } + ], + "name": "getAggPkG1", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "aggPkG1", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "hit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorumId", + "type": "uint256" + } + ], + "name": "getQuorum", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorumId", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "_rowIndex", + "type": "uint32" + } + ], + "name": "getQuorumRow", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_account", + "type": "address[]" + } + ], + "name": "getSigner", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "string", + "name": "socket", + "type": "string" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "pkG1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "X", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "Y", + "type": "uint256[2]" + } + ], + "internalType": "struct BN254.G2Point", + "name": "pkG2", + "type": "tuple" + } + ], + "internalType": "struct IDASigners.SignerDetail[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "isSigner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "makeEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "params", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensPerVote", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxVotesPerSigner", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxQuorums", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "epochBlocks", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "encodedSlices", + "type": "uint256" + } + ], + "internalType": "struct IDASigners.Params", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "quorumCount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "_signature", + "type": "tuple" + } + ], + "name": "registerNextEpoch", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "string", + "name": "socket", + "type": "string" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "pkG1", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "X", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2]", + "name": "Y", + "type": "uint256[2]" + } + ], + "internalType": "struct BN254.G2Point", + "name": "pkG2", + "type": "tuple" + } + ], + "internalType": "struct IDASigners.SignerDetail", + "name": "_signer", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "X", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "Y", + "type": "uint256" + } + ], + "internalType": "struct BN254.G1Point", + "name": "_signature", + "type": "tuple" + } + ], + "name": "registerSigner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_epoch", + "type": "uint256" + } + ], + "name": "registeredEpoch", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_socket", + "type": "string" + } + ], + "name": "updateSocket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.dbg.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.dbg.json new file mode 100644 index 0000000000..a79d40a1dd --- /dev/null +++ b/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.dbg.json @@ -0,0 +1,4 @@ +{ + "_format": "hh-sol-dbg-1", + "buildInfo": "../../build-info/c79ff14473359160d0c7a65892d5cb52.json" +} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.json new file mode 100644 index 0000000000..ff537b54ae --- /dev/null +++ b/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.json @@ -0,0 +1,96 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "IWrappedA0GIBase", + "sourceName": "contracts/IWrappedA0GIBase.sol", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getWA0GI", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "minterSupply", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialSupply", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "supply", + "type": "uint256" + } + ], + "internalType": "struct Supply", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/core/vm/precompiles/interfaces/build/cache/solidity-files-cache.json b/core/vm/precompiles/interfaces/build/cache/solidity-files-cache.json new file mode 100644 index 0000000000..23fa861825 --- /dev/null +++ b/core/vm/precompiles/interfaces/build/cache/solidity-files-cache.json @@ -0,0 +1,78 @@ +{ + "_format": "hh-sol-cache-2", + "files": { + "/Users/wangfan/Project/0g-geth/core/vm/precompiles/interfaces/contracts/IDASigners.sol": { + "lastModificationDate": 1743021984706, + "contentHash": "dbe903452c6de71caa950fdb306027b3", + "sourceName": "contracts/IDASigners.sol", + "solcConfig": { + "version": "0.8.20", + "settings": { + "evmVersion": "istanbul", + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata" + ], + "": [ + "ast" + ] + } + } + } + }, + "imports": [], + "versionPragmas": [ + ">=0.8.0" + ], + "artifacts": [ + "BN254", + "IDASigners" + ] + }, + "/Users/wangfan/Project/0g-geth/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol": { + "lastModificationDate": 1743006728499, + "contentHash": "1d44f536ff2a527d2afe8a4ef85adc7b", + "sourceName": "contracts/IWrappedA0GIBase.sol", + "solcConfig": { + "version": "0.8.20", + "settings": { + "evmVersion": "istanbul", + "optimizer": { + "enabled": true, + "runs": 200 + }, + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata" + ], + "": [ + "ast" + ] + } + } + } + }, + "imports": [], + "versionPragmas": [ + ">=0.8.0" + ], + "artifacts": [ + "IWrappedA0GIBase" + ] + } + } +} diff --git a/core/vm/precompiles/interfaces/contracts/IDASigners.sol b/core/vm/precompiles/interfaces/contracts/IDASigners.sol new file mode 100644 index 0000000000..050a1a69c6 --- /dev/null +++ b/core/vm/precompiles/interfaces/contracts/IDASigners.sol @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: LGPL-3.0-only +pragma solidity >=0.8.0; + +library BN254 { + struct G1Point { + uint X; + uint Y; + } + + // Encoding of field elements is: X[1] * i + X[0] + struct G2Point { + uint[2] X; + uint[2] Y; + } +} + +interface IDASigners { + /*=== struct ===*/ + struct SignerDetail { + address signer; + string socket; + BN254.G1Point pkG1; + BN254.G2Point pkG2; + } + + struct Params { + uint tokensPerVote; + uint maxVotesPerSigner; + uint maxQuorums; + uint epochBlocks; + uint encodedSlices; + } + + /*=== event ===*/ + event NewSigner( + address indexed signer, + BN254.G1Point pkG1, + BN254.G2Point pkG2 + ); + event SocketUpdated(address indexed signer, string socket); + + /*=== function ===*/ + function params() external view returns (Params memory); + + function epochNumber() external view returns (uint); + + function quorumCount(uint _epoch) external view returns (uint); + + function isSigner(address _account) external view returns (bool); + + function getSigner( + address[] memory _account + ) external view returns (SignerDetail[] memory); + + function getQuorum( + uint _epoch, + uint _quorumId + ) external view returns (address[] memory); + + function getQuorumRow( + uint _epoch, + uint _quorumId, + uint32 _rowIndex + ) external view returns (address); + + function registerSigner( + SignerDetail memory _signer, + BN254.G1Point memory _signature + ) external; + + function updateSocket(string memory _socket) external; + + function registeredEpoch( + address _account, + uint _epoch + ) external view returns (bool); + + function registerNextEpoch(BN254.G1Point memory _signature) external; + + function makeEpoch() external; + + function getAggPkG1( + uint _epoch, + uint _quorumId, + bytes memory _quorumBitmap + ) + external + view + returns (BN254.G1Point memory aggPkG1, uint total, uint hit); +} diff --git a/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol b/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol new file mode 100644 index 0000000000..614208a801 --- /dev/null +++ b/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: LGPL-3.0-only +pragma solidity >=0.8.0; + +struct Supply { + uint256 cap; + uint256 initialSupply; + uint256 supply; +} + +/** + * @title WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly. + */ +interface IWrappedA0GIBase { + /** + * @dev set the wA0GI address. + * It is designed to be called by governance module only so it's not implemented at EVM precompile side. + * @param addr address of wA0GI + */ + // function setWA0GI(address addr) external; + + /** + * @dev get the wA0GI address. + */ + function getWA0GI() external view returns (address); + + /** + * @dev set the cap and initial supply for a minter. + * It is designed to be called by governance module only so it's not implemented at EVM precompile side. + * @param minter minter address + * @param cap mint cap + * @param initialSupply initial mint supply + */ + // function setMinterCap(address minter, uint256 cap, uint256 initialSupply) external; + + /** + * @dev get the mint supply of given address + * @param minter minter address + */ + function minterSupply(address minter) external view returns (Supply memory); + + /** + * @dev mint a0gi to this precompile, add corresponding amount to minter's mint supply. + * If sender's final mint supply exceeds its mint cap, the transaction will revert. + * Can only be called by WA0GI. + * @param minter minter address + * @param amount amount to mint + */ + function mint(address minter, uint256 amount) external; + + /** + * @dev burn given amount of a0gi on behalf of minter, reduce corresponding amount from sender's mint supply. + * Can only be called by WA0GI. + * @param minter minter address + * @param amount amount to burn + */ + function burn(address minter, uint256 amount) external; +} diff --git a/core/vm/precompiles/interfaces/hardhat.config.ts b/core/vm/precompiles/interfaces/hardhat.config.ts new file mode 100644 index 0000000000..43757e6ad8 --- /dev/null +++ b/core/vm/precompiles/interfaces/hardhat.config.ts @@ -0,0 +1,33 @@ +import "hardhat-abi-exporter"; +import { HardhatUserConfig } from "hardhat/types"; + +const config: HardhatUserConfig = { + paths: { + artifacts: "build/artifacts", + cache: "build/cache", + sources: "contracts", + }, + solidity: { + compilers: [ + { + version: "0.8.20", + settings: { + evmVersion: "istanbul", + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + ], + }, + abiExporter: { + path: "./abis", + runOnCompile: true, + clear: true, + flat: true, + format: "json", + }, +}; + +export default config; diff --git a/core/vm/precompiles/interfaces/package.json b/core/vm/precompiles/interfaces/package.json new file mode 100644 index 0000000000..b144f19b94 --- /dev/null +++ b/core/vm/precompiles/interfaces/package.json @@ -0,0 +1,27 @@ +{ + "name": "precompile-contracts", + "version": "1.0.0", + "license": "MIT", + "scripts": { + "build": "hardhat compile", + "fmt:sol": "prettier 'contracts/**/*.sol' -w" + }, + "devDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.5", + "@typescript-eslint/eslint-plugin": "6.21.0", + "@typescript-eslint/parser": "6.21.0", + "eslint": "8.34.0", + "eslint-config-prettier": "8.6.0", + "eslint-plugin-no-only-tests": "3.1.0", + "eslint-plugin-prettier": "4.2.1", + "hardhat": "^2.22.2", + "hardhat-abi-exporter": "^2.10.1", + "prettier": "2.8.4", + "prettier-plugin-organize-imports": "3.2.4", + "prettier-plugin-solidity": "1.1.2", + "solhint": "^4.5.4", + "solhint-plugin-prettier": "0.0.5", + "ts-node": "^10.9.2", + "typescript": "4.9.5" + } +} diff --git a/core/vm/precompiles/interfaces/yarn.lock b/core/vm/precompiles/interfaces/yarn.lock new file mode 100644 index 0000000000..6f74526d41 --- /dev/null +++ b/core/vm/precompiles/interfaces/yarn.lock @@ -0,0 +1,3152 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.25.9.tgz#895b6c7e04a7271a0cbfd575d2e8131751914cc7" + integrity sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ== + dependencies: + "@babel/highlight" "^7.25.9" + picocolors "^1.0.0" + +"@babel/helper-validator-identifier@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz#24b64e2c3ec7cd3b3c547729b8d16871f22cbdc7" + integrity sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ== + +"@babel/highlight@^7.25.9": + version "7.25.9" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.25.9.tgz#8141ce68fc73757946f983b343f1231f4691acc6" + integrity sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw== + dependencies: + "@babel/helper-validator-identifier" "^7.25.9" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + +"@eslint-community/eslint-utils@^4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.5.1": + version "4.11.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.1.tgz#a547badfc719eb3e5f4b556325e542fbe9d7a18f" + integrity sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q== + +"@eslint/eslintrc@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" + integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.4.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.5.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/hash" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/abstract-provider@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/transactions" "^5.7.0" + "@ethersproject/web" "^5.7.0" + +"@ethersproject/abstract-signer@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== + dependencies: + "@ethersproject/abstract-provider" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + +"@ethersproject/address@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + +"@ethersproject/base64@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== + dependencies: + "@ethersproject/bytes" "^5.7.0" + +"@ethersproject/bignumber@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + bn.js "^5.2.1" + +"@ethersproject/bytes@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/constants@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + +"@ethersproject/hash@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== + dependencies: + "@ethersproject/abstract-signer" "^5.7.0" + "@ethersproject/address" "^5.7.0" + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@ethersproject/keccak256@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + js-sha3 "0.8.0" + +"@ethersproject/logger@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== + +"@ethersproject/networks@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/properties@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== + dependencies: + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/rlp@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/signing-key@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + bn.js "^5.2.1" + elliptic "6.5.4" + hash.js "1.1.7" + +"@ethersproject/strings@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== + dependencies: + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + +"@ethersproject/transactions@^5.7.0": + version "5.7.0" + resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== + dependencies: + "@ethersproject/address" "^5.7.0" + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/constants" "^5.7.0" + "@ethersproject/keccak256" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/rlp" "^5.7.0" + "@ethersproject/signing-key" "^5.7.0" + +"@ethersproject/web@^5.7.0": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== + dependencies: + "@ethersproject/base64" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + +"@fastify/busboy@^2.0.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" + integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== + +"@humanwhocodes/config-array@^0.11.8": + version "0.11.14" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" + integrity sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg== + dependencies: + "@humanwhocodes/object-schema" "^2.0.2" + debug "^4.3.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" + integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== + +"@jridgewell/resolve-uri@^3.0.3": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@metamask/eth-sig-util@^4.0.0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" + integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== + dependencies: + ethereumjs-abi "^0.6.8" + ethereumjs-util "^6.2.1" + ethjs-util "^0.1.6" + tweetnacl "^1.0.3" + tweetnacl-util "^0.15.1" + +"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== + +"@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@nomicfoundation/edr-darwin-arm64@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.6.4.tgz#6eaa64a6ea5201e4c92b121f2b7fd197b26e450a" + integrity sha512-QNQErISLgssV9+qia8sIjRANqtbW8snSDvjspixT/kSQ5ZSGxxctTg7x72wPSrcu8+EBEveIe5uqENIp5GH8HQ== + +"@nomicfoundation/edr-darwin-x64@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.6.4.tgz#d15ca89e9deef7d0a710cf90e79f3cc270a5a999" + integrity sha512-cjVmREiwByyc9+oGfvAh49IAw+oVJHF9WWYRD+Tm/ZlSpnEVWxrGNBak2bd/JSYjn+mZE7gmWS4SMRi4nKaLUg== + +"@nomicfoundation/edr-linux-arm64-gnu@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.6.4.tgz#e73c41ca015dfddb5f4cb6cd3d9b2cbe5cc28989" + integrity sha512-96o9kRIVD6W5VkgKvUOGpWyUGInVQ5BRlME2Fa36YoNsRQMaKtmYJEU0ACosYES6ZTpYC8U5sjMulvPtVoEfOA== + +"@nomicfoundation/edr-linux-arm64-musl@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.6.4.tgz#90906f733e4ad26657baeb22d28855d934ab7541" + integrity sha512-+JVEW9e5plHrUfQlSgkEj/UONrIU6rADTEk+Yp9pbe+mzNkJdfJYhs5JYiLQRP4OjxH4QOrXI97bKU6FcEbt5Q== + +"@nomicfoundation/edr-linux-x64-gnu@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.6.4.tgz#11b8bd73df145a192e5a08199e5e81995fcde502" + integrity sha512-nzYWW+fO3EZItOeP4CrdMgDXfaGBIBkKg0Y/7ySpUxLqzut40O4Mb0/+quqLAFkacUSWMlFp8nsmypJfOH5zoA== + +"@nomicfoundation/edr-linux-x64-musl@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.6.4.tgz#a34b9a2c9e34853207824dc81622668a069ca642" + integrity sha512-QFRoE9qSQ2boRrVeQ1HdzU+XN7NUgwZ1SIy5DQt4d7jCP+5qTNsq8LBNcqhRBOATgO63nsweNUhxX/Suj5r1Sw== + +"@nomicfoundation/edr-win32-x64-msvc@0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.6.4.tgz#ca035c6f66ae9f88fa3ef123a1f3a2099cce7a5a" + integrity sha512-2yopjelNkkCvIjUgBGhrn153IBPLwnsDeNiq6oA0WkeM8tGmQi4td+PGi9jAriUDAkc59Yoi2q9hYA6efiY7Zw== + +"@nomicfoundation/edr@^0.6.4": + version "0.6.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.6.4.tgz#1cd336c46a60f5af774e6cf0f1943f49f63dded6" + integrity sha512-YgrSuT3yo5ZQkbvBGqQ7hG+RDvz3YygSkddg4tb1Z0Y6pLXFzwrcEwWaJCFAVeeZxdxGfCgGMUYgRVneK+WXkw== + dependencies: + "@nomicfoundation/edr-darwin-arm64" "0.6.4" + "@nomicfoundation/edr-darwin-x64" "0.6.4" + "@nomicfoundation/edr-linux-arm64-gnu" "0.6.4" + "@nomicfoundation/edr-linux-arm64-musl" "0.6.4" + "@nomicfoundation/edr-linux-x64-gnu" "0.6.4" + "@nomicfoundation/edr-linux-x64-musl" "0.6.4" + "@nomicfoundation/edr-win32-x64-msvc" "0.6.4" + +"@nomicfoundation/ethereumjs-common@4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz#9901f513af2d4802da87c66d6f255b510bef5acb" + integrity sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg== + dependencies: + "@nomicfoundation/ethereumjs-util" "9.0.4" + +"@nomicfoundation/ethereumjs-rlp@5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz#66c95256fc3c909f6fb18f6a586475fc9762fa30" + integrity sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw== + +"@nomicfoundation/ethereumjs-tx@5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz#b0ceb58c98cc34367d40a30d255d6315b2f456da" + integrity sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-rlp" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/ethereumjs-util@9.0.4": + version "9.0.4" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz#84c5274e82018b154244c877b76bc049a4ed7b38" + integrity sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q== + dependencies: + "@nomicfoundation/ethereumjs-rlp" "5.0.4" + ethereum-cryptography "0.1.3" + +"@nomicfoundation/hardhat-ethers@^3.0.5": + version "3.0.8" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.8.tgz#af078f566373abeb77e11cbe69fe3dd47f8bfc27" + integrity sha512-zhOZ4hdRORls31DTOqg+GmEZM0ujly8GGIuRY7t7szEk2zW/arY1qDug/py8AEktT00v5K+b6RvbVog+va51IA== + dependencies: + debug "^4.1.1" + lodash.isequal "^4.5.0" + +"@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.2.tgz#3a9c3b20d51360b20affb8f753e756d553d49557" + integrity sha512-JaqcWPDZENCvm++lFFGjrDd8mxtf+CtLd2MiXvMNTBD33dContTZ9TWETwNFwg7JTJT5Q9HEecH7FA+HTSsIUw== + +"@nomicfoundation/solidity-analyzer-darwin-x64@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.2.tgz#74dcfabeb4ca373d95bd0d13692f44fcef133c28" + integrity sha512-fZNmVztrSXC03e9RONBT+CiksSeYcxI1wlzqyr0L7hsQlK1fzV+f04g2JtQ1c/Fe74ZwdV6aQBdd6Uwl1052sw== + +"@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.2.tgz#4af5849a89e5a8f511acc04f28eb5d4460ba2b6a" + integrity sha512-3d54oc+9ZVBuB6nbp8wHylk4xh0N0Gc+bk+/uJae+rUgbOBwQSfuGIbAZt1wBXs5REkSmynEGcqx6DutoK0tPA== + +"@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.2.tgz#54036808a9a327b2ff84446c130a6687ee702a8e" + integrity sha512-iDJfR2qf55vgsg7BtJa7iPiFAsYf2d0Tv/0B+vhtnI16+wfQeTbP7teookbGvAo0eJo7aLLm0xfS/GTkvHIucA== + +"@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.2.tgz#466cda0d6e43691986c944b909fc6dbb8cfc594e" + integrity sha512-9dlHMAt5/2cpWyuJ9fQNOUXFB/vgSFORg1jpjX1Mh9hJ/MfZXlDdHQ+DpFCs32Zk5pxRBb07yGvSHk9/fezL+g== + +"@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.2.tgz#2b35826987a6e94444140ac92310baa088ee7f94" + integrity sha512-GzzVeeJob3lfrSlDKQw2bRJ8rBf6mEYaWY+gW0JnTDHINA0s2gPR4km5RLIj1xeZZOYz4zRw+AEeYgLRqB2NXg== + +"@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.2": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.2.tgz#e6363d13b8709ca66f330562337dbc01ce8bbbd9" + integrity sha512-Fdjli4DCcFHb4Zgsz0uEJXZ2K7VEO+w5KVv7HmT7WO10iODdU9csC2az4jrhEsRtiR9Gfd74FlG0NYlw1BMdyA== + +"@nomicfoundation/solidity-analyzer@^0.1.0": + version "0.1.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.2.tgz#8bcea7d300157bf3a770a851d9f5c5e2db34ac55" + integrity sha512-q4n32/FNKIhQ3zQGGw5CvPF6GTvDCpYwIf7bEY/dZTZbgfDsHyjJwURxUJf3VQuuJj+fDIFl4+KkBVbw4Ef6jA== + optionalDependencies: + "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.2" + "@nomicfoundation/solidity-analyzer-darwin-x64" "0.1.2" + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu" "0.1.2" + "@nomicfoundation/solidity-analyzer-linux-arm64-musl" "0.1.2" + "@nomicfoundation/solidity-analyzer-linux-x64-gnu" "0.1.2" + "@nomicfoundation/solidity-analyzer-linux-x64-musl" "0.1.2" + "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.2" + +"@pnpm/config.env-replace@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c" + integrity sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w== + +"@pnpm/network.ca-file@^1.0.1": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz#2ab05e09c1af0cdf2fcf5035bea1484e222f7983" + integrity sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA== + dependencies: + graceful-fs "4.2.10" + +"@pnpm/npm-conf@^2.1.0": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz#bb375a571a0bd63ab0a23bece33033c683e9b6b0" + integrity sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw== + dependencies: + "@pnpm/config.env-replace" "^1.1.0" + "@pnpm/network.ca-file" "^1.0.1" + config-chain "^1.1.11" + +"@scure/base@~1.1.0": + version "1.1.9" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.9.tgz#e5e142fbbfe251091f9c5f1dd4c834ac04c3dbd1" + integrity sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg== + +"@scure/bip32@1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" + integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== + dependencies: + "@noble/hashes" "~1.2.0" + "@noble/secp256k1" "~1.7.0" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" + integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== + dependencies: + "@noble/hashes" "~1.2.0" + "@scure/base" "~1.1.0" + +"@sentry/core@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" + integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/hub@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" + integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== + dependencies: + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/minimal@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" + integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sentry/node@^5.18.1": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" + integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== + dependencies: + "@sentry/core" "5.30.0" + "@sentry/hub" "5.30.0" + "@sentry/tracing" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + cookie "^0.4.1" + https-proxy-agent "^5.0.0" + lru_map "^0.3.3" + tslib "^1.9.3" + +"@sentry/tracing@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" + integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== + dependencies: + "@sentry/hub" "5.30.0" + "@sentry/minimal" "5.30.0" + "@sentry/types" "5.30.0" + "@sentry/utils" "5.30.0" + tslib "^1.9.3" + +"@sentry/types@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" + integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== + +"@sentry/utils@5.30.0": + version "5.30.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" + integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== + dependencies: + "@sentry/types" "5.30.0" + tslib "^1.9.3" + +"@sindresorhus/is@^5.2.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-5.6.0.tgz#41dd6093d34652cddb5d5bdeee04eafc33826668" + integrity sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g== + +"@solidity-parser/parser@^0.15.0": + version "0.15.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.15.0.tgz#1d359be40be84f174dd616ccfadcf43346c6bf63" + integrity sha512-5UFJJTzWi1hgFk6aGCZ5rxG2DJkCJOzJ74qg7UkWSNCDSigW+CJLoYUb5bLiKrtI34Nr9rpFSUNHfkqtlL+N/w== + dependencies: + antlr4ts "^0.5.0-alpha.4" + +"@solidity-parser/parser@^0.18.0": + version "0.18.0" + resolved "https://registry.yarnpkg.com/@solidity-parser/parser/-/parser-0.18.0.tgz#8e77a02a09ecce957255a2f48c9a7178ec191908" + integrity sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA== + +"@szmarczak/http-timer@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-5.0.1.tgz#c7c1bf1141cdd4751b0399c8fc7b8b664cd5be3a" + integrity sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw== + dependencies: + defer-to-connect "^2.0.1" + +"@tsconfig/node10@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2" + integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + +"@types/bn.js@^4.11.3": + version "4.11.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== + dependencies: + "@types/node" "*" + +"@types/bn.js@^5.1.0": + version "5.1.6" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.6.tgz#9ba818eec0c85e4d3c679518428afdf611d03203" + integrity sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w== + dependencies: + "@types/node" "*" + +"@types/http-cache-semantics@^4.0.2": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz#b979ebad3919799c979b17c72621c0bc0a31c6c4" + integrity sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA== + +"@types/json-schema@^7.0.12": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + +"@types/lru-cache@^5.1.0": + version "5.1.1" + resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" + integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== + +"@types/node@*": + version "22.7.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.9.tgz#2bf2797b5e84702d8262ea2cf843c3c3c880d0e9" + integrity sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg== + dependencies: + undici-types "~6.19.2" + +"@types/pbkdf2@^3.0.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.2.tgz#2dc43808e9985a2c69ff02e2d2027bd4fe33e8dc" + integrity sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew== + dependencies: + "@types/node" "*" + +"@types/secp256k1@^4.0.1": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.6.tgz#d60ba2349a51c2cbc5e816dcd831a42029d376bf" + integrity sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ== + dependencies: + "@types/node" "*" + +"@types/semver@^7.5.0": + version "7.5.8" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" + integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== + +"@typescript-eslint/eslint-plugin@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" + integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== + dependencies: + "@eslint-community/regexpp" "^4.5.1" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/type-utils" "6.21.0" + "@typescript-eslint/utils" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" + debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/parser@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" + integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== + dependencies: + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" + integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== + dependencies: + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" + +"@typescript-eslint/type-utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" + integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== + dependencies: + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/utils" "6.21.0" + debug "^4.3.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/types@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" + integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== + +"@typescript-eslint/typescript-estree@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" + integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== + dependencies: + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "9.0.3" + semver "^7.5.4" + ts-api-utils "^1.0.1" + +"@typescript-eslint/utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" + integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@types/json-schema" "^7.0.12" + "@types/semver" "^7.5.0" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" + semver "^7.5.4" + +"@typescript-eslint/visitor-keys@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" + integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== + dependencies: + "@typescript-eslint/types" "6.21.0" + eslint-visitor-keys "^3.4.1" + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn-walk@^8.1.1: + version "8.3.4" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" + +acorn@^8.11.0, acorn@^8.4.1, acorn@^8.9.0: + version "8.13.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.13.0.tgz#2a30d670818ad16ddd6a35d3842dacec9e5d7ca3" + integrity sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w== + +adm-zip@^0.4.16: + version "0.4.16" + resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +aggregate-error@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + +ajv@^6.10.0, ajv@^6.12.4, ajv@^6.12.6: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ajv@^8.0.1: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + +ansi-align@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== + dependencies: + string-width "^4.1.0" + +ansi-colors@^4.1.0, ansi-colors@^4.1.1, ansi-colors@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + +ansi-escapes@^4.3.0: + version "4.3.2" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== + dependencies: + type-fest "^0.21.3" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.0.0, ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +antlr4@^4.13.1-patch-1: + version "4.13.2" + resolved "https://registry.yarnpkg.com/antlr4/-/antlr4-4.13.2.tgz#0d084ad0e32620482a9c3a0e2470c02e72e4006d" + integrity sha512-QiVbZhyy4xAZ17UPEuG3YTOt8ZaoeOR1CvEAqrEsDBsOqINslaB147i9xqljZqoyf5S+EUlGStaj+t22LT9MOg== + +antlr4ts@^0.5.0-alpha.4: + version "0.5.0-alpha.4" + resolved "https://registry.yarnpkg.com/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz#71702865a87478ed0b40c0709f422cf14d51652a" + integrity sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ== + +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +arg@^4.1.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +ast-parents@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/ast-parents/-/ast-parents-0.0.1.tgz#508fd0f05d0c48775d9eccda2e174423261e8dd3" + integrity sha512-XHusKxKz3zoYk1ic8Un640joHbFMhbqneyoZfoKnEGtf2ey9Uh/IdpcQplODdO/kENaMIWsD0nJm4+wX3UNLHA== + +astral-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base-x@^3.0.2: + version "3.0.10" + resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.10.tgz#62de58653f8762b5d6f8d9fe30fa75f7b2585a75" + integrity sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ== + dependencies: + safe-buffer "^5.0.1" + +binary-extensions@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== + +blakejs@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== + +bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +boxen@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== + dependencies: + ansi-align "^3.0.0" + camelcase "^6.2.0" + chalk "^4.1.0" + cli-boxes "^2.2.1" + string-width "^4.2.2" + type-fest "^0.20.2" + widest-line "^3.1.0" + wrap-ansi "^7.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^3.0.3, braces@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +browser-stdout@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +bs58@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== + dependencies: + base-x "^3.0.2" + +bs58check@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + safe-buffer "^5.1.2" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +cacheable-lookup@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz#3476a8215d046e5a3202a9209dd13fec1f933a27" + integrity sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w== + +cacheable-request@^10.2.8: + version "10.2.14" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-10.2.14.tgz#eb915b665fda41b79652782df3f553449c406b9d" + integrity sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ== + dependencies: + "@types/http-cache-semantics" "^4.0.2" + get-stream "^6.0.1" + http-cache-semantics "^4.1.1" + keyv "^4.5.3" + mimic-response "^4.0.0" + normalize-url "^8.0.0" + responselike "^3.0.0" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^6.0.0, camelcase@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@^3.5.3: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + +chokidar@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-4.0.1.tgz#4a6dff66798fb0f72a94f616abbd7e1a19f31d41" + integrity sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA== + dependencies: + readdirp "^4.0.1" + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + +cli-boxes@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== + +cliui@^7.0.2: + version "7.0.4" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^7.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +command-exists@^1.2.8: + version "1.2.9" + resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== + +commander@^10.0.0: + version "10.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== + +commander@^8.1.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +config-chain@^1.1.11: + version "1.1.13" + resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.13.tgz#fad0795aa6a6cdaff9ed1b68e9dff94372c232f4" + integrity sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ== + dependencies: + ini "^1.3.4" + proto-list "~1.2.1" + +cookie@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + +cosmiconfig@^8.0.0: + version "8.3.6" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3" + integrity sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA== + dependencies: + import-fresh "^3.3.0" + js-yaml "^4.1.0" + parse-json "^5.2.0" + path-type "^4.0.0" + +create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" + +create-hmac@^1.1.4, create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +create-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +debug@4, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4, debug@^4.3.5: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +defer-to-connect@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== + +delete-empty@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/delete-empty/-/delete-empty-3.0.0.tgz#f8040f2669f26fa7060bc2304e9859c593b685e8" + integrity sha512-ZUyiwo76W+DYnKsL3Kim6M/UOavPdBJgDYWOmuQhYaZvJH0AXAHbUNyEDtRbBra8wqqr686+63/0azfEk1ebUQ== + dependencies: + ansi-colors "^4.1.0" + minimist "^1.2.0" + path-starts-with "^2.0.0" + rimraf "^2.6.2" + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +diff@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +diff@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" + integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +elliptic@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +elliptic@^6.5.2, elliptic@^6.5.7: + version "6.5.7" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" + integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== + +enquirer@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" + integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== + dependencies: + ansi-colors "^4.1.1" + strip-ansi "^6.0.1" + +env-paths@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +escalade@^3.1.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-prettier@8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207" + integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA== + +eslint-plugin-no-only-tests@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-3.1.0.tgz#f38e4935c6c6c4842bf158b64aaa20c366fe171b" + integrity sha512-Lf4YW/bL6Un1R6A76pRZyE1dl1vr31G/ev8UzIc/geCgFWyrKil8hVjYqWVKGB/UIGmb6Slzs9T0wNezdSVegw== + +eslint-plugin-prettier@4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" + integrity sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-scope@^7.1.1: + version "7.2.2" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" + integrity sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: + version "3.4.3" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" + integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== + +eslint@8.34.0: + version "8.34.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.34.0.tgz#fe0ab0ef478104c1f9ebc5537e303d25a8fb22d6" + integrity sha512-1Z8iFsucw+7kSqXNZVslXS8Ioa4u2KM7GPwuKtkTFAqZ/cHMcEaR+1+Br0wLlot49cNxIiZk5wp8EAbPcYZxTg== + dependencies: + "@eslint/eslintrc" "^1.4.1" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.4.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + +espree@^9.4.0: + version "9.6.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" + integrity sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ== + dependencies: + acorn "^8.9.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.4.1" + +esquery@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.6.0.tgz#91419234f804d852a82dceec3e16cdc22cf9dae7" + integrity sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== + dependencies: + "@types/pbkdf2" "^3.0.0" + "@types/secp256k1" "^4.0.1" + blakejs "^1.1.0" + browserify-aes "^1.2.0" + bs58check "^2.1.2" + create-hash "^1.2.0" + create-hmac "^1.1.7" + hash.js "^1.1.7" + keccak "^3.0.0" + pbkdf2 "^3.0.17" + randombytes "^2.1.0" + safe-buffer "^5.1.2" + scrypt-js "^3.0.0" + secp256k1 "^4.0.1" + setimmediate "^1.0.5" + +ethereum-cryptography@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" + integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== + dependencies: + "@noble/hashes" "1.2.0" + "@noble/secp256k1" "1.7.1" + "@scure/bip32" "1.1.5" + "@scure/bip39" "1.1.1" + +ethereumjs-abi@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== + dependencies: + bn.js "^4.11.8" + ethereumjs-util "^6.0.0" + +ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== + dependencies: + "@types/bn.js" "^4.11.3" + bn.js "^4.11.0" + create-hash "^1.1.2" + elliptic "^6.5.2" + ethereum-cryptography "^0.1.3" + ethjs-util "0.1.6" + rlp "^2.2.3" + +ethjs-util@0.1.6, ethjs-util@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@^1.1.2, fast-diff@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" + integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== + +fast-glob@^3.2.9: + version "3.3.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" + integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fast-uri@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" + integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== + +fastq@^1.6.0: + version "1.17.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" + integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== + dependencies: + reusify "^1.0.4" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +find-up@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== + dependencies: + locate-path "^2.0.0" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.2.0.tgz#2c0c2d5040c99b1632771a9d105725c0115363ee" + integrity sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw== + dependencies: + flatted "^3.2.9" + keyv "^4.5.3" + rimraf "^3.0.2" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +flatted@^3.2.9: + version "3.3.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" + integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== + +follow-redirects@^1.12.1: + version "1.15.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" + integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== + +form-data-encoder@^2.1.2: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-2.1.4.tgz#261ea35d2a70d48d30ec7a9603130fa5515e9cd5" + integrity sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw== + +fp-ts@1.19.3: + version "1.19.3" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== + +fp-ts@^1.0.0: + version "1.19.5" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" + integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== + +fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +get-caller-file@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-stream@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + +glob-parent@^5.1.2, glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^8.0.3, glob@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + +globals@^13.19.0: + version "13.24.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" + integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== + dependencies: + type-fest "^0.20.2" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +got@^12.1.0: + version "12.6.1" + resolved "https://registry.yarnpkg.com/got/-/got-12.6.1.tgz#8869560d1383353204b5a9435f782df9c091f549" + integrity sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ== + dependencies: + "@sindresorhus/is" "^5.2.0" + "@szmarczak/http-timer" "^5.0.1" + cacheable-lookup "^7.0.0" + cacheable-request "^10.2.8" + decompress-response "^6.0.0" + form-data-encoder "^2.1.2" + get-stream "^6.0.1" + http2-wrapper "^2.1.10" + lowercase-keys "^3.0.0" + p-cancelable "^3.0.0" + responselike "^3.0.0" + +graceful-fs@4.2.10: + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + +graceful-fs@^4.1.2, graceful-fs@^4.1.6: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + +graphemer@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" + integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== + +hardhat-abi-exporter@^2.10.1: + version "2.10.1" + resolved "https://registry.yarnpkg.com/hardhat-abi-exporter/-/hardhat-abi-exporter-2.10.1.tgz#b14884e233c73fe3f43360f014ad7fd6df4b6d25" + integrity sha512-X8GRxUTtebMAd2k4fcPyVnCdPa6dYK4lBsrwzKP5yiSq4i+WadWPIumaLfce53TUf/o2TnLpLOduyO1ylE2NHQ== + dependencies: + "@ethersproject/abi" "^5.5.0" + delete-empty "^3.0.0" + +hardhat@^2.22.2: + version "2.22.14" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.14.tgz#389bb3789a52adc0b1a3b4bfc9b891239d5a2b42" + integrity sha512-sD8vHtS9l5QQVHzyPPe3auwZDJyZ0fG3Z9YENVa4oOqVEefCuHcPzdU736rei3zUKTqkX0zPIHkSMHpu02Fq1A== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@metamask/eth-sig-util" "^4.0.0" + "@nomicfoundation/edr" "^0.6.4" + "@nomicfoundation/ethereumjs-common" "4.0.4" + "@nomicfoundation/ethereumjs-tx" "5.0.4" + "@nomicfoundation/ethereumjs-util" "9.0.4" + "@nomicfoundation/solidity-analyzer" "^0.1.0" + "@sentry/node" "^5.18.1" + "@types/bn.js" "^5.1.0" + "@types/lru-cache" "^5.1.0" + adm-zip "^0.4.16" + aggregate-error "^3.0.0" + ansi-escapes "^4.3.0" + boxen "^5.1.2" + chalk "^2.4.2" + chokidar "^4.0.0" + ci-info "^2.0.0" + debug "^4.1.1" + enquirer "^2.3.0" + env-paths "^2.2.0" + ethereum-cryptography "^1.0.3" + ethereumjs-abi "^0.6.8" + find-up "^2.1.0" + fp-ts "1.19.3" + fs-extra "^7.0.1" + glob "7.2.0" + immutable "^4.0.0-rc.12" + io-ts "1.10.4" + json-stream-stringify "^3.1.4" + keccak "^3.0.2" + lodash "^4.17.11" + mnemonist "^0.38.0" + mocha "^10.0.0" + p-map "^4.0.0" + raw-body "^2.4.1" + resolve "1.17.0" + semver "^6.3.0" + solc "0.8.26" + source-map-support "^0.5.13" + stacktrace-parser "^0.1.10" + tsort "0.0.1" + undici "^5.14.0" + uuid "^8.3.2" + ws "^7.4.6" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +hash-base@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== + dependencies: + inherits "^2.0.4" + readable-stream "^3.6.0" + safe-buffer "^5.2.0" + +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +he@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +http-cache-semantics@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" + integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +http2-wrapper@^2.1.10: + version "2.2.1" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.2.1.tgz#310968153dcdedb160d8b72114363ef5fce1f64a" + integrity sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.2.0" + +https-proxy-agent@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^5.2.0, ignore@^5.2.4: + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== + +immutable@^4.0.0-rc.12: + version "4.3.7" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.7.tgz#c70145fc90d89fb02021e65c84eb0226e4e5a381" + integrity sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw== + +import-fresh@^3.0.0, import-fresh@^3.2.1, import-fresh@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +ini@^1.3.4, ini@~1.3.0: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + +io-ts@1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== + dependencies: + fp-ts "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-hex-prefixed@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +js-sdsl@^4.1.4: + version "4.4.2" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.2.tgz#2e3c031b1f47d3aca8b775532e3ebb0818e7f847" + integrity sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w== + +js-sha3@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json-stream-stringify@^3.1.4: + version "3.1.6" + resolved "https://registry.yarnpkg.com/json-stream-stringify/-/json-stream-stringify-3.1.6.tgz#ebe32193876fb99d4ec9f612389a8d8e2b5d54d4" + integrity sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog== + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== + optionalDependencies: + graceful-fs "^4.1.6" + +keccak@^3.0.0, keccak@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== + dependencies: + node-addon-api "^2.0.0" + node-gyp-build "^4.2.0" + readable-stream "^3.6.0" + +keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + +latest-version@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-7.0.0.tgz#843201591ea81a4d404932eeb61240fe04e9e5da" + integrity sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg== + dependencies: + package-json "^8.1.0" + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash.truncate@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== + +lodash@^4.17.11, lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +log-symbols@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + +lowercase-keys@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" + integrity sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ== + +lru_map@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== + +make-error@^1.1.1: + version "1.3.6" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +memorystream@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + +mimic-response@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-4.0.0.tgz#35468b19e7c75d10f5165ea25e75a5ceea7cf70f" + integrity sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +minimatch@9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^5.0.1, minimatch@^5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + +minimist@^1.2.0: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mnemonist@^0.38.0: + version "0.38.5" + resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" + integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== + dependencies: + obliterator "^2.0.0" + +mocha@^10.0.0: + version "10.7.3" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.7.3.tgz#ae32003cabbd52b59aece17846056a68eb4b0752" + integrity sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A== + dependencies: + ansi-colors "^4.1.3" + browser-stdout "^1.3.1" + chokidar "^3.5.3" + debug "^4.3.5" + diff "^5.2.0" + escape-string-regexp "^4.0.0" + find-up "^5.0.0" + glob "^8.1.0" + he "^1.2.0" + js-yaml "^4.1.0" + log-symbols "^4.1.0" + minimatch "^5.1.6" + ms "^2.1.3" + serialize-javascript "^6.0.2" + strip-json-comments "^3.1.1" + supports-color "^8.1.1" + workerpool "^6.5.1" + yargs "^16.2.0" + yargs-parser "^20.2.9" + yargs-unparser "^2.0.0" + +ms@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +node-addon-api@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== + +node-addon-api@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" + integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== + +node-gyp-build@^4.2.0: + version "4.8.2" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.2.tgz#4f802b71c1ab2ca16af830e6c1ea7dd1ad9496fa" + integrity sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +normalize-url@^8.0.0: + version "8.0.1" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-8.0.1.tgz#9b7d96af9836577c58f5883e939365fa15623a4a" + integrity sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w== + +obliterator@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" + integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +optionator@^0.9.1: + version "0.9.4" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734" + integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.5" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-cancelable@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" + integrity sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw== + +p-limit@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== + dependencies: + p-try "^1.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== + dependencies: + p-limit "^1.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-map@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== + dependencies: + aggregate-error "^3.0.0" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== + +package-json@^8.1.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-8.1.1.tgz#3e9948e43df40d1e8e78a85485f1070bf8f03dc8" + integrity sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA== + dependencies: + got "^12.1.0" + registry-auth-token "^5.0.1" + registry-url "^6.0.0" + semver "^7.3.7" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-json@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-starts-with@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-starts-with/-/path-starts-with-2.0.1.tgz#cd8b6213c141a9f2dd86c748310acdfa6493abb1" + integrity sha512-wZ3AeiRBRlNwkdUxvBANh0+esnt38DLffHDujZyRHkqkaKHTglnY2EP5UX3b8rdeiSutgO4y9NEJwXezNP5vHg== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +pbkdf2@^3.0.17: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== + dependencies: + create-hash "^1.1.2" + create-hmac "^1.1.4" + ripemd160 "^2.0.1" + safe-buffer "^5.0.1" + sha.js "^2.4.8" + +picocolors@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pluralize@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" + integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier-plugin-organize-imports@3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-3.2.4.tgz#77967f69d335e9c8e6e5d224074609309c62845e" + integrity sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog== + +prettier-plugin-solidity@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prettier-plugin-solidity/-/prettier-plugin-solidity-1.1.2.tgz#452be4df925a4b16a974a04235839c9f56c2d10d" + integrity sha512-KC5oNbFJfyBaFiO0kl56J6AXnDmr9tUlBV1iqo864x4KQrKYKaBZvW9jhT2oC0NHoNp7/GoMJNxqL8pp8k7C/g== + dependencies: + "@solidity-parser/parser" "^0.15.0" + semver "^7.3.8" + solidity-comments-extractor "^0.0.7" + +prettier@2.8.4: + version "2.8.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3" + integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw== + +prettier@^2.8.3: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== + +proto-list@~1.2.1: + version "1.2.4" + resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" + integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== + +punycode@^2.1.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +raw-body@^2.4.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +rc@1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +readdirp@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-4.0.2.tgz#388fccb8b75665da3abffe2d8f8ed59fe74c230a" + integrity sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA== + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +registry-auth-token@^5.0.1: + version "5.0.2" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-5.0.2.tgz#8b026cc507c8552ebbe06724136267e63302f756" + integrity sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ== + dependencies: + "@pnpm/npm-conf" "^2.1.0" + +registry-url@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-6.0.1.tgz#056d9343680f2f64400032b1e199faa692286c58" + integrity sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q== + dependencies: + rc "1.2.8" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve-alpn@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve@1.17.0: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +responselike@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-3.0.0.tgz#20decb6c298aff0dbee1c355ca95461d42823626" + integrity sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg== + dependencies: + lowercase-keys "^3.0.0" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^2.6.2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +ripemd160@^2.0.0, ripemd160@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + +rlp@^2.2.3: + version "2.2.7" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== + dependencies: + bn.js "^5.2.0" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scrypt-js@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== + +secp256k1@^4.0.1: + version "4.0.4" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.4.tgz#58f0bfe1830fe777d9ca1ffc7574962a8189f8ab" + integrity sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw== + dependencies: + elliptic "^6.5.7" + node-addon-api "^5.0.0" + node-gyp-build "^4.2.0" + +semver@^5.5.0: + version "5.7.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== + +semver@^6.3.0: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.3.7, semver@^7.3.8, semver@^7.5.2, semver@^7.5.4: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + +serialize-javascript@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== + dependencies: + randombytes "^2.1.0" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +sha.js@^2.4.0, sha.js@^2.4.8: + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== + dependencies: + inherits "^2.0.1" + safe-buffer "^5.0.1" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +slice-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== + dependencies: + ansi-styles "^4.0.0" + astral-regex "^2.0.0" + is-fullwidth-code-point "^3.0.0" + +solc@0.8.26: + version "0.8.26" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.26.tgz#afc78078953f6ab3e727c338a2fefcd80dd5b01a" + integrity sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g== + dependencies: + command-exists "^1.2.8" + commander "^8.1.0" + follow-redirects "^1.12.1" + js-sha3 "0.8.0" + memorystream "^0.3.1" + semver "^5.5.0" + tmp "0.0.33" + +solhint-plugin-prettier@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/solhint-plugin-prettier/-/solhint-plugin-prettier-0.0.5.tgz#e3b22800ba435cd640a9eca805a7f8bc3e3e6a6b" + integrity sha512-7jmWcnVshIrO2FFinIvDQmhQpfpS2rRRn3RejiYgnjIE68xO2bvrYvjqVNfrio4xH9ghOqn83tKuTzLjEbmGIA== + dependencies: + prettier-linter-helpers "^1.0.0" + +solhint@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/solhint/-/solhint-4.5.4.tgz#171cf33f46c36b8499efe60c0e425f6883a54e50" + integrity sha512-Cu1XiJXub2q1eCr9kkJ9VPv1sGcmj3V7Zb76B0CoezDOB9bu3DxKIFFH7ggCl9fWpEPD6xBmRLfZrYijkVmujQ== + dependencies: + "@solidity-parser/parser" "^0.18.0" + ajv "^6.12.6" + antlr4 "^4.13.1-patch-1" + ast-parents "^0.0.1" + chalk "^4.1.2" + commander "^10.0.0" + cosmiconfig "^8.0.0" + fast-diff "^1.2.0" + glob "^8.0.3" + ignore "^5.2.4" + js-yaml "^4.1.0" + latest-version "^7.0.0" + lodash "^4.17.21" + pluralize "^8.0.0" + semver "^7.5.2" + strip-ansi "^6.0.1" + table "^6.8.1" + text-table "^0.2.0" + optionalDependencies: + prettier "^2.8.3" + +solidity-comments-extractor@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/solidity-comments-extractor/-/solidity-comments-extractor-0.0.7.tgz#99d8f1361438f84019795d928b931f4e5c39ca19" + integrity sha512-wciNMLg/Irp8OKGrh3S2tfvZiZ0NEyILfcRCXCD4mp7SgK/i9gzLfhY2hY7VMCQJ3kH9UB9BzNdibIVMchzyYw== + +source-map-support@^0.5.13: + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +stacktrace-parser@^0.1.10: + version "0.1.10" + resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== + dependencies: + type-fest "^0.7.1" + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-hex-prefix@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== + dependencies: + is-hex-prefixed "1.0.0" + +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +table@^6.8.1: + version "6.8.2" + resolved "https://registry.yarnpkg.com/table/-/table-6.8.2.tgz#c5504ccf201213fa227248bdc8c5569716ac6c58" + integrity sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA== + dependencies: + ajv "^8.0.1" + lodash.truncate "^4.4.2" + slice-ansi "^4.0.0" + string-width "^4.2.3" + strip-ansi "^6.0.1" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +tmp@0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +ts-api-utils@^1.0.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" + integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== + +ts-node@^10.9.2: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +tslib@^1.9.3: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsort@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== + +tweetnacl-util@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== + +tweetnacl@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-fest@^0.21.3: + version "0.21.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== + +type-fest@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== + +typescript@4.9.5: + version "4.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== + +undici-types@~6.19.2: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== + +undici@^5.14.0: + version "5.28.4" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" + integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== + dependencies: + "@fastify/busboy" "^2.0.0" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +unpipe@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + +uuid@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== + +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +widest-line@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== + dependencies: + string-width "^4.0.0" + +word-wrap@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== + +workerpool@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" + integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== + +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@^7.4.6: + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== + +y18n@^5.0.5: + version "5.0.8" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== + +yargs-parser@^20.2.2, yargs-parser@^20.2.9: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + +yargs-unparser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + +yn@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/core/vm/statedb_utils.go b/core/vm/statedb_utils.go new file mode 100644 index 0000000000..e27eb8bfaa --- /dev/null +++ b/core/vm/statedb_utils.go @@ -0,0 +1,46 @@ +package vm + +import ( + "bytes" + "math/big" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" +) + +// StoreBytes stores an arbitrary-length []byte into StateDB using multiple storage slots. +func StoreBytes(statedb StateDB, addr common.Address, key common.Hash, value []byte) { + // Compute the storage root key (keccak256(key)) as the base + lengthKey := crypto.Keccak256Hash(key.Bytes()) + statedb.SetState(addr, lengthKey, common.BigToHash(big.NewInt(int64(len(value))))) + + // Split value into 32-byte chunks and store them + for i := 0; i < len(value); i += 32 { + end := i + 32 + if end > len(value) { + end = len(value) + } + chunk := make([]byte, 32) + copy(chunk, value[i:end]) // Copy to ensure 32 bytes, padding with zeros + + // Compute storage key: keccak256(lengthKey || index) + storageKey := crypto.Keccak256Hash(append(lengthKey.Bytes(), common.Uint64ToBytes(uint64(i/32))...)) + statedb.SetState(addr, storageKey, common.BytesToHash(chunk)) + } +} + +// LoadBytes retrieves an arbitrary-length []byte from StateDB. +func LoadBytes(statedb StateDB, addr common.Address, key common.Hash) []byte { + // Read length + lengthKey := crypto.Keccak256Hash(key.Bytes()) + length := statedb.GetState(addr, lengthKey).Big().Uint64() + + // Read stored chunks + var buffer bytes.Buffer + for i := uint64(0); i < length; i += 32 { + storageKey := crypto.Keccak256Hash(append(lengthKey.Bytes(), common.Uint64ToBytes(uint64(i/32))...)) + chunk := statedb.GetState(addr, storageKey).Bytes() + buffer.Write(chunk) + } + return buffer.Bytes()[:length] // Trim padding +} diff --git a/go.mod b/go.mod index ba26f2150e..0932a18c9b 100644 --- a/go.mod +++ b/go.mod @@ -140,6 +140,8 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect golang.org/x/mod v0.22.0 // indirect diff --git a/go.sum b/go.sum index 1e4efeb697..f2280c33bf 100644 --- a/go.sum +++ b/go.sum @@ -514,6 +514,10 @@ github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5 github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/tests/fuzzers/bls12381/precompile_fuzzer.go b/tests/fuzzers/bls12381/precompile_fuzzer.go index 33b2ca7988..8e9b21cb9e 100644 --- a/tests/fuzzers/bls12381/precompile_fuzzer.go +++ b/tests/fuzzers/bls12381/precompile_fuzzer.go @@ -76,7 +76,7 @@ func fuzz(id byte, data []byte) int { } cpy := make([]byte, len(data)) copy(cpy, data) - _, err := precompile.Run(cpy) + _, err := precompile.Run(nil, &vm.Contract{Input: cpy}, true) if !bytes.Equal(cpy, data) { panic(fmt.Sprintf("input data modified, precompile %d: %x %x", id, data, cpy)) } From 18fbd2a814a001f48d9b7a5f7d4ac19e9218de08 Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Wed, 2 Apr 2025 17:30:59 +0800 Subject: [PATCH 04/11] feat: wrapped a0gi base precompile --- core/tracing/hooks.go | 3 + core/vm/dasigners.go | 18 +- .../precompiles/wrapped_a0gi_base/contract.go | 291 ++++++++++++++++++ .../precompiles/wrapped_a0gi_base/errors.go | 9 + .../vm/precompiles/wrapped_a0gi_base/types.go | 14 + core/vm/wrapped_a0gi_base.go | 237 ++++++++++++++ 6 files changed, 563 insertions(+), 9 deletions(-) create mode 100644 core/vm/precompiles/wrapped_a0gi_base/contract.go create mode 100644 core/vm/precompiles/wrapped_a0gi_base/errors.go create mode 100644 core/vm/precompiles/wrapped_a0gi_base/types.go create mode 100644 core/vm/wrapped_a0gi_base.go diff --git a/core/tracing/hooks.go b/core/tracing/hooks.go index 0485f7a3eb..c55aea4b7a 100644 --- a/core/tracing/hooks.go +++ b/core/tracing/hooks.go @@ -270,6 +270,9 @@ const ( // BalanceChangeRevert is emitted when the balance is reverted back to a previous value due to call failure. // It is only emitted when the tracer has opted in to use the journaling wrapper (WrapWithJournal). BalanceChangeRevert BalanceChangeReason = 15 + + // BalanceIncreaseWA0GIMint is emitted when mint happened in wrapped a0gi base precompile + BalanceIncreaseWA0GIMint BalanceChangeReason = 16 ) // GasChangeReason is used to indicate the reason for a gas change, useful diff --git a/core/vm/dasigners.go b/core/vm/dasigners.go index 8fb8712a59..8423c4def0 100644 --- a/core/vm/dasigners.go +++ b/core/vm/dasigners.go @@ -18,7 +18,7 @@ import ( ) const ( - requiredGasMax uint64 = 1000_000_000 + DASignersRequiredGasMax uint64 = 1000_000_000 DASignersFunctionParams = "params" DASignersFunctionEpochNumber = "epochNumber" @@ -35,7 +35,7 @@ const ( DASignersFunctionMakeEpoch = "makeEpoch" ) -var RequiredGasBasic = map[string]uint64{ +var DASignersRequiredGasBasic = map[string]uint64{ DASignersFunctionParams: 1_000, DASignersFunctionEpochNumber: 1_000, DASignersFunctionQuorumCount: 1_000, @@ -52,8 +52,8 @@ var RequiredGasBasic = map[string]uint64{ } const ( - NewSignerEvent = "NewSigner" - SocketUpdatedEvent = "SocketUpdated" + DASignersNewSignerEvent = "NewSigner" + DASignersSocketUpdatedEvent = "SocketUpdated" ) var _ StatefulPrecompiledContract = &DASignersPrecompile{} @@ -81,12 +81,12 @@ func (d *DASignersPrecompile) Address() common.Address { func (d *DASignersPrecompile) RequiredGas(input []byte) uint64 { method, err := d.abi.MethodById(input[:4]) if err != nil { - return requiredGasMax + return DASignersRequiredGasMax } - if gas, ok := RequiredGasBasic[method.Name]; ok { + if gas, ok := DASignersRequiredGasBasic[method.Name]; ok { return gas } - return requiredGasMax + return DASignersRequiredGasMax } func (d *DASignersPrecompile) IsTx(method string) bool { @@ -151,7 +151,7 @@ func (d *DASignersPrecompile) Run(evm *EVM, contract *Contract, readonly bool) ( } func (d *DASignersPrecompile) EmitNewSignerEvent(evm *EVM, signer dasigners.IDASignersSignerDetail) error { - event := d.abi.Events[NewSignerEvent] + event := d.abi.Events[DASignersNewSignerEvent] quries := make([]interface{}, 2) quries[0] = event.ID quries[1] = signer.Signer @@ -174,7 +174,7 @@ func (d *DASignersPrecompile) EmitNewSignerEvent(evm *EVM, signer dasigners.IDAS } func (d *DASignersPrecompile) EmitSocketUpdatedEvent(evm *EVM, signer common.Address, socket string) error { - event := d.abi.Events[SocketUpdatedEvent] + event := d.abi.Events[DASignersSocketUpdatedEvent] quries := make([]interface{}, 2) quries[0] = event.ID quries[1] = signer diff --git a/core/vm/precompiles/wrapped_a0gi_base/contract.go b/core/vm/precompiles/wrapped_a0gi_base/contract.go new file mode 100644 index 0000000000..176842bd3d --- /dev/null +++ b/core/vm/precompiles/wrapped_a0gi_base/contract.go @@ -0,0 +1,291 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package wrappeda0gibase + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// Supply is an auto generated low-level Go binding around an user-defined struct. +type Supply struct { + Cap *big.Int + InitialSupply *big.Int + Supply *big.Int +} + +// Wrappeda0gibaseMetaData contains all meta data concerning the Wrappeda0gibase contract. +var Wrappeda0gibaseMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWA0GI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"}],\"internalType\":\"structSupply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// Wrappeda0gibaseABI is the input ABI used to generate the binding from. +// Deprecated: Use Wrappeda0gibaseMetaData.ABI instead. +var Wrappeda0gibaseABI = Wrappeda0gibaseMetaData.ABI + +// Wrappeda0gibase is an auto generated Go binding around an Ethereum contract. +type Wrappeda0gibase struct { + Wrappeda0gibaseCaller // Read-only binding to the contract + Wrappeda0gibaseTransactor // Write-only binding to the contract + Wrappeda0gibaseFilterer // Log filterer for contract events +} + +// Wrappeda0gibaseCaller is an auto generated read-only Go binding around an Ethereum contract. +type Wrappeda0gibaseCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Wrappeda0gibaseTransactor is an auto generated write-only Go binding around an Ethereum contract. +type Wrappeda0gibaseTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Wrappeda0gibaseFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type Wrappeda0gibaseFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Wrappeda0gibaseSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type Wrappeda0gibaseSession struct { + Contract *Wrappeda0gibase // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Wrappeda0gibaseCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type Wrappeda0gibaseCallerSession struct { + Contract *Wrappeda0gibaseCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// Wrappeda0gibaseTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type Wrappeda0gibaseTransactorSession struct { + Contract *Wrappeda0gibaseTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Wrappeda0gibaseRaw is an auto generated low-level Go binding around an Ethereum contract. +type Wrappeda0gibaseRaw struct { + Contract *Wrappeda0gibase // Generic contract binding to access the raw methods on +} + +// Wrappeda0gibaseCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type Wrappeda0gibaseCallerRaw struct { + Contract *Wrappeda0gibaseCaller // Generic read-only contract binding to access the raw methods on +} + +// Wrappeda0gibaseTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type Wrappeda0gibaseTransactorRaw struct { + Contract *Wrappeda0gibaseTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewWrappeda0gibase creates a new instance of Wrappeda0gibase, bound to a specific deployed contract. +func NewWrappeda0gibase(address common.Address, backend bind.ContractBackend) (*Wrappeda0gibase, error) { + contract, err := bindWrappeda0gibase(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Wrappeda0gibase{Wrappeda0gibaseCaller: Wrappeda0gibaseCaller{contract: contract}, Wrappeda0gibaseTransactor: Wrappeda0gibaseTransactor{contract: contract}, Wrappeda0gibaseFilterer: Wrappeda0gibaseFilterer{contract: contract}}, nil +} + +// NewWrappeda0gibaseCaller creates a new read-only instance of Wrappeda0gibase, bound to a specific deployed contract. +func NewWrappeda0gibaseCaller(address common.Address, caller bind.ContractCaller) (*Wrappeda0gibaseCaller, error) { + contract, err := bindWrappeda0gibase(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &Wrappeda0gibaseCaller{contract: contract}, nil +} + +// NewWrappeda0gibaseTransactor creates a new write-only instance of Wrappeda0gibase, bound to a specific deployed contract. +func NewWrappeda0gibaseTransactor(address common.Address, transactor bind.ContractTransactor) (*Wrappeda0gibaseTransactor, error) { + contract, err := bindWrappeda0gibase(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &Wrappeda0gibaseTransactor{contract: contract}, nil +} + +// NewWrappeda0gibaseFilterer creates a new log filterer instance of Wrappeda0gibase, bound to a specific deployed contract. +func NewWrappeda0gibaseFilterer(address common.Address, filterer bind.ContractFilterer) (*Wrappeda0gibaseFilterer, error) { + contract, err := bindWrappeda0gibase(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &Wrappeda0gibaseFilterer{contract: contract}, nil +} + +// bindWrappeda0gibase binds a generic wrapper to an already deployed contract. +func bindWrappeda0gibase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(Wrappeda0gibaseABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Wrappeda0gibase *Wrappeda0gibaseRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Wrappeda0gibase.Contract.Wrappeda0gibaseCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Wrappeda0gibase *Wrappeda0gibaseRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Wrappeda0gibaseTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Wrappeda0gibase *Wrappeda0gibaseRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Wrappeda0gibaseTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Wrappeda0gibase *Wrappeda0gibaseCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Wrappeda0gibase.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.contract.Transact(opts, method, params...) +} + +// GetWA0GI is a free data retrieval call binding the contract method 0xa9283a7a. +// +// Solidity: function getWA0GI() view returns(address) +func (_Wrappeda0gibase *Wrappeda0gibaseCaller) GetWA0GI(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Wrappeda0gibase.contract.Call(opts, &out, "getWA0GI") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetWA0GI is a free data retrieval call binding the contract method 0xa9283a7a. +// +// Solidity: function getWA0GI() view returns(address) +func (_Wrappeda0gibase *Wrappeda0gibaseSession) GetWA0GI() (common.Address, error) { + return _Wrappeda0gibase.Contract.GetWA0GI(&_Wrappeda0gibase.CallOpts) +} + +// GetWA0GI is a free data retrieval call binding the contract method 0xa9283a7a. +// +// Solidity: function getWA0GI() view returns(address) +func (_Wrappeda0gibase *Wrappeda0gibaseCallerSession) GetWA0GI() (common.Address, error) { + return _Wrappeda0gibase.Contract.GetWA0GI(&_Wrappeda0gibase.CallOpts) +} + +// MinterSupply is a free data retrieval call binding the contract method 0x95609212. +// +// Solidity: function minterSupply(address minter) view returns((uint256,uint256,uint256)) +func (_Wrappeda0gibase *Wrappeda0gibaseCaller) MinterSupply(opts *bind.CallOpts, minter common.Address) (Supply, error) { + var out []interface{} + err := _Wrappeda0gibase.contract.Call(opts, &out, "minterSupply", minter) + + if err != nil { + return *new(Supply), err + } + + out0 := *abi.ConvertType(out[0], new(Supply)).(*Supply) + + return out0, err + +} + +// MinterSupply is a free data retrieval call binding the contract method 0x95609212. +// +// Solidity: function minterSupply(address minter) view returns((uint256,uint256,uint256)) +func (_Wrappeda0gibase *Wrappeda0gibaseSession) MinterSupply(minter common.Address) (Supply, error) { + return _Wrappeda0gibase.Contract.MinterSupply(&_Wrappeda0gibase.CallOpts, minter) +} + +// MinterSupply is a free data retrieval call binding the contract method 0x95609212. +// +// Solidity: function minterSupply(address minter) view returns((uint256,uint256,uint256)) +func (_Wrappeda0gibase *Wrappeda0gibaseCallerSession) MinterSupply(minter common.Address) (Supply, error) { + return _Wrappeda0gibase.Contract.MinterSupply(&_Wrappeda0gibase.CallOpts, minter) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactor) Burn(opts *bind.TransactOpts, minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.contract.Transact(opts, "burn", minter, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseSession) Burn(minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Burn(&_Wrappeda0gibase.TransactOpts, minter, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorSession) Burn(minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Burn(&_Wrappeda0gibase.TransactOpts, minter, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactor) Mint(opts *bind.TransactOpts, minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.contract.Transact(opts, "mint", minter, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseSession) Mint(minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Mint(&_Wrappeda0gibase.TransactOpts, minter, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorSession) Mint(minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Mint(&_Wrappeda0gibase.TransactOpts, minter, amount) +} diff --git a/core/vm/precompiles/wrapped_a0gi_base/errors.go b/core/vm/precompiles/wrapped_a0gi_base/errors.go new file mode 100644 index 0000000000..833d92e157 --- /dev/null +++ b/core/vm/precompiles/wrapped_a0gi_base/errors.go @@ -0,0 +1,9 @@ +package wrappeda0gibase + +import "errors" + +var ( + ErrSenderNotWA0GI = errors.New("sender is not WA0GI") + ErrInsufficientMintCap = errors.New("insufficient mint cap") + ErrInsufficientMintSupply = errors.New("insufficient mint supply") +) diff --git a/core/vm/precompiles/wrapped_a0gi_base/types.go b/core/vm/precompiles/wrapped_a0gi_base/types.go new file mode 100644 index 0000000000..f49a84696f --- /dev/null +++ b/core/vm/precompiles/wrapped_a0gi_base/types.go @@ -0,0 +1,14 @@ +package wrappeda0gibase + +import ( + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" +) + +var ( + supplyKey = []byte{0x00} +) + +func SupplyKey(account common.Address) common.Hash { + return crypto.Keccak256Hash(append(supplyKey, account.Bytes()...)) +} diff --git a/core/vm/wrapped_a0gi_base.go b/core/vm/wrapped_a0gi_base.go new file mode 100644 index 0000000000..ed4f124617 --- /dev/null +++ b/core/vm/wrapped_a0gi_base.go @@ -0,0 +1,237 @@ +package vm + +import ( + "math/big" + "strings" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/tracing" + wrappeda0gibase "github.com/ethereum/go-ethereum/core/vm/precompiles/wrapped_a0gi_base" + "github.com/holiman/uint256" + "github.com/vmihailenco/msgpack/v5" +) + +const ( + WrappedA0GIBaseRequiredGasMax uint64 = 1000_000_000 + + // txs + WrappedA0GIBaseFunctionMint = "mint" + WrappedA0GIBaseFunctionBurn = "burn" + // queries + WrappedA0GIBaseFunctionGetWA0GI = "getWA0GI" + WrappedA0GIBaseFunctionMinterSupply = "minterSupply" +) + +var WrappedA0GIBaseRequiredGasBasic = map[string]uint64{ + WrappedA0GIBaseFunctionMint: 100_000, + WrappedA0GIBaseFunctionBurn: 100_000, + WrappedA0GIBaseFunctionGetWA0GI: 5_000, + WrappedA0GIBaseFunctionMinterSupply: 10_000, +} + +var _ StatefulPrecompiledContract = &WrappedA0giBasePrecompile{} + +type WrappedA0giBasePrecompile struct { + abi abi.ABI +} + +// Abi implements common.PrecompileCommon. +func (w *WrappedA0giBasePrecompile) Abi() *abi.ABI { + return &w.abi +} + +// IsTx implements common.PrecompileCommon. +func (w *WrappedA0giBasePrecompile) IsTx(method string) bool { + switch method { + case WrappedA0GIBaseFunctionMint, + WrappedA0GIBaseFunctionBurn: + return true + default: + return false + } +} + +func (w *WrappedA0giBasePrecompile) Address() common.Address { + return common.HexToAddress("0x0000000000000000000000000000000000001002") +} + +// RequiredGas implements vm.PrecompiledContract. +func (w *WrappedA0giBasePrecompile) RequiredGas(input []byte) uint64 { + method, err := w.abi.MethodById(input[:4]) + if err != nil { + return WrappedA0GIBaseRequiredGasMax + } + if gas, ok := WrappedA0GIBaseRequiredGasBasic[method.Name]; ok { + return gas + } + return WrappedA0GIBaseRequiredGasMax +} + +func NewWrappedA0giBasePrecompile() (*WrappedA0giBasePrecompile, error) { + abi, err := abi.JSON(strings.NewReader(wrappeda0gibase.Wrappeda0gibaseABI)) + if err != nil { + return nil, err + } + return &WrappedA0giBasePrecompile{ + abi: abi, + }, nil +} + +// Run implements vm.PrecompiledContract. +func (w *WrappedA0giBasePrecompile) Run(evm *EVM, contract *Contract, readonly bool) ([]byte, error) { + method, args, err := InitializeStatefulPrecompileCall(w, evm, contract, readonly) + if err != nil { + return nil, err + } + + var bz []byte + switch method.Name { + // queries + case WrappedA0GIBaseFunctionGetWA0GI: + bz, err = w.GetWA0GI(evm, method, args) + case WrappedA0GIBaseFunctionMinterSupply: + bz, err = w.MinterSupply(evm, method, args) + // txs + case WrappedA0GIBaseFunctionMint: + bz, err = w.Mint(evm, contract, method, args) + case WrappedA0GIBaseFunctionBurn: + bz, err = w.Burn(evm, contract, method, args) + } + + if err != nil { + return nil, err + } + + return bz, nil +} + +func (w *WrappedA0giBasePrecompile) getWA0GI() common.Address { + // This is a Wrapped A0GI contract deployed by a raw transaction: + // raw tx params: + // from: 0x873cd27b6833e6394c34a00c37b260aca5abc0b6 + // nonce: 0 + // gasPrice: 100 Gwei + // gasLimit: 1000000 + // The sender is an ephemeral account, nobody holds its private key and this is the only transaction it signed. + // This transaction is a legacy transaction without chain ID so it can be deployed at any EVM chain which supports pre-EIP155 transactions. + // raw tx: 0xf90f568085174876e800830f42408080b90f0360c0604052600c60809081526b57726170706564204130474960a01b60a0526000906200002d908262000128565b50604080518082019091526005815264574130474960d81b602082015260019062000059908262000128565b50600280546001600160a81b031916621002121790553480156200007c57600080fd5b50620001f4565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620000ae57607f821691505b602082108103620000cf57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200012357600081815260208120601f850160051c81016020861015620000fe5750805b601f850160051c820191505b818110156200011f578281556001016200010a565b5050505b505050565b81516001600160401b0381111562000144576200014462000083565b6200015c8162000155845462000099565b84620000d5565b602080601f8311600181146200019457600084156200017b5750858301515b600019600386901b1c1916600185901b1785556200011f565b600085815260208120601f198616915b82811015620001c557888601518255948401946001909101908401620001a4565b5085821015620001e45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b610cff80620002046000396000f3fe6080604052600436106100f75760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb14610291578063c8dd1a26146102b1578063d0e30db0146102ee578063dd62ed3e146102f657600080fd5b806370a082311461022f57806379cc67901461025c57806395d89b411461027c5780639dc29fac1461025c57600080fd5b80632e1a7d4d116100c65780632e1a7d4d146101a3578063313ce567146101c357806340c10f19146101ef57806342966c681461020f57600080fd5b806306fdde031461010b578063095ea7b31461013657806318160ddd1461016657806323b872dd1461018357600080fd5b366101065761010461032e565b005b600080fd5b34801561011757600080fd5b50610120610389565b60405161012d9190610b1b565b60405180910390f35b34801561014257600080fd5b50610156610151366004610b6a565b610417565b604051901515815260200161012d565b34801561017257600080fd5b50475b60405190815260200161012d565b34801561018f57600080fd5b5061015661019e366004610b94565b610484565b3480156101af57600080fd5b506101046101be366004610bd0565b61068c565b3480156101cf57600080fd5b506002546101dd9060ff1681565b60405160ff909116815260200161012d565b3480156101fb57600080fd5b5061010461020a366004610b6a565b610716565b34801561021b57600080fd5b5061010461022a366004610bd0565b610879565b34801561023b57600080fd5b5061017561024a366004610be9565b60036020526000908152604090205481565b34801561026857600080fd5b50610104610277366004610b6a565b610886565b34801561028857600080fd5b50610120610894565b34801561029d57600080fd5b506101566102ac366004610b6a565b6108a1565b3480156102bd57600080fd5b506002546102d69061010090046001600160a01b031681565b6040516001600160a01b03909116815260200161012d565b61010461032e565b34801561030257600080fd5b50610175610311366004610c04565b600460209081526000928352604080842090915290825290205481565b336000908152600360205260408120805434929061034d908490610c4d565b909155505060405134815233907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9060200160405180910390a2565b6000805461039690610c60565b80601f01602080910402602001604051908101604052809291908181526020018280546103c290610c60565b801561040f5780601f106103e45761010080835404028352916020019161040f565b820191906000526020600020905b8154815290600101906020018083116103f257829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104729086815260200190565b60405180910390a35060015b92915050565b6001600160a01b0383166000908152600360205260408120548211156104f15760405162461bcd60e51b815260206004820152601860248201527f73726320696e73756666696369656e742062616c616e6365000000000000000060448201526064015b60405180910390fd5b6001600160a01b038416331480159061052f57506001600160a01b038416600090815260046020908152604080832033845290915290205460001914155b156105d9576001600160a01b03841660009081526004602090815260408083203384529091529020548211156105a05760405162461bcd60e51b8152602060048201526016602482015275696e73756666696369656e7420616c6c6f77616e636560501b60448201526064016104e8565b6001600160a01b0384166000908152600460209081526040808320338452909152812080548492906105d3908490610c9a565b90915550505b6001600160a01b03841660009081526003602052604081208054849290610601908490610c9a565b90915550506001600160a01b0383166000908152600360205260408120805484929061062e908490610c4d565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161067a91815260200190565b60405180910390a35060019392505050565b33600090815260036020526040812080548392906106ab908490610c9a565b9091555050604051339082156108fc029083906000818181858888f193505050501580156106dd573d6000803e3d6000fd5b5060405181815233907f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b659060200160405180910390a250565b6002546040513360248201526044810183905260009161010090046001600160a01b03169060640160408051601f198184030181529181526020820180516001600160e01b03166340c10f1960e01b179052516107739190610cad565b6000604051808303816000865af19150503d80600081146107b0576040519150601f19603f3d011682016040523d82523d6000602084013e6107b5565b606091505b50509050806108065760405162461bcd60e51b815260206004820152601d60248201527f7772617070656420613067692062617365206d696e74206661696c656400000060448201526064016104e8565b6001600160a01b0383166000908152600360205260408120805484929061082e908490610c4d565b90915550506040518281526001600160a01b0384169033907fab8530f87dc9b59234c4623bf917212bb2536d647574c8e7e5da92c2ede0c9f8906020015b60405180910390a3505050565b61088333826108b5565b50565b61089082826108b5565b5050565b6001805461039690610c60565b60006108ae338484610484565b9392505050565b6002546040513360248201526044810183905260009161010090046001600160a01b03169060640160408051601f198184030181529181526020820180516001600160e01b0316632770a7eb60e21b179052516109129190610cad565b6000604051808303816000865af19150503d806000811461094f576040519150601f19603f3d011682016040523d82523d6000602084013e610954565b606091505b50509050806109a55760405162461bcd60e51b815260206004820152601d60248201527f7772617070656420613067692062617365206275726e206661696c656400000060448201526064016104e8565b6001600160a01b03831633148015906109e357506001600160a01b038316600090815260046020908152604080832033845290915290205460001914155b15610a8d576001600160a01b0383166000908152600460209081526040808320338452909152902054821115610a545760405162461bcd60e51b8152602060048201526016602482015275696e73756666696369656e7420616c6c6f77616e636560501b60448201526064016104e8565b6001600160a01b038316600090815260046020908152604080832033845290915281208054849290610a87908490610c9a565b90915550505b6001600160a01b03831660009081526003602052604081208054849290610ab5908490610c9a565b90915550506040518281526001600160a01b0384169033907fbac40739b0d4ca32fa2d82fc91630465ba3eddd1598da6fca393b26fb63b94539060200161086c565b60005b83811015610b12578181015183820152602001610afa565b50506000910152565b6020815260008251806020840152610b3a816040850160208701610af7565b601f01601f19169190910160400192915050565b80356001600160a01b0381168114610b6557600080fd5b919050565b60008060408385031215610b7d57600080fd5b610b8683610b4e565b946020939093013593505050565b600080600060608486031215610ba957600080fd5b610bb284610b4e565b9250610bc060208501610b4e565b9150604084013590509250925092565b600060208284031215610be257600080fd5b5035919050565b600060208284031215610bfb57600080fd5b6108ae82610b4e565b60008060408385031215610c1757600080fd5b610c2083610b4e565b9150610c2e60208401610b4e565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b8082018082111561047e5761047e610c37565b600181811c90821680610c7457607f821691505b602082108103610c9457634e487b7160e01b600052602260045260246000fd5b50919050565b8181038181111561047e5761047e610c37565b60008251610cbf818460208701610af7565b919091019291505056fea2646970667358221220e46d4016267b105c34d4679646e09d6fb451927a4dd464e4ebe1563577af02a664736f6c634300081400331ba0fbd8c503ac7ff82ea302cdc5d6a7195281eaa99017a6a363e36fba073028ba42a037a49fedf5460e3d33776233d88dfb242ddaf9bb5d4cb6688aa290ead65a93c7 + return common.HexToAddress("0x1cd0690ff9a693f5ef2dd976660a8dafc81a109c") +} + +func (w *WrappedA0giBasePrecompile) GetWA0GI(_ *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 0 { + return nil, ErrExecutionReverted + } + + return method.Outputs.Pack(w.getWA0GI()) +} + +func (w *WrappedA0giBasePrecompile) setMinterSupply(evm *EVM, account common.Address, supply wrappeda0gibase.Supply) error { + b, err := msgpack.Marshal(supply) + if err != nil { + return err + } + StoreBytes(evm.StateDB, w.Address(), wrappeda0gibase.SupplyKey(account), b) + return nil +} + +func (w *WrappedA0giBasePrecompile) getMinterSupply(evm *EVM, account common.Address) (wrappeda0gibase.Supply, error) { + b := LoadBytes(evm.StateDB, w.Address(), wrappeda0gibase.SupplyKey(account)) + if len(b) == 0 { + return wrappeda0gibase.Supply{ + Cap: big.NewInt(0), + Supply: big.NewInt(0), + InitialSupply: big.NewInt(0), + }, nil + } + + var supply wrappeda0gibase.Supply + err := msgpack.Unmarshal(b, &supply) + if err != nil { + return wrappeda0gibase.Supply{}, err + } + return supply, nil +} + +func (w *WrappedA0giBasePrecompile) MinterSupply(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { + if len(args) != 1 { + return nil, ErrExecutionReverted + } + account := args[0].(common.Address) + supply, err := w.getMinterSupply(evm, account) + if err != nil { + return nil, err + } + return method.Outputs.Pack(supply) +} + +func (w *WrappedA0giBasePrecompile) Mint( + evm *EVM, + contract *Contract, + method *abi.Method, + args []interface{}, +) ([]byte, error) { + if len(args) != 2 { + return nil, ErrExecutionReverted + } + minter := args[0].(common.Address) + amount := args[1].(*big.Int) + // validation + wa0gi := w.getWA0GI() + if contract.caller != wa0gi { + return nil, wrappeda0gibase.ErrSenderNotWA0GI + } + // execute + supply, err := w.getMinterSupply(evm, minter) + if err != nil { + return nil, err + } + // check & update mint supply + supply.Supply.Add(supply.Supply, amount) + if supply.Supply.Cmp(supply.Cap) > 0 { + return nil, wrappeda0gibase.ErrInsufficientMintCap + } + // mint & transfer to wa0gi contract address + evm.StateDB.AddBalance(wa0gi, uint256.MustFromBig(amount), tracing.BalanceIncreaseWA0GIMint) + // update supply + if err = w.setMinterSupply(evm, minter, supply); err != nil { + return nil, err + } + return method.Outputs.Pack() +} + +func (w *WrappedA0giBasePrecompile) Burn( + evm *EVM, + contract *Contract, + method *abi.Method, + args []interface{}, +) ([]byte, error) { + if len(args) != 2 { + return nil, ErrExecutionReverted + } + minter := args[0].(common.Address) + amount := args[1].(*big.Int) + // validation + wa0gi := w.getWA0GI() + if contract.caller != wa0gi { + return nil, wrappeda0gibase.ErrSenderNotWA0GI + } + // execute + supply, err := w.getMinterSupply(evm, minter) + if err != nil { + return nil, err + } + // check & update mint supply + supply.Supply.Sub(supply.Supply, amount) + if supply.Supply.Cmp(big.NewInt(0)) < 0 { + return nil, wrappeda0gibase.ErrInsufficientMintSupply + } + // transfer from wa0gi contract address & burn + evm.StateDB.SubBalance(wa0gi, uint256.MustFromBig(amount), tracing.BalanceIncreaseWA0GIMint) + // update supply + if err = w.setMinterSupply(evm, minter, supply); err != nil { + return nil, err + } + return method.Outputs.Pack() +} From d5275fa798a47a5928f5b97477db42c9511d319f Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Wed, 2 Apr 2025 18:26:10 +0800 Subject: [PATCH 05/11] feat: set mint cap --- .gitignore | 1 + .../interfaces/abis/IWrappedA0GIBase.json | 23 + .../377589efa765dec208356377872d3755.json | 1 - .../c79ff14473359160d0c7a65892d5cb52.json | 1 - .../contracts/IDASigners.sol/BN254.dbg.json | 4 - .../contracts/IDASigners.sol/BN254.json | 10 - .../IDASigners.sol/IDASigners.dbg.json | 4 - .../contracts/IDASigners.sol/IDASigners.json | 484 ------------------ .../IWrappedA0GIBase.dbg.json | 4 - .../IWrappedA0GIBase.json | 96 ---- .../build/cache/solidity-files-cache.json | 78 --- .../interfaces/contracts/IWrappedA0GIBase.sol | 13 + .../precompiles/wrapped_a0gi_base/contract.go | 23 +- .../precompiles/wrapped_a0gi_base/errors.go | 1 + core/vm/wrapped_a0gi_base.go | 58 ++- 15 files changed, 116 insertions(+), 685 deletions(-) delete mode 100644 core/vm/precompiles/interfaces/build/artifacts/build-info/377589efa765dec208356377872d3755.json delete mode 100644 core/vm/precompiles/interfaces/build/artifacts/build-info/c79ff14473359160d0c7a65892d5cb52.json delete mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.dbg.json delete mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.json delete mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.dbg.json delete mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.json delete mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.dbg.json delete mode 100644 core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.json delete mode 100644 core/vm/precompiles/interfaces/build/cache/solidity-files-cache.json diff --git a/.gitignore b/.gitignore index c77b4ec853..56ad6a476d 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ tests/spec-tests/ # Precompiles core/vm/Precompiles/interfaces/node_modules +core/vm/Precompiles/interfaces/build diff --git a/core/vm/precompiles/interfaces/abis/IWrappedA0GIBase.json b/core/vm/precompiles/interfaces/abis/IWrappedA0GIBase.json index 064863b1f1..41f93fbc04 100644 --- a/core/vm/precompiles/interfaces/abis/IWrappedA0GIBase.json +++ b/core/vm/precompiles/interfaces/abis/IWrappedA0GIBase.json @@ -83,5 +83,28 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialSupply", + "type": "uint256" + } + ], + "name": "setMinterCap", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] diff --git a/core/vm/precompiles/interfaces/build/artifacts/build-info/377589efa765dec208356377872d3755.json b/core/vm/precompiles/interfaces/build/artifacts/build-info/377589efa765dec208356377872d3755.json deleted file mode 100644 index a92cda566d..0000000000 --- a/core/vm/precompiles/interfaces/build/artifacts/build-info/377589efa765dec208356377872d3755.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"377589efa765dec208356377872d3755","_format":"hh-sol-build-info-1","solcVersion":"0.8.20","solcLongVersion":"0.8.20+commit.a1b79de6","input":{"language":"Solidity","sources":{"contracts/IDASigners.sol":{"content":"// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\nlibrary BN254 {\n struct G1Point {\n uint X;\n uint Y;\n }\n\n // Encoding of field elements is: X[1] * i + X[0]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n}\n\ninterface IDASigners {\n /*=== struct ===*/\n struct SignerDetail {\n address signer;\n string socket;\n BN254.G1Point pkG1;\n BN254.G2Point pkG2;\n }\n\n struct Params {\n uint tokensPerVote;\n uint maxVotesPerSigner;\n uint maxQuorums;\n uint epochBlocks;\n uint encodedSlices;\n }\n\n /*=== event ===*/\n event NewSigner(\n address indexed signer,\n BN254.G1Point pkG1,\n BN254.G2Point pkG2\n );\n event SocketUpdated(address indexed signer, string socket);\n\n /*=== function ===*/\n function params() external view returns (Params memory);\n\n function epochNumber() external view returns (uint);\n\n function quorumCount(uint _epoch) external view returns (uint);\n\n function isSigner(address _account) external view returns (bool);\n\n function getSigner(\n address[] memory _account\n ) external view returns (SignerDetail[] memory);\n\n function getQuorum(\n uint _epoch,\n uint _quorumId\n ) external view returns (address[] memory);\n\n function getQuorumRow(\n uint _epoch,\n uint _quorumId,\n uint32 _rowIndex\n ) external view returns (address);\n\n function registerSigner(\n SignerDetail memory _signer,\n BN254.G1Point memory _signature\n ) external;\n\n function updateSocket(string memory _socket) external;\n\n function registeredEpoch(\n address _account,\n uint _epoch\n ) external view returns (bool);\n\n function registerNextEpoch(BN254.G1Point memory _signature) external;\n\n function makeEpoch() external;\n\n function getAggPkG1(\n uint _epoch,\n uint _quorumId,\n bytes memory _quorumBitmap\n )\n external\n view\n returns (BN254.G1Point memory aggPkG1, uint total, uint hit);\n}\n"}},"settings":{"evmVersion":"istanbul","optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}}}},"output":{"sources":{"contracts/IDASigners.sol":{"ast":{"absolutePath":"contracts/IDASigners.sol","exportedSymbols":{"BN254":[16],"IDASigners":[159]},"id":160,"license":"LGPL-3.0-only","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.8",".0"],"nodeType":"PragmaDirective","src":"42:24:0"},{"abstract":false,"baseContracts":[],"canonicalName":"BN254","contractDependencies":[],"contractKind":"library","fullyImplemented":true,"id":16,"linearizedBaseContracts":[16],"name":"BN254","nameLocation":"76:5:0","nodeType":"ContractDefinition","nodes":[{"canonicalName":"BN254.G1Point","id":6,"members":[{"constant":false,"id":3,"mutability":"mutable","name":"X","nameLocation":"118:1:0","nodeType":"VariableDeclaration","scope":6,"src":"113:6:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":2,"name":"uint","nodeType":"ElementaryTypeName","src":"113:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":5,"mutability":"mutable","name":"Y","nameLocation":"134:1:0","nodeType":"VariableDeclaration","scope":6,"src":"129:6:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":4,"name":"uint","nodeType":"ElementaryTypeName","src":"129:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"G1Point","nameLocation":"95:7:0","nodeType":"StructDefinition","scope":16,"src":"88:54:0","visibility":"public"},{"canonicalName":"BN254.G2Point","id":15,"members":[{"constant":false,"id":10,"mutability":"mutable","name":"X","nameLocation":"235:1:0","nodeType":"VariableDeclaration","scope":15,"src":"227:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"},"typeName":{"baseType":{"id":7,"name":"uint","nodeType":"ElementaryTypeName","src":"227:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":9,"length":{"hexValue":"32","id":8,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"232:1:0","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"nodeType":"ArrayTypeName","src":"227:7:0","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"}},"visibility":"internal"},{"constant":false,"id":14,"mutability":"mutable","name":"Y","nameLocation":"254:1:0","nodeType":"VariableDeclaration","scope":15,"src":"246:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"},"typeName":{"baseType":{"id":11,"name":"uint","nodeType":"ElementaryTypeName","src":"246:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":13,"length":{"hexValue":"32","id":12,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"251:1:0","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"nodeType":"ArrayTypeName","src":"246:7:0","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"}},"visibility":"internal"}],"name":"G2Point","nameLocation":"209:7:0","nodeType":"StructDefinition","scope":16,"src":"202:60:0","visibility":"public"}],"scope":160,"src":"68:196:0","usedErrors":[],"usedEvents":[]},{"abstract":false,"baseContracts":[],"canonicalName":"IDASigners","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":159,"linearizedBaseContracts":[159],"name":"IDASigners","nameLocation":"276:10:0","nodeType":"ContractDefinition","nodes":[{"canonicalName":"IDASigners.SignerDetail","id":27,"members":[{"constant":false,"id":18,"mutability":"mutable","name":"signer","nameLocation":"354:6:0","nodeType":"VariableDeclaration","scope":27,"src":"346:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":17,"name":"address","nodeType":"ElementaryTypeName","src":"346:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":20,"mutability":"mutable","name":"socket","nameLocation":"377:6:0","nodeType":"VariableDeclaration","scope":27,"src":"370:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"},"typeName":{"id":19,"name":"string","nodeType":"ElementaryTypeName","src":"370:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":23,"mutability":"mutable","name":"pkG1","nameLocation":"407:4:0","nodeType":"VariableDeclaration","scope":27,"src":"393:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":22,"nodeType":"UserDefinedTypeName","pathNode":{"id":21,"name":"BN254.G1Point","nameLocations":["393:5:0","399:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"393:13:0"},"referencedDeclaration":6,"src":"393:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":26,"mutability":"mutable","name":"pkG2","nameLocation":"435:4:0","nodeType":"VariableDeclaration","scope":27,"src":"421:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"},"typeName":{"id":25,"nodeType":"UserDefinedTypeName","pathNode":{"id":24,"name":"BN254.G2Point","nameLocations":["421:5:0","427:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":15,"src":"421:13:0"},"referencedDeclaration":15,"src":"421:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"}},"visibility":"internal"}],"name":"SignerDetail","nameLocation":"323:12:0","nodeType":"StructDefinition","scope":159,"src":"316:130:0","visibility":"public"},{"canonicalName":"IDASigners.Params","id":38,"members":[{"constant":false,"id":29,"mutability":"mutable","name":"tokensPerVote","nameLocation":"481:13:0","nodeType":"VariableDeclaration","scope":38,"src":"476:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":28,"name":"uint","nodeType":"ElementaryTypeName","src":"476:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":31,"mutability":"mutable","name":"maxVotesPerSigner","nameLocation":"509:17:0","nodeType":"VariableDeclaration","scope":38,"src":"504:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":30,"name":"uint","nodeType":"ElementaryTypeName","src":"504:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":33,"mutability":"mutable","name":"maxQuorums","nameLocation":"541:10:0","nodeType":"VariableDeclaration","scope":38,"src":"536:15:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":32,"name":"uint","nodeType":"ElementaryTypeName","src":"536:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":35,"mutability":"mutable","name":"epochBlocks","nameLocation":"566:11:0","nodeType":"VariableDeclaration","scope":38,"src":"561:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":34,"name":"uint","nodeType":"ElementaryTypeName","src":"561:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":37,"mutability":"mutable","name":"encodedSlices","nameLocation":"592:13:0","nodeType":"VariableDeclaration","scope":38,"src":"587:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":36,"name":"uint","nodeType":"ElementaryTypeName","src":"587:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"Params","nameLocation":"459:6:0","nodeType":"StructDefinition","scope":159,"src":"452:160:0","visibility":"public"},{"anonymous":false,"eventSelector":"679917c2006df1daaa987a56bf1d66e99764d5ad317892d9e83a6eb4e3f051e7","id":48,"name":"NewSigner","nameLocation":"646:9:0","nodeType":"EventDefinition","parameters":{"id":47,"nodeType":"ParameterList","parameters":[{"constant":false,"id":40,"indexed":true,"mutability":"mutable","name":"signer","nameLocation":"681:6:0","nodeType":"VariableDeclaration","scope":48,"src":"665:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":39,"name":"address","nodeType":"ElementaryTypeName","src":"665:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":43,"indexed":false,"mutability":"mutable","name":"pkG1","nameLocation":"711:4:0","nodeType":"VariableDeclaration","scope":48,"src":"697:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":42,"nodeType":"UserDefinedTypeName","pathNode":{"id":41,"name":"BN254.G1Point","nameLocations":["697:5:0","703:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"697:13:0"},"referencedDeclaration":6,"src":"697:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":46,"indexed":false,"mutability":"mutable","name":"pkG2","nameLocation":"739:4:0","nodeType":"VariableDeclaration","scope":48,"src":"725:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_memory_ptr","typeString":"struct BN254.G2Point"},"typeName":{"id":45,"nodeType":"UserDefinedTypeName","pathNode":{"id":44,"name":"BN254.G2Point","nameLocations":["725:5:0","731:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":15,"src":"725:13:0"},"referencedDeclaration":15,"src":"725:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"}},"visibility":"internal"}],"src":"655:94:0"},"src":"640:110:0"},{"anonymous":false,"eventSelector":"09617a966176a40f8f1410768b118506db0096484acd5811064fcc12038798de","id":54,"name":"SocketUpdated","nameLocation":"761:13:0","nodeType":"EventDefinition","parameters":{"id":53,"nodeType":"ParameterList","parameters":[{"constant":false,"id":50,"indexed":true,"mutability":"mutable","name":"signer","nameLocation":"791:6:0","nodeType":"VariableDeclaration","scope":54,"src":"775:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":49,"name":"address","nodeType":"ElementaryTypeName","src":"775:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":52,"indexed":false,"mutability":"mutable","name":"socket","nameLocation":"806:6:0","nodeType":"VariableDeclaration","scope":54,"src":"799:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":51,"name":"string","nodeType":"ElementaryTypeName","src":"799:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"774:39:0"},"src":"755:59:0"},{"functionSelector":"cff0ab96","id":60,"implemented":false,"kind":"function","modifiers":[],"name":"params","nameLocation":"854:6:0","nodeType":"FunctionDefinition","parameters":{"id":55,"nodeType":"ParameterList","parameters":[],"src":"860:2:0"},"returnParameters":{"id":59,"nodeType":"ParameterList","parameters":[{"constant":false,"id":58,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":60,"src":"886:13:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Params_$38_memory_ptr","typeString":"struct IDASigners.Params"},"typeName":{"id":57,"nodeType":"UserDefinedTypeName","pathNode":{"id":56,"name":"Params","nameLocations":["886:6:0"],"nodeType":"IdentifierPath","referencedDeclaration":38,"src":"886:6:0"},"referencedDeclaration":38,"src":"886:6:0","typeDescriptions":{"typeIdentifier":"t_struct$_Params_$38_storage_ptr","typeString":"struct IDASigners.Params"}},"visibility":"internal"}],"src":"885:15:0"},"scope":159,"src":"845:56:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"f4145a83","id":65,"implemented":false,"kind":"function","modifiers":[],"name":"epochNumber","nameLocation":"916:11:0","nodeType":"FunctionDefinition","parameters":{"id":61,"nodeType":"ParameterList","parameters":[],"src":"927:2:0"},"returnParameters":{"id":64,"nodeType":"ParameterList","parameters":[{"constant":false,"id":63,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":65,"src":"953:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":62,"name":"uint","nodeType":"ElementaryTypeName","src":"953:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"952:6:0"},"scope":159,"src":"907:52:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"5ecba503","id":72,"implemented":false,"kind":"function","modifiers":[],"name":"quorumCount","nameLocation":"974:11:0","nodeType":"FunctionDefinition","parameters":{"id":68,"nodeType":"ParameterList","parameters":[{"constant":false,"id":67,"mutability":"mutable","name":"_epoch","nameLocation":"991:6:0","nodeType":"VariableDeclaration","scope":72,"src":"986:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":66,"name":"uint","nodeType":"ElementaryTypeName","src":"986:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"985:13:0"},"returnParameters":{"id":71,"nodeType":"ParameterList","parameters":[{"constant":false,"id":70,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":72,"src":"1022:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":69,"name":"uint","nodeType":"ElementaryTypeName","src":"1022:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1021:6:0"},"scope":159,"src":"965:63:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"7df73e27","id":79,"implemented":false,"kind":"function","modifiers":[],"name":"isSigner","nameLocation":"1043:8:0","nodeType":"FunctionDefinition","parameters":{"id":75,"nodeType":"ParameterList","parameters":[{"constant":false,"id":74,"mutability":"mutable","name":"_account","nameLocation":"1060:8:0","nodeType":"VariableDeclaration","scope":79,"src":"1052:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":73,"name":"address","nodeType":"ElementaryTypeName","src":"1052:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1051:18:0"},"returnParameters":{"id":78,"nodeType":"ParameterList","parameters":[{"constant":false,"id":77,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":79,"src":"1093:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":76,"name":"bool","nodeType":"ElementaryTypeName","src":"1093:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1092:6:0"},"scope":159,"src":"1034:65:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"d1f5e5f8","id":89,"implemented":false,"kind":"function","modifiers":[],"name":"getSigner","nameLocation":"1114:9:0","nodeType":"FunctionDefinition","parameters":{"id":83,"nodeType":"ParameterList","parameters":[{"constant":false,"id":82,"mutability":"mutable","name":"_account","nameLocation":"1150:8:0","nodeType":"VariableDeclaration","scope":89,"src":"1133:25:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":80,"name":"address","nodeType":"ElementaryTypeName","src":"1133:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":81,"nodeType":"ArrayTypeName","src":"1133:9:0","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"1123:41:0"},"returnParameters":{"id":88,"nodeType":"ParameterList","parameters":[{"constant":false,"id":87,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":89,"src":"1188:21:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_struct$_SignerDetail_$27_memory_ptr_$dyn_memory_ptr","typeString":"struct IDASigners.SignerDetail[]"},"typeName":{"baseType":{"id":85,"nodeType":"UserDefinedTypeName","pathNode":{"id":84,"name":"SignerDetail","nameLocations":["1188:12:0"],"nodeType":"IdentifierPath","referencedDeclaration":27,"src":"1188:12:0"},"referencedDeclaration":27,"src":"1188:12:0","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_storage_ptr","typeString":"struct IDASigners.SignerDetail"}},"id":86,"nodeType":"ArrayTypeName","src":"1188:14:0","typeDescriptions":{"typeIdentifier":"t_array$_t_struct$_SignerDetail_$27_storage_$dyn_storage_ptr","typeString":"struct IDASigners.SignerDetail[]"}},"visibility":"internal"}],"src":"1187:23:0"},"scope":159,"src":"1105:106:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"6ab6f654","id":99,"implemented":false,"kind":"function","modifiers":[],"name":"getQuorum","nameLocation":"1226:9:0","nodeType":"FunctionDefinition","parameters":{"id":94,"nodeType":"ParameterList","parameters":[{"constant":false,"id":91,"mutability":"mutable","name":"_epoch","nameLocation":"1250:6:0","nodeType":"VariableDeclaration","scope":99,"src":"1245:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90,"name":"uint","nodeType":"ElementaryTypeName","src":"1245:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":93,"mutability":"mutable","name":"_quorumId","nameLocation":"1271:9:0","nodeType":"VariableDeclaration","scope":99,"src":"1266:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":92,"name":"uint","nodeType":"ElementaryTypeName","src":"1266:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1235:51:0"},"returnParameters":{"id":98,"nodeType":"ParameterList","parameters":[{"constant":false,"id":97,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":99,"src":"1310:16:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":95,"name":"address","nodeType":"ElementaryTypeName","src":"1310:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":96,"nodeType":"ArrayTypeName","src":"1310:9:0","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"1309:18:0"},"scope":159,"src":"1217:111:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"fa6fcba6","id":110,"implemented":false,"kind":"function","modifiers":[],"name":"getQuorumRow","nameLocation":"1343:12:0","nodeType":"FunctionDefinition","parameters":{"id":106,"nodeType":"ParameterList","parameters":[{"constant":false,"id":101,"mutability":"mutable","name":"_epoch","nameLocation":"1370:6:0","nodeType":"VariableDeclaration","scope":110,"src":"1365:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":100,"name":"uint","nodeType":"ElementaryTypeName","src":"1365:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":103,"mutability":"mutable","name":"_quorumId","nameLocation":"1391:9:0","nodeType":"VariableDeclaration","scope":110,"src":"1386:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":102,"name":"uint","nodeType":"ElementaryTypeName","src":"1386:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":105,"mutability":"mutable","name":"_rowIndex","nameLocation":"1417:9:0","nodeType":"VariableDeclaration","scope":110,"src":"1410:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"},"typeName":{"id":104,"name":"uint32","nodeType":"ElementaryTypeName","src":"1410:6:0","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}},"visibility":"internal"}],"src":"1355:77:0"},"returnParameters":{"id":109,"nodeType":"ParameterList","parameters":[{"constant":false,"id":108,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":110,"src":"1456:7:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":107,"name":"address","nodeType":"ElementaryTypeName","src":"1456:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1455:9:0"},"scope":159,"src":"1334:131:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"7ca4dd5e","id":119,"implemented":false,"kind":"function","modifiers":[],"name":"registerSigner","nameLocation":"1480:14:0","nodeType":"FunctionDefinition","parameters":{"id":117,"nodeType":"ParameterList","parameters":[{"constant":false,"id":113,"mutability":"mutable","name":"_signer","nameLocation":"1524:7:0","nodeType":"VariableDeclaration","scope":119,"src":"1504:27:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_memory_ptr","typeString":"struct IDASigners.SignerDetail"},"typeName":{"id":112,"nodeType":"UserDefinedTypeName","pathNode":{"id":111,"name":"SignerDetail","nameLocations":["1504:12:0"],"nodeType":"IdentifierPath","referencedDeclaration":27,"src":"1504:12:0"},"referencedDeclaration":27,"src":"1504:12:0","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_storage_ptr","typeString":"struct IDASigners.SignerDetail"}},"visibility":"internal"},{"constant":false,"id":116,"mutability":"mutable","name":"_signature","nameLocation":"1562:10:0","nodeType":"VariableDeclaration","scope":119,"src":"1541:31:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":115,"nodeType":"UserDefinedTypeName","pathNode":{"id":114,"name":"BN254.G1Point","nameLocations":["1541:5:0","1547:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1541:13:0"},"referencedDeclaration":6,"src":"1541:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"}],"src":"1494:84:0"},"returnParameters":{"id":118,"nodeType":"ParameterList","parameters":[],"src":"1587:0:0"},"scope":159,"src":"1471:117:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"0cf4b767","id":124,"implemented":false,"kind":"function","modifiers":[],"name":"updateSocket","nameLocation":"1603:12:0","nodeType":"FunctionDefinition","parameters":{"id":122,"nodeType":"ParameterList","parameters":[{"constant":false,"id":121,"mutability":"mutable","name":"_socket","nameLocation":"1630:7:0","nodeType":"VariableDeclaration","scope":124,"src":"1616:21:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":120,"name":"string","nodeType":"ElementaryTypeName","src":"1616:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"1615:23:0"},"returnParameters":{"id":123,"nodeType":"ParameterList","parameters":[],"src":"1647:0:0"},"scope":159,"src":"1594:54:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"6c9e560c","id":133,"implemented":false,"kind":"function","modifiers":[],"name":"registeredEpoch","nameLocation":"1663:15:0","nodeType":"FunctionDefinition","parameters":{"id":129,"nodeType":"ParameterList","parameters":[{"constant":false,"id":126,"mutability":"mutable","name":"_account","nameLocation":"1696:8:0","nodeType":"VariableDeclaration","scope":133,"src":"1688:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":125,"name":"address","nodeType":"ElementaryTypeName","src":"1688:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":128,"mutability":"mutable","name":"_epoch","nameLocation":"1719:6:0","nodeType":"VariableDeclaration","scope":133,"src":"1714:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":127,"name":"uint","nodeType":"ElementaryTypeName","src":"1714:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1678:53:0"},"returnParameters":{"id":132,"nodeType":"ParameterList","parameters":[{"constant":false,"id":131,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":133,"src":"1755:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":130,"name":"bool","nodeType":"ElementaryTypeName","src":"1755:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1754:6:0"},"scope":159,"src":"1654:107:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"56a32372","id":139,"implemented":false,"kind":"function","modifiers":[],"name":"registerNextEpoch","nameLocation":"1776:17:0","nodeType":"FunctionDefinition","parameters":{"id":137,"nodeType":"ParameterList","parameters":[{"constant":false,"id":136,"mutability":"mutable","name":"_signature","nameLocation":"1815:10:0","nodeType":"VariableDeclaration","scope":139,"src":"1794:31:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":135,"nodeType":"UserDefinedTypeName","pathNode":{"id":134,"name":"BN254.G1Point","nameLocations":["1794:5:0","1800:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1794:13:0"},"referencedDeclaration":6,"src":"1794:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"}],"src":"1793:33:0"},"returnParameters":{"id":138,"nodeType":"ParameterList","parameters":[],"src":"1835:0:0"},"scope":159,"src":"1767:69:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"5a889f0c","id":142,"implemented":false,"kind":"function","modifiers":[],"name":"makeEpoch","nameLocation":"1851:9:0","nodeType":"FunctionDefinition","parameters":{"id":140,"nodeType":"ParameterList","parameters":[],"src":"1860:2:0"},"returnParameters":{"id":141,"nodeType":"ParameterList","parameters":[],"src":"1871:0:0"},"scope":159,"src":"1842:30:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"50b73739","id":158,"implemented":false,"kind":"function","modifiers":[],"name":"getAggPkG1","nameLocation":"1887:10:0","nodeType":"FunctionDefinition","parameters":{"id":149,"nodeType":"ParameterList","parameters":[{"constant":false,"id":144,"mutability":"mutable","name":"_epoch","nameLocation":"1912:6:0","nodeType":"VariableDeclaration","scope":158,"src":"1907:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":143,"name":"uint","nodeType":"ElementaryTypeName","src":"1907:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":146,"mutability":"mutable","name":"_quorumId","nameLocation":"1933:9:0","nodeType":"VariableDeclaration","scope":158,"src":"1928:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":145,"name":"uint","nodeType":"ElementaryTypeName","src":"1928:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":148,"mutability":"mutable","name":"_quorumBitmap","nameLocation":"1965:13:0","nodeType":"VariableDeclaration","scope":158,"src":"1952:26:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":147,"name":"bytes","nodeType":"ElementaryTypeName","src":"1952:5:0","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"1897:87:0"},"returnParameters":{"id":157,"nodeType":"ParameterList","parameters":[{"constant":false,"id":152,"mutability":"mutable","name":"aggPkG1","nameLocation":"2053:7:0","nodeType":"VariableDeclaration","scope":158,"src":"2032:28:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":151,"nodeType":"UserDefinedTypeName","pathNode":{"id":150,"name":"BN254.G1Point","nameLocations":["2032:5:0","2038:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"2032:13:0"},"referencedDeclaration":6,"src":"2032:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":154,"mutability":"mutable","name":"total","nameLocation":"2067:5:0","nodeType":"VariableDeclaration","scope":158,"src":"2062:10:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":153,"name":"uint","nodeType":"ElementaryTypeName","src":"2062:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":156,"mutability":"mutable","name":"hit","nameLocation":"2079:3:0","nodeType":"VariableDeclaration","scope":158,"src":"2074:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":155,"name":"uint","nodeType":"ElementaryTypeName","src":"2074:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"2031:52:0"},"scope":159,"src":"1878:206:0","stateMutability":"view","virtual":false,"visibility":"external"}],"scope":160,"src":"266:1820:0","usedErrors":[],"usedEvents":[48,54]}],"src":"42:2045:0"},"id":0}},"contracts":{"contracts/IDASigners.sol":{"BN254":{"abi":[],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220abc43d74fec9de74f3b7a60ee2e0337c23369163d8fb7a1e1cb0037a16d8abfb64736f6c63430008140033","opcodes":"PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xAB 0xC4 RETURNDATASIZE PUSH21 0xFEC9DE74F3B7A60EE2E0337C23369163D8FB7A1E1C 0xB0 SUB PUSH27 0x16D8ABFB64736F6C63430008140033000000000000000000000000 ","sourceMap":"68:196:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;68:196:0;;;;;;;;;;;;;;;;;"},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220abc43d74fec9de74f3b7a60ee2e0337c23369163d8fb7a1e1cb0037a16d8abfb64736f6c63430008140033","opcodes":"PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xAB 0xC4 RETURNDATASIZE PUSH21 0xFEC9DE74F3B7A60EE2E0337C23369163D8FB7A1E1C 0xB0 SUB PUSH27 0x16D8ABFB64736F6C63430008140033000000000000000000000000 ","sourceMap":"68:196:0:-:0;;;;;;;;"},"methodIdentifiers":{}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IDASigners.sol\":\"BN254\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IDASigners.sol\":{\"keccak256\":\"0x77f38cecc2dd928cbbad6168d05b0aed9fd8b949a3b84cf2c00bc35ecae451e7\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://c9c7363b995c112920f863e74f7b14a61731dd6c0e4eee072e3e7f850bd37ada\",\"dweb:/ipfs/QmXGXVWVaNJDw1b4Fv7b1GEdgpeTtnuPSEq8m8Z5dtuucE\"]}},\"version\":1}"},"IDASigners":{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"indexed":false,"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"indexed":false,"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"name":"NewSigner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"string","name":"socket","type":"string"}],"name":"SocketUpdated","type":"event"},{"inputs":[],"name":"epochNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"},{"internalType":"bytes","name":"_quorumBitmap","type":"bytes"}],"name":"getAggPkG1","outputs":[{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"aggPkG1","type":"tuple"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"hit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"}],"name":"getQuorum","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"},{"internalType":"uint32","name":"_rowIndex","type":"uint32"}],"name":"getQuorumRow","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_account","type":"address[]"}],"name":"getSigner","outputs":[{"components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"string","name":"socket","type":"string"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"internalType":"struct IDASigners.SignerDetail[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"makeEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"params","outputs":[{"components":[{"internalType":"uint256","name":"tokensPerVote","type":"uint256"},{"internalType":"uint256","name":"maxVotesPerSigner","type":"uint256"},{"internalType":"uint256","name":"maxQuorums","type":"uint256"},{"internalType":"uint256","name":"epochBlocks","type":"uint256"},{"internalType":"uint256","name":"encodedSlices","type":"uint256"}],"internalType":"struct IDASigners.Params","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"quorumCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"_signature","type":"tuple"}],"name":"registerNextEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"string","name":"socket","type":"string"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"internalType":"struct IDASigners.SignerDetail","name":"_signer","type":"tuple"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"_signature","type":"tuple"}],"name":"registerSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"registeredEpoch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_socket","type":"string"}],"name":"updateSocket","outputs":[],"stateMutability":"nonpayable","type":"function"}],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"methodIdentifiers":{"epochNumber()":"f4145a83","getAggPkG1(uint256,uint256,bytes)":"50b73739","getQuorum(uint256,uint256)":"6ab6f654","getQuorumRow(uint256,uint256,uint32)":"fa6fcba6","getSigner(address[])":"d1f5e5f8","isSigner(address)":"7df73e27","makeEpoch()":"5a889f0c","params()":"cff0ab96","quorumCount(uint256)":"5ecba503","registerNextEpoch((uint256,uint256))":"56a32372","registerSigner((address,string,(uint256,uint256),(uint256[2],uint256[2])),(uint256,uint256))":"7ca4dd5e","registeredEpoch(address,uint256)":"6c9e560c","updateSocket(string)":"0cf4b767"}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"struct IDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"makeEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"struct IDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"struct IDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IDASigners.sol\":\"IDASigners\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IDASigners.sol\":{\"keccak256\":\"0x77f38cecc2dd928cbbad6168d05b0aed9fd8b949a3b84cf2c00bc35ecae451e7\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://c9c7363b995c112920f863e74f7b14a61731dd6c0e4eee072e3e7f850bd37ada\",\"dweb:/ipfs/QmXGXVWVaNJDw1b4Fv7b1GEdgpeTtnuPSEq8m8Z5dtuucE\"]}},\"version\":1}"}}}}} \ No newline at end of file diff --git a/core/vm/precompiles/interfaces/build/artifacts/build-info/c79ff14473359160d0c7a65892d5cb52.json b/core/vm/precompiles/interfaces/build/artifacts/build-info/c79ff14473359160d0c7a65892d5cb52.json deleted file mode 100644 index 4c4f7657d0..0000000000 --- a/core/vm/precompiles/interfaces/build/artifacts/build-info/c79ff14473359160d0c7a65892d5cb52.json +++ /dev/null @@ -1 +0,0 @@ -{"id":"c79ff14473359160d0c7a65892d5cb52","_format":"hh-sol-build-info-1","solcVersion":"0.8.20","solcLongVersion":"0.8.20+commit.a1b79de6","input":{"language":"Solidity","sources":{"contracts/IDASigners.sol":{"content":"// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\nlibrary BN254 {\n struct G1Point {\n uint X;\n uint Y;\n }\n\n // Encoding of field elements is: X[1] * i + X[0]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n}\n\ninterface IDASigners {\n /*=== struct ===*/\n struct SignerDetail {\n address signer;\n string socket;\n BN254.G1Point pkG1;\n BN254.G2Point pkG2;\n }\n\n struct Params {\n uint tokensPerVote;\n uint maxVotesPerSigner;\n uint maxQuorums;\n uint epochBlocks;\n uint encodedSlices;\n }\n\n /*=== event ===*/\n event NewSigner(\n address indexed signer,\n BN254.G1Point pkG1,\n BN254.G2Point pkG2\n );\n event SocketUpdated(address indexed signer, string socket);\n\n /*=== function ===*/\n function params() external view returns (Params memory);\n\n function epochNumber() external view returns (uint);\n\n function quorumCount(uint _epoch) external view returns (uint);\n\n function isSigner(address _account) external view returns (bool);\n\n function getSigner(\n address[] memory _account\n ) external view returns (SignerDetail[] memory);\n\n function getQuorum(\n uint _epoch,\n uint _quorumId\n ) external view returns (address[] memory);\n\n function getQuorumRow(\n uint _epoch,\n uint _quorumId,\n uint32 _rowIndex\n ) external view returns (address);\n\n function registerSigner(\n SignerDetail memory _signer,\n BN254.G1Point memory _signature\n ) external;\n\n function updateSocket(string memory _socket) external;\n\n function registeredEpoch(\n address _account,\n uint _epoch\n ) external view returns (bool);\n\n function registerNextEpoch(BN254.G1Point memory _signature) external;\n\n function getAggPkG1(\n uint _epoch,\n uint _quorumId,\n bytes memory _quorumBitmap\n )\n external\n view\n returns (BN254.G1Point memory aggPkG1, uint total, uint hit);\n}\n"},"contracts/IWrappedA0GIBase.sol":{"content":"// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity >=0.8.0;\n\nstruct Supply {\n uint256 cap;\n uint256 initialSupply;\n uint256 supply;\n}\n\n/**\n * @title WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly.\n */\ninterface IWrappedA0GIBase {\n /**\n * @dev set the wA0GI address.\n * It is designed to be called by governance module only so it's not implemented at EVM precompile side.\n * @param addr address of wA0GI\n */\n // function setWA0GI(address addr) external;\n\n /**\n * @dev get the wA0GI address.\n */\n function getWA0GI() external view returns (address);\n\n /**\n * @dev set the cap and initial supply for a minter.\n * It is designed to be called by governance module only so it's not implemented at EVM precompile side.\n * @param minter minter address\n * @param cap mint cap\n * @param initialSupply initial mint supply\n */\n // function setMinterCap(address minter, uint256 cap, uint256 initialSupply) external;\n\n /**\n * @dev get the mint supply of given address\n * @param minter minter address\n */\n function minterSupply(address minter) external view returns (Supply memory);\n\n /**\n * @dev mint a0gi to this precompile, add corresponding amount to minter's mint supply.\n * If sender's final mint supply exceeds its mint cap, the transaction will revert.\n * Can only be called by WA0GI.\n * @param minter minter address\n * @param amount amount to mint\n */\n function mint(address minter, uint256 amount) external;\n\n /**\n * @dev burn given amount of a0gi on behalf of minter, reduce corresponding amount from sender's mint supply.\n * Can only be called by WA0GI.\n * @param minter minter address\n * @param amount amount to burn\n */\n function burn(address minter, uint256 amount) external;\n}\n"}},"settings":{"evmVersion":"istanbul","optimizer":{"enabled":true,"runs":200},"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}}}},"output":{"sources":{"contracts/IDASigners.sol":{"ast":{"absolutePath":"contracts/IDASigners.sol","exportedSymbols":{"BN254":[16],"IDASigners":[156]},"id":157,"license":"LGPL-3.0-only","nodeType":"SourceUnit","nodes":[{"id":1,"literals":["solidity",">=","0.8",".0"],"nodeType":"PragmaDirective","src":"42:24:0"},{"abstract":false,"baseContracts":[],"canonicalName":"BN254","contractDependencies":[],"contractKind":"library","fullyImplemented":true,"id":16,"linearizedBaseContracts":[16],"name":"BN254","nameLocation":"76:5:0","nodeType":"ContractDefinition","nodes":[{"canonicalName":"BN254.G1Point","id":6,"members":[{"constant":false,"id":3,"mutability":"mutable","name":"X","nameLocation":"118:1:0","nodeType":"VariableDeclaration","scope":6,"src":"113:6:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":2,"name":"uint","nodeType":"ElementaryTypeName","src":"113:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":5,"mutability":"mutable","name":"Y","nameLocation":"134:1:0","nodeType":"VariableDeclaration","scope":6,"src":"129:6:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":4,"name":"uint","nodeType":"ElementaryTypeName","src":"129:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"G1Point","nameLocation":"95:7:0","nodeType":"StructDefinition","scope":16,"src":"88:54:0","visibility":"public"},{"canonicalName":"BN254.G2Point","id":15,"members":[{"constant":false,"id":10,"mutability":"mutable","name":"X","nameLocation":"235:1:0","nodeType":"VariableDeclaration","scope":15,"src":"227:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"},"typeName":{"baseType":{"id":7,"name":"uint","nodeType":"ElementaryTypeName","src":"227:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":9,"length":{"hexValue":"32","id":8,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"232:1:0","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"nodeType":"ArrayTypeName","src":"227:7:0","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"}},"visibility":"internal"},{"constant":false,"id":14,"mutability":"mutable","name":"Y","nameLocation":"254:1:0","nodeType":"VariableDeclaration","scope":15,"src":"246:9:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"},"typeName":{"baseType":{"id":11,"name":"uint","nodeType":"ElementaryTypeName","src":"246:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"id":13,"length":{"hexValue":"32","id":12,"isConstant":false,"isLValue":false,"isPure":true,"kind":"number","lValueRequested":false,"nodeType":"Literal","src":"251:1:0","typeDescriptions":{"typeIdentifier":"t_rational_2_by_1","typeString":"int_const 2"},"value":"2"},"nodeType":"ArrayTypeName","src":"246:7:0","typeDescriptions":{"typeIdentifier":"t_array$_t_uint256_$2_storage_ptr","typeString":"uint256[2]"}},"visibility":"internal"}],"name":"G2Point","nameLocation":"209:7:0","nodeType":"StructDefinition","scope":16,"src":"202:60:0","visibility":"public"}],"scope":157,"src":"68:196:0","usedErrors":[],"usedEvents":[]},{"abstract":false,"baseContracts":[],"canonicalName":"IDASigners","contractDependencies":[],"contractKind":"interface","fullyImplemented":false,"id":156,"linearizedBaseContracts":[156],"name":"IDASigners","nameLocation":"276:10:0","nodeType":"ContractDefinition","nodes":[{"canonicalName":"IDASigners.SignerDetail","id":27,"members":[{"constant":false,"id":18,"mutability":"mutable","name":"signer","nameLocation":"354:6:0","nodeType":"VariableDeclaration","scope":27,"src":"346:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":17,"name":"address","nodeType":"ElementaryTypeName","src":"346:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":20,"mutability":"mutable","name":"socket","nameLocation":"377:6:0","nodeType":"VariableDeclaration","scope":27,"src":"370:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"},"typeName":{"id":19,"name":"string","nodeType":"ElementaryTypeName","src":"370:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"},{"constant":false,"id":23,"mutability":"mutable","name":"pkG1","nameLocation":"407:4:0","nodeType":"VariableDeclaration","scope":27,"src":"393:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":22,"nodeType":"UserDefinedTypeName","pathNode":{"id":21,"name":"BN254.G1Point","nameLocations":["393:5:0","399:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"393:13:0"},"referencedDeclaration":6,"src":"393:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":26,"mutability":"mutable","name":"pkG2","nameLocation":"435:4:0","nodeType":"VariableDeclaration","scope":27,"src":"421:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"},"typeName":{"id":25,"nodeType":"UserDefinedTypeName","pathNode":{"id":24,"name":"BN254.G2Point","nameLocations":["421:5:0","427:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":15,"src":"421:13:0"},"referencedDeclaration":15,"src":"421:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"}},"visibility":"internal"}],"name":"SignerDetail","nameLocation":"323:12:0","nodeType":"StructDefinition","scope":156,"src":"316:130:0","visibility":"public"},{"canonicalName":"IDASigners.Params","id":38,"members":[{"constant":false,"id":29,"mutability":"mutable","name":"tokensPerVote","nameLocation":"481:13:0","nodeType":"VariableDeclaration","scope":38,"src":"476:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":28,"name":"uint","nodeType":"ElementaryTypeName","src":"476:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":31,"mutability":"mutable","name":"maxVotesPerSigner","nameLocation":"509:17:0","nodeType":"VariableDeclaration","scope":38,"src":"504:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":30,"name":"uint","nodeType":"ElementaryTypeName","src":"504:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":33,"mutability":"mutable","name":"maxQuorums","nameLocation":"541:10:0","nodeType":"VariableDeclaration","scope":38,"src":"536:15:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":32,"name":"uint","nodeType":"ElementaryTypeName","src":"536:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":35,"mutability":"mutable","name":"epochBlocks","nameLocation":"566:11:0","nodeType":"VariableDeclaration","scope":38,"src":"561:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":34,"name":"uint","nodeType":"ElementaryTypeName","src":"561:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":37,"mutability":"mutable","name":"encodedSlices","nameLocation":"592:13:0","nodeType":"VariableDeclaration","scope":38,"src":"587:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":36,"name":"uint","nodeType":"ElementaryTypeName","src":"587:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"Params","nameLocation":"459:6:0","nodeType":"StructDefinition","scope":156,"src":"452:160:0","visibility":"public"},{"anonymous":false,"eventSelector":"679917c2006df1daaa987a56bf1d66e99764d5ad317892d9e83a6eb4e3f051e7","id":48,"name":"NewSigner","nameLocation":"646:9:0","nodeType":"EventDefinition","parameters":{"id":47,"nodeType":"ParameterList","parameters":[{"constant":false,"id":40,"indexed":true,"mutability":"mutable","name":"signer","nameLocation":"681:6:0","nodeType":"VariableDeclaration","scope":48,"src":"665:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":39,"name":"address","nodeType":"ElementaryTypeName","src":"665:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":43,"indexed":false,"mutability":"mutable","name":"pkG1","nameLocation":"711:4:0","nodeType":"VariableDeclaration","scope":48,"src":"697:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":42,"nodeType":"UserDefinedTypeName","pathNode":{"id":41,"name":"BN254.G1Point","nameLocations":["697:5:0","703:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"697:13:0"},"referencedDeclaration":6,"src":"697:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":46,"indexed":false,"mutability":"mutable","name":"pkG2","nameLocation":"739:4:0","nodeType":"VariableDeclaration","scope":48,"src":"725:18:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_memory_ptr","typeString":"struct BN254.G2Point"},"typeName":{"id":45,"nodeType":"UserDefinedTypeName","pathNode":{"id":44,"name":"BN254.G2Point","nameLocations":["725:5:0","731:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":15,"src":"725:13:0"},"referencedDeclaration":15,"src":"725:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G2Point_$15_storage_ptr","typeString":"struct BN254.G2Point"}},"visibility":"internal"}],"src":"655:94:0"},"src":"640:110:0"},{"anonymous":false,"eventSelector":"09617a966176a40f8f1410768b118506db0096484acd5811064fcc12038798de","id":54,"name":"SocketUpdated","nameLocation":"761:13:0","nodeType":"EventDefinition","parameters":{"id":53,"nodeType":"ParameterList","parameters":[{"constant":false,"id":50,"indexed":true,"mutability":"mutable","name":"signer","nameLocation":"791:6:0","nodeType":"VariableDeclaration","scope":54,"src":"775:22:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":49,"name":"address","nodeType":"ElementaryTypeName","src":"775:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":52,"indexed":false,"mutability":"mutable","name":"socket","nameLocation":"806:6:0","nodeType":"VariableDeclaration","scope":54,"src":"799:13:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":51,"name":"string","nodeType":"ElementaryTypeName","src":"799:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"774:39:0"},"src":"755:59:0"},{"functionSelector":"cff0ab96","id":60,"implemented":false,"kind":"function","modifiers":[],"name":"params","nameLocation":"854:6:0","nodeType":"FunctionDefinition","parameters":{"id":55,"nodeType":"ParameterList","parameters":[],"src":"860:2:0"},"returnParameters":{"id":59,"nodeType":"ParameterList","parameters":[{"constant":false,"id":58,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":60,"src":"886:13:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Params_$38_memory_ptr","typeString":"struct IDASigners.Params"},"typeName":{"id":57,"nodeType":"UserDefinedTypeName","pathNode":{"id":56,"name":"Params","nameLocations":["886:6:0"],"nodeType":"IdentifierPath","referencedDeclaration":38,"src":"886:6:0"},"referencedDeclaration":38,"src":"886:6:0","typeDescriptions":{"typeIdentifier":"t_struct$_Params_$38_storage_ptr","typeString":"struct IDASigners.Params"}},"visibility":"internal"}],"src":"885:15:0"},"scope":156,"src":"845:56:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"f4145a83","id":65,"implemented":false,"kind":"function","modifiers":[],"name":"epochNumber","nameLocation":"916:11:0","nodeType":"FunctionDefinition","parameters":{"id":61,"nodeType":"ParameterList","parameters":[],"src":"927:2:0"},"returnParameters":{"id":64,"nodeType":"ParameterList","parameters":[{"constant":false,"id":63,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":65,"src":"953:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":62,"name":"uint","nodeType":"ElementaryTypeName","src":"953:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"952:6:0"},"scope":156,"src":"907:52:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"5ecba503","id":72,"implemented":false,"kind":"function","modifiers":[],"name":"quorumCount","nameLocation":"974:11:0","nodeType":"FunctionDefinition","parameters":{"id":68,"nodeType":"ParameterList","parameters":[{"constant":false,"id":67,"mutability":"mutable","name":"_epoch","nameLocation":"991:6:0","nodeType":"VariableDeclaration","scope":72,"src":"986:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":66,"name":"uint","nodeType":"ElementaryTypeName","src":"986:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"985:13:0"},"returnParameters":{"id":71,"nodeType":"ParameterList","parameters":[{"constant":false,"id":70,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":72,"src":"1022:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":69,"name":"uint","nodeType":"ElementaryTypeName","src":"1022:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1021:6:0"},"scope":156,"src":"965:63:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"7df73e27","id":79,"implemented":false,"kind":"function","modifiers":[],"name":"isSigner","nameLocation":"1043:8:0","nodeType":"FunctionDefinition","parameters":{"id":75,"nodeType":"ParameterList","parameters":[{"constant":false,"id":74,"mutability":"mutable","name":"_account","nameLocation":"1060:8:0","nodeType":"VariableDeclaration","scope":79,"src":"1052:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":73,"name":"address","nodeType":"ElementaryTypeName","src":"1052:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1051:18:0"},"returnParameters":{"id":78,"nodeType":"ParameterList","parameters":[{"constant":false,"id":77,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":79,"src":"1093:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":76,"name":"bool","nodeType":"ElementaryTypeName","src":"1093:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1092:6:0"},"scope":156,"src":"1034:65:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"d1f5e5f8","id":89,"implemented":false,"kind":"function","modifiers":[],"name":"getSigner","nameLocation":"1114:9:0","nodeType":"FunctionDefinition","parameters":{"id":83,"nodeType":"ParameterList","parameters":[{"constant":false,"id":82,"mutability":"mutable","name":"_account","nameLocation":"1150:8:0","nodeType":"VariableDeclaration","scope":89,"src":"1133:25:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":80,"name":"address","nodeType":"ElementaryTypeName","src":"1133:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":81,"nodeType":"ArrayTypeName","src":"1133:9:0","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"1123:41:0"},"returnParameters":{"id":88,"nodeType":"ParameterList","parameters":[{"constant":false,"id":87,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":89,"src":"1188:21:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_struct$_SignerDetail_$27_memory_ptr_$dyn_memory_ptr","typeString":"struct IDASigners.SignerDetail[]"},"typeName":{"baseType":{"id":85,"nodeType":"UserDefinedTypeName","pathNode":{"id":84,"name":"SignerDetail","nameLocations":["1188:12:0"],"nodeType":"IdentifierPath","referencedDeclaration":27,"src":"1188:12:0"},"referencedDeclaration":27,"src":"1188:12:0","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_storage_ptr","typeString":"struct IDASigners.SignerDetail"}},"id":86,"nodeType":"ArrayTypeName","src":"1188:14:0","typeDescriptions":{"typeIdentifier":"t_array$_t_struct$_SignerDetail_$27_storage_$dyn_storage_ptr","typeString":"struct IDASigners.SignerDetail[]"}},"visibility":"internal"}],"src":"1187:23:0"},"scope":156,"src":"1105:106:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"6ab6f654","id":99,"implemented":false,"kind":"function","modifiers":[],"name":"getQuorum","nameLocation":"1226:9:0","nodeType":"FunctionDefinition","parameters":{"id":94,"nodeType":"ParameterList","parameters":[{"constant":false,"id":91,"mutability":"mutable","name":"_epoch","nameLocation":"1250:6:0","nodeType":"VariableDeclaration","scope":99,"src":"1245:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":90,"name":"uint","nodeType":"ElementaryTypeName","src":"1245:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":93,"mutability":"mutable","name":"_quorumId","nameLocation":"1271:9:0","nodeType":"VariableDeclaration","scope":99,"src":"1266:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":92,"name":"uint","nodeType":"ElementaryTypeName","src":"1266:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1235:51:0"},"returnParameters":{"id":98,"nodeType":"ParameterList","parameters":[{"constant":false,"id":97,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":99,"src":"1310:16:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_memory_ptr","typeString":"address[]"},"typeName":{"baseType":{"id":95,"name":"address","nodeType":"ElementaryTypeName","src":"1310:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"id":96,"nodeType":"ArrayTypeName","src":"1310:9:0","typeDescriptions":{"typeIdentifier":"t_array$_t_address_$dyn_storage_ptr","typeString":"address[]"}},"visibility":"internal"}],"src":"1309:18:0"},"scope":156,"src":"1217:111:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"fa6fcba6","id":110,"implemented":false,"kind":"function","modifiers":[],"name":"getQuorumRow","nameLocation":"1343:12:0","nodeType":"FunctionDefinition","parameters":{"id":106,"nodeType":"ParameterList","parameters":[{"constant":false,"id":101,"mutability":"mutable","name":"_epoch","nameLocation":"1370:6:0","nodeType":"VariableDeclaration","scope":110,"src":"1365:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":100,"name":"uint","nodeType":"ElementaryTypeName","src":"1365:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":103,"mutability":"mutable","name":"_quorumId","nameLocation":"1391:9:0","nodeType":"VariableDeclaration","scope":110,"src":"1386:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":102,"name":"uint","nodeType":"ElementaryTypeName","src":"1386:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":105,"mutability":"mutable","name":"_rowIndex","nameLocation":"1417:9:0","nodeType":"VariableDeclaration","scope":110,"src":"1410:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"},"typeName":{"id":104,"name":"uint32","nodeType":"ElementaryTypeName","src":"1410:6:0","typeDescriptions":{"typeIdentifier":"t_uint32","typeString":"uint32"}},"visibility":"internal"}],"src":"1355:77:0"},"returnParameters":{"id":109,"nodeType":"ParameterList","parameters":[{"constant":false,"id":108,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":110,"src":"1456:7:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":107,"name":"address","nodeType":"ElementaryTypeName","src":"1456:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1455:9:0"},"scope":156,"src":"1334:131:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"7ca4dd5e","id":119,"implemented":false,"kind":"function","modifiers":[],"name":"registerSigner","nameLocation":"1480:14:0","nodeType":"FunctionDefinition","parameters":{"id":117,"nodeType":"ParameterList","parameters":[{"constant":false,"id":113,"mutability":"mutable","name":"_signer","nameLocation":"1524:7:0","nodeType":"VariableDeclaration","scope":119,"src":"1504:27:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_memory_ptr","typeString":"struct IDASigners.SignerDetail"},"typeName":{"id":112,"nodeType":"UserDefinedTypeName","pathNode":{"id":111,"name":"SignerDetail","nameLocations":["1504:12:0"],"nodeType":"IdentifierPath","referencedDeclaration":27,"src":"1504:12:0"},"referencedDeclaration":27,"src":"1504:12:0","typeDescriptions":{"typeIdentifier":"t_struct$_SignerDetail_$27_storage_ptr","typeString":"struct IDASigners.SignerDetail"}},"visibility":"internal"},{"constant":false,"id":116,"mutability":"mutable","name":"_signature","nameLocation":"1562:10:0","nodeType":"VariableDeclaration","scope":119,"src":"1541:31:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":115,"nodeType":"UserDefinedTypeName","pathNode":{"id":114,"name":"BN254.G1Point","nameLocations":["1541:5:0","1547:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1541:13:0"},"referencedDeclaration":6,"src":"1541:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"}],"src":"1494:84:0"},"returnParameters":{"id":118,"nodeType":"ParameterList","parameters":[],"src":"1587:0:0"},"scope":156,"src":"1471:117:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"0cf4b767","id":124,"implemented":false,"kind":"function","modifiers":[],"name":"updateSocket","nameLocation":"1603:12:0","nodeType":"FunctionDefinition","parameters":{"id":122,"nodeType":"ParameterList","parameters":[{"constant":false,"id":121,"mutability":"mutable","name":"_socket","nameLocation":"1630:7:0","nodeType":"VariableDeclaration","scope":124,"src":"1616:21:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_string_memory_ptr","typeString":"string"},"typeName":{"id":120,"name":"string","nodeType":"ElementaryTypeName","src":"1616:6:0","typeDescriptions":{"typeIdentifier":"t_string_storage_ptr","typeString":"string"}},"visibility":"internal"}],"src":"1615:23:0"},"returnParameters":{"id":123,"nodeType":"ParameterList","parameters":[],"src":"1647:0:0"},"scope":156,"src":"1594:54:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"6c9e560c","id":133,"implemented":false,"kind":"function","modifiers":[],"name":"registeredEpoch","nameLocation":"1663:15:0","nodeType":"FunctionDefinition","parameters":{"id":129,"nodeType":"ParameterList","parameters":[{"constant":false,"id":126,"mutability":"mutable","name":"_account","nameLocation":"1696:8:0","nodeType":"VariableDeclaration","scope":133,"src":"1688:16:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":125,"name":"address","nodeType":"ElementaryTypeName","src":"1688:7:0","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":128,"mutability":"mutable","name":"_epoch","nameLocation":"1719:6:0","nodeType":"VariableDeclaration","scope":133,"src":"1714:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":127,"name":"uint","nodeType":"ElementaryTypeName","src":"1714:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1678:53:0"},"returnParameters":{"id":132,"nodeType":"ParameterList","parameters":[{"constant":false,"id":131,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":133,"src":"1755:4:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"},"typeName":{"id":130,"name":"bool","nodeType":"ElementaryTypeName","src":"1755:4:0","typeDescriptions":{"typeIdentifier":"t_bool","typeString":"bool"}},"visibility":"internal"}],"src":"1754:6:0"},"scope":156,"src":"1654:107:0","stateMutability":"view","virtual":false,"visibility":"external"},{"functionSelector":"56a32372","id":139,"implemented":false,"kind":"function","modifiers":[],"name":"registerNextEpoch","nameLocation":"1776:17:0","nodeType":"FunctionDefinition","parameters":{"id":137,"nodeType":"ParameterList","parameters":[{"constant":false,"id":136,"mutability":"mutable","name":"_signature","nameLocation":"1815:10:0","nodeType":"VariableDeclaration","scope":139,"src":"1794:31:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":135,"nodeType":"UserDefinedTypeName","pathNode":{"id":134,"name":"BN254.G1Point","nameLocations":["1794:5:0","1800:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1794:13:0"},"referencedDeclaration":6,"src":"1794:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"}],"src":"1793:33:0"},"returnParameters":{"id":138,"nodeType":"ParameterList","parameters":[],"src":"1835:0:0"},"scope":156,"src":"1767:69:0","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"functionSelector":"50b73739","id":155,"implemented":false,"kind":"function","modifiers":[],"name":"getAggPkG1","nameLocation":"1851:10:0","nodeType":"FunctionDefinition","parameters":{"id":146,"nodeType":"ParameterList","parameters":[{"constant":false,"id":141,"mutability":"mutable","name":"_epoch","nameLocation":"1876:6:0","nodeType":"VariableDeclaration","scope":155,"src":"1871:11:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":140,"name":"uint","nodeType":"ElementaryTypeName","src":"1871:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":143,"mutability":"mutable","name":"_quorumId","nameLocation":"1897:9:0","nodeType":"VariableDeclaration","scope":155,"src":"1892:14:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":142,"name":"uint","nodeType":"ElementaryTypeName","src":"1892:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":145,"mutability":"mutable","name":"_quorumBitmap","nameLocation":"1929:13:0","nodeType":"VariableDeclaration","scope":155,"src":"1916:26:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_bytes_memory_ptr","typeString":"bytes"},"typeName":{"id":144,"name":"bytes","nodeType":"ElementaryTypeName","src":"1916:5:0","typeDescriptions":{"typeIdentifier":"t_bytes_storage_ptr","typeString":"bytes"}},"visibility":"internal"}],"src":"1861:87:0"},"returnParameters":{"id":154,"nodeType":"ParameterList","parameters":[{"constant":false,"id":149,"mutability":"mutable","name":"aggPkG1","nameLocation":"2017:7:0","nodeType":"VariableDeclaration","scope":155,"src":"1996:28:0","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_memory_ptr","typeString":"struct BN254.G1Point"},"typeName":{"id":148,"nodeType":"UserDefinedTypeName","pathNode":{"id":147,"name":"BN254.G1Point","nameLocations":["1996:5:0","2002:7:0"],"nodeType":"IdentifierPath","referencedDeclaration":6,"src":"1996:13:0"},"referencedDeclaration":6,"src":"1996:13:0","typeDescriptions":{"typeIdentifier":"t_struct$_G1Point_$6_storage_ptr","typeString":"struct BN254.G1Point"}},"visibility":"internal"},{"constant":false,"id":151,"mutability":"mutable","name":"total","nameLocation":"2031:5:0","nodeType":"VariableDeclaration","scope":155,"src":"2026:10:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":150,"name":"uint","nodeType":"ElementaryTypeName","src":"2026:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":153,"mutability":"mutable","name":"hit","nameLocation":"2043:3:0","nodeType":"VariableDeclaration","scope":155,"src":"2038:8:0","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":152,"name":"uint","nodeType":"ElementaryTypeName","src":"2038:4:0","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1995:52:0"},"scope":156,"src":"1842:206:0","stateMutability":"view","virtual":false,"visibility":"external"}],"scope":157,"src":"266:1784:0","usedErrors":[],"usedEvents":[48,54]}],"src":"42:2009:0"},"id":0},"contracts/IWrappedA0GIBase.sol":{"ast":{"absolutePath":"contracts/IWrappedA0GIBase.sol","exportedSymbols":{"IWrappedA0GIBase":[198],"Supply":[165]},"id":199,"license":"LGPL-3.0-only","nodeType":"SourceUnit","nodes":[{"id":158,"literals":["solidity",">=","0.8",".0"],"nodeType":"PragmaDirective","src":"42:24:1"},{"canonicalName":"Supply","id":165,"members":[{"constant":false,"id":160,"mutability":"mutable","name":"cap","nameLocation":"96:3:1","nodeType":"VariableDeclaration","scope":165,"src":"88:11:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":159,"name":"uint256","nodeType":"ElementaryTypeName","src":"88:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":162,"mutability":"mutable","name":"initialSupply","nameLocation":"113:13:1","nodeType":"VariableDeclaration","scope":165,"src":"105:21:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":161,"name":"uint256","nodeType":"ElementaryTypeName","src":"105:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"},{"constant":false,"id":164,"mutability":"mutable","name":"supply","nameLocation":"140:6:1","nodeType":"VariableDeclaration","scope":165,"src":"132:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":163,"name":"uint256","nodeType":"ElementaryTypeName","src":"132:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"name":"Supply","nameLocation":"75:6:1","nodeType":"StructDefinition","scope":199,"src":"68:81:1","visibility":"public"},{"abstract":false,"baseContracts":[],"canonicalName":"IWrappedA0GIBase","contractDependencies":[],"contractKind":"interface","documentation":{"id":166,"nodeType":"StructuredDocumentation","src":"151:127:1","text":" @title WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly."},"fullyImplemented":false,"id":198,"linearizedBaseContracts":[198],"name":"IWrappedA0GIBase","nameLocation":"289:16:1","nodeType":"ContractDefinition","nodes":[{"documentation":{"id":167,"nodeType":"StructuredDocumentation","src":"558:46:1","text":" @dev get the wA0GI address."},"functionSelector":"a9283a7a","id":172,"implemented":false,"kind":"function","modifiers":[],"name":"getWA0GI","nameLocation":"618:8:1","nodeType":"FunctionDefinition","parameters":{"id":168,"nodeType":"ParameterList","parameters":[],"src":"626:2:1"},"returnParameters":{"id":171,"nodeType":"ParameterList","parameters":[{"constant":false,"id":170,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":172,"src":"652:7:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":169,"name":"address","nodeType":"ElementaryTypeName","src":"652:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"651:9:1"},"scope":198,"src":"609:52:1","stateMutability":"view","virtual":false,"visibility":"external"},{"documentation":{"id":173,"nodeType":"StructuredDocumentation","src":"1052:96:1","text":" @dev get the mint supply of given address\n @param minter minter address"},"functionSelector":"95609212","id":181,"implemented":false,"kind":"function","modifiers":[],"name":"minterSupply","nameLocation":"1162:12:1","nodeType":"FunctionDefinition","parameters":{"id":176,"nodeType":"ParameterList","parameters":[{"constant":false,"id":175,"mutability":"mutable","name":"minter","nameLocation":"1183:6:1","nodeType":"VariableDeclaration","scope":181,"src":"1175:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":174,"name":"address","nodeType":"ElementaryTypeName","src":"1175:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"}],"src":"1174:16:1"},"returnParameters":{"id":180,"nodeType":"ParameterList","parameters":[{"constant":false,"id":179,"mutability":"mutable","name":"","nameLocation":"-1:-1:-1","nodeType":"VariableDeclaration","scope":181,"src":"1214:13:1","stateVariable":false,"storageLocation":"memory","typeDescriptions":{"typeIdentifier":"t_struct$_Supply_$165_memory_ptr","typeString":"struct Supply"},"typeName":{"id":178,"nodeType":"UserDefinedTypeName","pathNode":{"id":177,"name":"Supply","nameLocations":["1214:6:1"],"nodeType":"IdentifierPath","referencedDeclaration":165,"src":"1214:6:1"},"referencedDeclaration":165,"src":"1214:6:1","typeDescriptions":{"typeIdentifier":"t_struct$_Supply_$165_storage_ptr","typeString":"struct Supply"}},"visibility":"internal"}],"src":"1213:15:1"},"scope":198,"src":"1153:76:1","stateMutability":"view","virtual":false,"visibility":"external"},{"documentation":{"id":182,"nodeType":"StructuredDocumentation","src":"1235:299:1","text":" @dev mint a0gi to this precompile, add corresponding amount to minter's mint supply.\n If sender's final mint supply exceeds its mint cap, the transaction will revert.\n Can only be called by WA0GI.\n @param minter minter address\n @param amount amount to mint"},"functionSelector":"40c10f19","id":189,"implemented":false,"kind":"function","modifiers":[],"name":"mint","nameLocation":"1548:4:1","nodeType":"FunctionDefinition","parameters":{"id":187,"nodeType":"ParameterList","parameters":[{"constant":false,"id":184,"mutability":"mutable","name":"minter","nameLocation":"1561:6:1","nodeType":"VariableDeclaration","scope":189,"src":"1553:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":183,"name":"address","nodeType":"ElementaryTypeName","src":"1553:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":186,"mutability":"mutable","name":"amount","nameLocation":"1577:6:1","nodeType":"VariableDeclaration","scope":189,"src":"1569:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":185,"name":"uint256","nodeType":"ElementaryTypeName","src":"1569:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1552:32:1"},"returnParameters":{"id":188,"nodeType":"ParameterList","parameters":[],"src":"1593:0:1"},"scope":198,"src":"1539:55:1","stateMutability":"nonpayable","virtual":false,"visibility":"external"},{"documentation":{"id":190,"nodeType":"StructuredDocumentation","src":"1600:233:1","text":" @dev burn given amount of a0gi on behalf of minter, reduce corresponding amount from sender's mint supply.\n Can only be called by WA0GI.\n @param minter minter address\n @param amount amount to burn"},"functionSelector":"9dc29fac","id":197,"implemented":false,"kind":"function","modifiers":[],"name":"burn","nameLocation":"1847:4:1","nodeType":"FunctionDefinition","parameters":{"id":195,"nodeType":"ParameterList","parameters":[{"constant":false,"id":192,"mutability":"mutable","name":"minter","nameLocation":"1860:6:1","nodeType":"VariableDeclaration","scope":197,"src":"1852:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"},"typeName":{"id":191,"name":"address","nodeType":"ElementaryTypeName","src":"1852:7:1","stateMutability":"nonpayable","typeDescriptions":{"typeIdentifier":"t_address","typeString":"address"}},"visibility":"internal"},{"constant":false,"id":194,"mutability":"mutable","name":"amount","nameLocation":"1876:6:1","nodeType":"VariableDeclaration","scope":197,"src":"1868:14:1","stateVariable":false,"storageLocation":"default","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"},"typeName":{"id":193,"name":"uint256","nodeType":"ElementaryTypeName","src":"1868:7:1","typeDescriptions":{"typeIdentifier":"t_uint256","typeString":"uint256"}},"visibility":"internal"}],"src":"1851:32:1"},"returnParameters":{"id":196,"nodeType":"ParameterList","parameters":[],"src":"1892:0:1"},"scope":198,"src":"1838:55:1","stateMutability":"nonpayable","virtual":false,"visibility":"external"}],"scope":199,"src":"279:1616:1","usedErrors":[],"usedEvents":[]}],"src":"42:1854:1"},"id":1}},"contracts":{"contracts/IDASigners.sol":{"BN254":{"abi":[],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201bc5ce87162a146d69c64f0bea678aa6b635136c2b5b8de9f9f9621d903e8a3664736f6c63430008140033","opcodes":"PUSH1 0x56 PUSH1 0x37 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x2A JUMPI PUSH4 0x4E487B71 PUSH1 0xE0 SHL PUSH1 0x0 MSTORE PUSH1 0x0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH1 0x0 REVERT JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SHL 0xC5 0xCE DUP8 AND 0x2A EQ PUSH14 0x69C64F0BEA678AA6B635136C2B5B DUP14 0xE9 0xF9 0xF9 PUSH3 0x1D903E DUP11 CALLDATASIZE PUSH5 0x736F6C6343 STOP ADDMOD EQ STOP CALLER ","sourceMap":"68:196:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;68:196:0;;;;;;;;;;;;;;;;;"},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212201bc5ce87162a146d69c64f0bea678aa6b635136c2b5b8de9f9f9621d903e8a3664736f6c63430008140033","opcodes":"PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 SHL 0xC5 0xCE DUP8 AND 0x2A EQ PUSH14 0x69C64F0BEA678AA6B635136C2B5B DUP14 0xE9 0xF9 0xF9 PUSH3 0x1D903E DUP11 CALLDATASIZE PUSH5 0x736F6C6343 STOP ADDMOD EQ STOP CALLER ","sourceMap":"68:196:0:-:0;;;;;;;;"},"methodIdentifiers":{}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IDASigners.sol\":\"BN254\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IDASigners.sol\":{\"keccak256\":\"0xcee17b82796cec7350837b097be51beb97b4b33b53b81c64206533e5027c2e36\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://15963ce1e8afb9c888be8ab6afdbee2e7e7f75e7af34644ad85965d3e97d7aaf\",\"dweb:/ipfs/QmUxw9EqN841nnMxTL5hBKSf8NNBPTxc3gzGXhyApUquDi\"]}},\"version\":1}"},"IDASigners":{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"indexed":false,"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"indexed":false,"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"name":"NewSigner","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"string","name":"socket","type":"string"}],"name":"SocketUpdated","type":"event"},{"inputs":[],"name":"epochNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"},{"internalType":"bytes","name":"_quorumBitmap","type":"bytes"}],"name":"getAggPkG1","outputs":[{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"aggPkG1","type":"tuple"},{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"hit","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"}],"name":"getQuorum","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_quorumId","type":"uint256"},{"internalType":"uint32","name":"_rowIndex","type":"uint32"}],"name":"getQuorumRow","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_account","type":"address[]"}],"name":"getSigner","outputs":[{"components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"string","name":"socket","type":"string"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"internalType":"struct IDASigners.SignerDetail[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isSigner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"params","outputs":[{"components":[{"internalType":"uint256","name":"tokensPerVote","type":"uint256"},{"internalType":"uint256","name":"maxVotesPerSigner","type":"uint256"},{"internalType":"uint256","name":"maxQuorums","type":"uint256"},{"internalType":"uint256","name":"epochBlocks","type":"uint256"},{"internalType":"uint256","name":"encodedSlices","type":"uint256"}],"internalType":"struct IDASigners.Params","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"quorumCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"_signature","type":"tuple"}],"name":"registerNextEpoch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"string","name":"socket","type":"string"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"pkG1","type":"tuple"},{"components":[{"internalType":"uint256[2]","name":"X","type":"uint256[2]"},{"internalType":"uint256[2]","name":"Y","type":"uint256[2]"}],"internalType":"struct BN254.G2Point","name":"pkG2","type":"tuple"}],"internalType":"struct IDASigners.SignerDetail","name":"_signer","type":"tuple"},{"components":[{"internalType":"uint256","name":"X","type":"uint256"},{"internalType":"uint256","name":"Y","type":"uint256"}],"internalType":"struct BN254.G1Point","name":"_signature","type":"tuple"}],"name":"registerSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"registeredEpoch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_socket","type":"string"}],"name":"updateSocket","outputs":[],"stateMutability":"nonpayable","type":"function"}],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"methodIdentifiers":{"epochNumber()":"f4145a83","getAggPkG1(uint256,uint256,bytes)":"50b73739","getQuorum(uint256,uint256)":"6ab6f654","getQuorumRow(uint256,uint256,uint32)":"fa6fcba6","getSigner(address[])":"d1f5e5f8","isSigner(address)":"7df73e27","params()":"cff0ab96","quorumCount(uint256)":"5ecba503","registerNextEpoch((uint256,uint256))":"56a32372","registerSigner((address,string,(uint256,uint256),(uint256[2],uint256[2])),(uint256,uint256))":"7ca4dd5e","registeredEpoch(address,uint256)":"6c9e560c","updateSocket(string)":"0cf4b767"}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"struct IDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"struct IDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"struct BN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"struct IDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"struct BN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IDASigners.sol\":\"IDASigners\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IDASigners.sol\":{\"keccak256\":\"0xcee17b82796cec7350837b097be51beb97b4b33b53b81c64206533e5027c2e36\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://15963ce1e8afb9c888be8ab6afdbee2e7e7f75e7af34644ad85965d3e97d7aaf\",\"dweb:/ipfs/QmUxw9EqN841nnMxTL5hBKSf8NNBPTxc3gzGXhyApUquDi\"]}},\"version\":1}"}},"contracts/IWrappedA0GIBase.sol":{"IWrappedA0GIBase":{"abi":[{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getWA0GI","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"minterSupply","outputs":[{"components":[{"internalType":"uint256","name":"cap","type":"uint256"},{"internalType":"uint256","name":"initialSupply","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"}],"internalType":"struct Supply","name":"","type":"tuple"}],"stateMutability":"view","type":"function"}],"evm":{"bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"deployedBytecode":{"functionDebugData":{},"generatedSources":[],"immutableReferences":{},"linkReferences":{},"object":"","opcodes":"","sourceMap":""},"methodIdentifiers":{"burn(address,uint256)":"9dc29fac","getWA0GI()":"a9283a7a","mint(address,uint256)":"40c10f19","minterSupply(address)":"95609212"}},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWA0GI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"}],\"internalType\":\"struct Supply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"burn(address,uint256)\":{\"details\":\"burn given amount of a0gi on behalf of minter, reduce corresponding amount from sender's mint supply. Can only be called by WA0GI.\",\"params\":{\"amount\":\"amount to burn\",\"minter\":\"minter address\"}},\"getWA0GI()\":{\"details\":\"get the wA0GI address.\"},\"mint(address,uint256)\":{\"details\":\"mint a0gi to this precompile, add corresponding amount to minter's mint supply. If sender's final mint supply exceeds its mint cap, the transaction will revert. Can only be called by WA0GI.\",\"params\":{\"amount\":\"amount to mint\",\"minter\":\"minter address\"}},\"minterSupply(address)\":{\"details\":\"get the mint supply of given address\",\"params\":{\"minter\":\"minter address\"}}},\"title\":\"WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly.\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/IWrappedA0GIBase.sol\":\"IWrappedA0GIBase\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/IWrappedA0GIBase.sol\":{\"keccak256\":\"0xc3d7651403ceec70fc2682ec6760f938a0a712c3a3c541fb0ab4166f9cb99760\",\"license\":\"LGPL-3.0-only\",\"urls\":[\"bzz-raw://7c3d3b6e2b1a928fac7761c30ce495f4f6d379b91eca90826317eda1eb62b544\",\"dweb:/ipfs/QmbNAYMDNv4UBNCZUTk6sDbvVoHn4hwabDAvQxet4g8C1b\"]}},\"version\":1}"}}}}} \ No newline at end of file diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.dbg.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.dbg.json deleted file mode 100644 index 8bad1cfed3..0000000000 --- a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.dbg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/377589efa765dec208356377872d3755.json" -} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.json deleted file mode 100644 index fe3a8cc615..0000000000 --- a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/BN254.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "BN254", - "sourceName": "contracts/IDASigners.sol", - "abi": [], - "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220abc43d74fec9de74f3b7a60ee2e0337c23369163d8fb7a1e1cb0037a16d8abfb64736f6c63430008140033", - "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220abc43d74fec9de74f3b7a60ee2e0337c23369163d8fb7a1e1cb0037a16d8abfb64736f6c63430008140033", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.dbg.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.dbg.json deleted file mode 100644 index 8bad1cfed3..0000000000 --- a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.dbg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/377589efa765dec208356377872d3755.json" -} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.json deleted file mode 100644 index a9a679b4c2..0000000000 --- a/core/vm/precompiles/interfaces/build/artifacts/contracts/IDASigners.sol/IDASigners.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "IDASigners", - "sourceName": "contracts/IDASigners.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "signer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "X", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "Y", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct BN254.G1Point", - "name": "pkG1", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "X", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2]", - "name": "Y", - "type": "uint256[2]" - } - ], - "indexed": false, - "internalType": "struct BN254.G2Point", - "name": "pkG2", - "type": "tuple" - } - ], - "name": "NewSigner", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "signer", - "type": "address" - }, - { - "indexed": false, - "internalType": "string", - "name": "socket", - "type": "string" - } - ], - "name": "SocketUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "epochNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_quorumId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "_quorumBitmap", - "type": "bytes" - } - ], - "name": "getAggPkG1", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "X", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "Y", - "type": "uint256" - } - ], - "internalType": "struct BN254.G1Point", - "name": "aggPkG1", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "total", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "hit", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_quorumId", - "type": "uint256" - } - ], - "name": "getQuorum", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_quorumId", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "_rowIndex", - "type": "uint32" - } - ], - "name": "getQuorumRow", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_account", - "type": "address[]" - } - ], - "name": "getSigner", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - }, - { - "internalType": "string", - "name": "socket", - "type": "string" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "X", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "Y", - "type": "uint256" - } - ], - "internalType": "struct BN254.G1Point", - "name": "pkG1", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "X", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2]", - "name": "Y", - "type": "uint256[2]" - } - ], - "internalType": "struct BN254.G2Point", - "name": "pkG2", - "type": "tuple" - } - ], - "internalType": "struct IDASigners.SignerDetail[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - } - ], - "name": "isSigner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "makeEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "params", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "tokensPerVote", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxVotesPerSigner", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxQuorums", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "epochBlocks", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "encodedSlices", - "type": "uint256" - } - ], - "internalType": "struct IDASigners.Params", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - } - ], - "name": "quorumCount", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "X", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "Y", - "type": "uint256" - } - ], - "internalType": "struct BN254.G1Point", - "name": "_signature", - "type": "tuple" - } - ], - "name": "registerNextEpoch", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - }, - { - "internalType": "string", - "name": "socket", - "type": "string" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "X", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "Y", - "type": "uint256" - } - ], - "internalType": "struct BN254.G1Point", - "name": "pkG1", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "X", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2]", - "name": "Y", - "type": "uint256[2]" - } - ], - "internalType": "struct BN254.G2Point", - "name": "pkG2", - "type": "tuple" - } - ], - "internalType": "struct IDASigners.SignerDetail", - "name": "_signer", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "X", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "Y", - "type": "uint256" - } - ], - "internalType": "struct BN254.G1Point", - "name": "_signature", - "type": "tuple" - } - ], - "name": "registerSigner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_epoch", - "type": "uint256" - } - ], - "name": "registeredEpoch", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_socket", - "type": "string" - } - ], - "name": "updateSocket", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.dbg.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.dbg.json deleted file mode 100644 index a79d40a1dd..0000000000 --- a/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.dbg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/c79ff14473359160d0c7a65892d5cb52.json" -} diff --git a/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.json b/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.json deleted file mode 100644 index ff537b54ae..0000000000 --- a/core/vm/precompiles/interfaces/build/artifacts/contracts/IWrappedA0GIBase.sol/IWrappedA0GIBase.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "IWrappedA0GIBase", - "sourceName": "contracts/IWrappedA0GIBase.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "minter", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getWA0GI", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "minter", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "minterSupply", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "cap", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialSupply", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "supply", - "type": "uint256" - } - ], - "internalType": "struct Supply", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x", - "deployedBytecode": "0x", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/core/vm/precompiles/interfaces/build/cache/solidity-files-cache.json b/core/vm/precompiles/interfaces/build/cache/solidity-files-cache.json deleted file mode 100644 index 23fa861825..0000000000 --- a/core/vm/precompiles/interfaces/build/cache/solidity-files-cache.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_format": "hh-sol-cache-2", - "files": { - "/Users/wangfan/Project/0g-geth/core/vm/precompiles/interfaces/contracts/IDASigners.sol": { - "lastModificationDate": 1743021984706, - "contentHash": "dbe903452c6de71caa950fdb306027b3", - "sourceName": "contracts/IDASigners.sol", - "solcConfig": { - "version": "0.8.20", - "settings": { - "evmVersion": "istanbul", - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": [ - "ast" - ] - } - } - } - }, - "imports": [], - "versionPragmas": [ - ">=0.8.0" - ], - "artifacts": [ - "BN254", - "IDASigners" - ] - }, - "/Users/wangfan/Project/0g-geth/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol": { - "lastModificationDate": 1743006728499, - "contentHash": "1d44f536ff2a527d2afe8a4ef85adc7b", - "sourceName": "contracts/IWrappedA0GIBase.sol", - "solcConfig": { - "version": "0.8.20", - "settings": { - "evmVersion": "istanbul", - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata" - ], - "": [ - "ast" - ] - } - } - } - }, - "imports": [], - "versionPragmas": [ - ">=0.8.0" - ], - "artifacts": [ - "IWrappedA0GIBase" - ] - } - } -} diff --git a/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol b/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol index 614208a801..b0dbb709df 100644 --- a/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol +++ b/core/vm/precompiles/interfaces/contracts/IWrappedA0GIBase.sol @@ -54,4 +54,17 @@ interface IWrappedA0GIBase { * @param amount amount to burn */ function burn(address minter, uint256 amount) external; + + /** + * @dev Modify the mint and burn cap of given account. + * Can only be called by multi-sig admin. + * @param minter minter address + * @param cap new mint cap + * @param initialSupply new initial supply / burn cap + */ + function setMinterCap( + address minter, + uint256 cap, + uint256 initialSupply + ) external; } diff --git a/core/vm/precompiles/wrapped_a0gi_base/contract.go b/core/vm/precompiles/wrapped_a0gi_base/contract.go index 176842bd3d..54763e8f5f 100644 --- a/core/vm/precompiles/wrapped_a0gi_base/contract.go +++ b/core/vm/precompiles/wrapped_a0gi_base/contract.go @@ -37,7 +37,7 @@ type Supply struct { // Wrappeda0gibaseMetaData contains all meta data concerning the Wrappeda0gibase contract. var Wrappeda0gibaseMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWA0GI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"}],\"internalType\":\"structSupply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWA0GI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"}],\"internalType\":\"structSupply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"}],\"name\":\"setMinterCap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // Wrappeda0gibaseABI is the input ABI used to generate the binding from. @@ -289,3 +289,24 @@ func (_Wrappeda0gibase *Wrappeda0gibaseSession) Mint(minter common.Address, amou func (_Wrappeda0gibase *Wrappeda0gibaseTransactorSession) Mint(minter common.Address, amount *big.Int) (*types.Transaction, error) { return _Wrappeda0gibase.Contract.Mint(&_Wrappeda0gibase.TransactOpts, minter, amount) } + +// SetMinterCap is a paid mutator transaction binding the contract method 0xdddba6c8. +// +// Solidity: function setMinterCap(address minter, uint256 cap, uint256 initialSupply) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactor) SetMinterCap(opts *bind.TransactOpts, minter common.Address, cap *big.Int, initialSupply *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.contract.Transact(opts, "setMinterCap", minter, cap, initialSupply) +} + +// SetMinterCap is a paid mutator transaction binding the contract method 0xdddba6c8. +// +// Solidity: function setMinterCap(address minter, uint256 cap, uint256 initialSupply) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseSession) SetMinterCap(minter common.Address, cap *big.Int, initialSupply *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.SetMinterCap(&_Wrappeda0gibase.TransactOpts, minter, cap, initialSupply) +} + +// SetMinterCap is a paid mutator transaction binding the contract method 0xdddba6c8. +// +// Solidity: function setMinterCap(address minter, uint256 cap, uint256 initialSupply) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorSession) SetMinterCap(minter common.Address, cap *big.Int, initialSupply *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.SetMinterCap(&_Wrappeda0gibase.TransactOpts, minter, cap, initialSupply) +} diff --git a/core/vm/precompiles/wrapped_a0gi_base/errors.go b/core/vm/precompiles/wrapped_a0gi_base/errors.go index 833d92e157..2b1e0e37e4 100644 --- a/core/vm/precompiles/wrapped_a0gi_base/errors.go +++ b/core/vm/precompiles/wrapped_a0gi_base/errors.go @@ -4,6 +4,7 @@ import "errors" var ( ErrSenderNotWA0GI = errors.New("sender is not WA0GI") + ErrSenderNotAgency = errors.New("sender is not agency") ErrInsufficientMintCap = errors.New("insufficient mint cap") ErrInsufficientMintSupply = errors.New("insufficient mint supply") ) diff --git a/core/vm/wrapped_a0gi_base.go b/core/vm/wrapped_a0gi_base.go index ed4f124617..3af1a44026 100644 --- a/core/vm/wrapped_a0gi_base.go +++ b/core/vm/wrapped_a0gi_base.go @@ -16,8 +16,9 @@ const ( WrappedA0GIBaseRequiredGasMax uint64 = 1000_000_000 // txs - WrappedA0GIBaseFunctionMint = "mint" - WrappedA0GIBaseFunctionBurn = "burn" + WrappedA0GIBaseFunctionMint = "mint" + WrappedA0GIBaseFunctionBurn = "burn" + WrappedA0GIBaseFunctionSetMinterCap = "setMinterCap" // queries WrappedA0GIBaseFunctionGetWA0GI = "getWA0GI" WrappedA0GIBaseFunctionMinterSupply = "minterSupply" @@ -26,6 +27,7 @@ const ( var WrappedA0GIBaseRequiredGasBasic = map[string]uint64{ WrappedA0GIBaseFunctionMint: 100_000, WrappedA0GIBaseFunctionBurn: 100_000, + WrappedA0GIBaseFunctionSetMinterCap: 100_000, WrappedA0GIBaseFunctionGetWA0GI: 5_000, WrappedA0GIBaseFunctionMinterSupply: 10_000, } @@ -97,6 +99,8 @@ func (w *WrappedA0giBasePrecompile) Run(evm *EVM, contract *Contract, readonly b bz, err = w.Mint(evm, contract, method, args) case WrappedA0GIBaseFunctionBurn: bz, err = w.Burn(evm, contract, method, args) + case WrappedA0GIBaseFunctionSetMinterCap: + bz, err = w.SetMinterCap(evm, contract, method, args) } if err != nil { @@ -235,3 +239,53 @@ func (w *WrappedA0giBasePrecompile) Burn( } return method.Outputs.Pack() } + +func (w *WrappedA0giBasePrecompile) getAgency() common.Address { + // This is a Wrapped A0GI Agency contract deployed by a raw transaction: + // raw tx params: + // from: + // nonce: 0 + // gasPrice: 100 Gwei + // gasLimit: 1000000 + // The sender is an ephemeral account, nobody holds its private key and this is the only transaction it signed. + // This transaction is a legacy transaction without chain ID so it can be deployed at any EVM chain which supports pre-EIP155 transactions. + // raw tx: + return common.HexToAddress("0x0000000000000000000000000000000000000000") +} + +func (w *WrappedA0giBasePrecompile) SetMinterCap( + evm *EVM, + contract *Contract, + method *abi.Method, + args []interface{}, +) ([]byte, error) { + if len(args) != 3 { + return nil, ErrExecutionReverted + } + minter := args[0].(common.Address) + cap := args[1].(*big.Int) + initialSupply := args[2].(*big.Int) + // validation + agency := w.getAgency() + if contract.caller != agency { + return nil, wrappeda0gibase.ErrSenderNotWA0GI + } + // execute + supply, err := w.getMinterSupply(evm, minter) + if err != nil { + return nil, err + } + difference := new(big.Int).Sub(initialSupply, supply.InitialSupply) + supply.Supply.Add(supply.Supply, difference) + if supply.Supply.Cmp(big.NewInt(0)) < 0 { + supply.Supply = big.NewInt(0) + } + supply.Cap = cap + supply.InitialSupply = initialSupply + + // update minter supply + if err = w.setMinterSupply(evm, minter, supply); err != nil { + return nil, err + } + return method.Outputs.Pack() +} From 8b9df8dd26d34d5f84438e0cf697c301a94c5bfa Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Thu, 3 Apr 2025 15:59:17 +0800 Subject: [PATCH 06/11] feat: register custom precompiles --- core/vm/contracts.go | 11 +++++++++-- core/vm/contracts_test.go | 1 + core/vm/dasigners.go | 6 +++--- core/vm/wrapped_a0gi_base.go | 6 +++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 3d414e8206..3ee7f4a0cf 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -53,7 +53,10 @@ type PrecompiledContract interface { // PrecompiledContracts contains the precompiled contracts supported at the given fork. type PrecompiledContracts map[common.Address]PrecompiledContract -var CustomPrecompiledContracts = PrecompiledContracts{} +var CustomPrecompiledContracts = PrecompiledContracts{ + (&DASignersPrecompile{}).Address(): NewDASignersPrecompile(), + (&WrappedA0giBasePrecompile{}).Address(): NewWrappedA0giBasePrecompile(), +} // WithCustomPrecompiles merge given precompiles with custom precompiles func WithCustomPrecompiles(base PrecompiledContracts) PrecompiledContracts { @@ -287,7 +290,11 @@ func RunPrecompiledContract( inputCopy := make([]byte, len(input)) copy(inputCopy, input) - contract := NewContract(caller, p.Address(), value, suppliedGas, evm.jumpDests) + var jumpDests map[common.Hash]bitvec + if evm != nil { + jumpDests = evm.jumpDests + } + contract := NewContract(caller, p.Address(), value, suppliedGas, jumpDests) contract.Input = inputCopy gasCost := p.RequiredGas(input) diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index 69957783c5..3876241bf1 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -274,6 +274,7 @@ func TestPrecompileBlake2FMalformedInput(t *testing.T) { func TestPrecompiledEcrecover(t *testing.T) { testJson("ecRecover", "01", t) } func testJson(name, addr string, t *testing.T) { + fmt.Printf("name: %v, addr: %v\n", name, addr) tests, err := loadJson(name) if err != nil { t.Fatal(err) diff --git a/core/vm/dasigners.go b/core/vm/dasigners.go index 8423c4def0..7c6a0c332a 100644 --- a/core/vm/dasigners.go +++ b/core/vm/dasigners.go @@ -62,14 +62,14 @@ type DASignersPrecompile struct { abi abi.ABI } -func NewDASignersPrecompile() (*DASignersPrecompile, error) { +func NewDASignersPrecompile() *DASignersPrecompile { abi, err := abi.JSON(strings.NewReader(dasigners.DASignersABI)) if err != nil { - return nil, err + panic(err) } return &DASignersPrecompile{ abi: abi, - }, nil + } } // Address implements vm.PrecompiledContract. diff --git a/core/vm/wrapped_a0gi_base.go b/core/vm/wrapped_a0gi_base.go index 3af1a44026..685b0c1e47 100644 --- a/core/vm/wrapped_a0gi_base.go +++ b/core/vm/wrapped_a0gi_base.go @@ -70,14 +70,14 @@ func (w *WrappedA0giBasePrecompile) RequiredGas(input []byte) uint64 { return WrappedA0GIBaseRequiredGasMax } -func NewWrappedA0giBasePrecompile() (*WrappedA0giBasePrecompile, error) { +func NewWrappedA0giBasePrecompile() *WrappedA0giBasePrecompile { abi, err := abi.JSON(strings.NewReader(wrappeda0gibase.Wrappeda0gibaseABI)) if err != nil { - return nil, err + panic(err) } return &WrappedA0giBasePrecompile{ abi: abi, - }, nil + } } // Run implements vm.PrecompiledContract. From 66d166d59b44175a2bb9680743df5a5f22f9b679 Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Thu, 3 Apr 2025 19:21:44 +0800 Subject: [PATCH 07/11] fix: dasigners; add UT --- core/vm/contracts.go | 6 + core/vm/contracts_test.go | 1 - core/vm/dasigners.go | 5 +- core/vm/dasigners_test.go | 371 ++++++++++++++++++ core/vm/precompiles/dasigners/contract.go | 29 -- core/vm/precompiles/dasigners/types.go | 27 +- .../precompiles/wrapped_a0gi_base/contract.go | 7 - .../vm/precompiles/wrapped_a0gi_base/types.go | 8 + 8 files changed, 414 insertions(+), 40 deletions(-) create mode 100644 core/vm/dasigners_test.go diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 3ee7f4a0cf..ba414cbc11 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -17,6 +17,7 @@ package vm import ( + "bytes" "crypto/sha256" "encoding/binary" "errors" @@ -32,6 +33,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/tracing" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/blake2b" "github.com/ethereum/go-ethereum/crypto/bn256" @@ -105,6 +107,10 @@ func InitializeStatefulPrecompileCall( if readonly && p.IsTx(method.Name) { return nil, nil, ErrExecutionReverted } + // Set code to a non-empty value to prevent it from being cleared by stateDB during commit() or finalise() + if !readonly && bytes.Equal(crypto.Keccak256Hash(evm.StateDB.GetCode(p.Address())).Bytes(), types.EmptyCodeHash.Bytes()) { + evm.StateDB.SetCode(p.Address(), []byte{1}) + } return method, args, nil } diff --git a/core/vm/contracts_test.go b/core/vm/contracts_test.go index 3876241bf1..69957783c5 100644 --- a/core/vm/contracts_test.go +++ b/core/vm/contracts_test.go @@ -274,7 +274,6 @@ func TestPrecompileBlake2FMalformedInput(t *testing.T) { func TestPrecompiledEcrecover(t *testing.T) { testJson("ecRecover", "01", t) } func testJson(name, addr string, t *testing.T) { - fmt.Printf("name: %v, addr: %v\n", name, addr) tests, err := loadJson(name) if err != nil { t.Fatal(err) diff --git a/core/vm/dasigners.go b/core/vm/dasigners.go index 7c6a0c332a..a8a443b666 100644 --- a/core/vm/dasigners.go +++ b/core/vm/dasigners.go @@ -271,8 +271,9 @@ func (d *DASignersPrecompile) MakeEpoch( if err != nil { return nil, err } - StoreBytes(evm.StateDB, d.Address(), dasigners.QuorumKey(epoch+1, uint64(index)), b) + StoreBytes(evm.StateDB, d.Address(), dasigners.QuorumKey(epoch, uint64(index)), b) } + evm.StateDB.SetState(d.Address(), dasigners.QuorumCountKey(epoch), common.BigToHash(big.NewInt(int64(len(quorums))))) // save epoch number & block height evm.StateDB.SetState(d.Address(), dasigners.EpochNumberKey(), common.BigToHash(big.NewInt(int64(epoch)))) evm.StateDB.SetState(d.Address(), dasigners.EpochBlockKey(epoch), common.BigToHash(big.NewInt(int64(blockHeight)))) @@ -481,7 +482,7 @@ func (d *DASignersPrecompile) getSigner(evm *EVM, account common.Address) (dasig if err != nil { return dasigners.IDASignersSignerDetail{}, false, err } - return signer, false, nil + return signer, true, nil } func (d *DASignersPrecompile) GetSigner(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { diff --git a/core/vm/dasigners_test.go b/core/vm/dasigners_test.go new file mode 100644 index 0000000000..4c973ad265 --- /dev/null +++ b/core/vm/dasigners_test.go @@ -0,0 +1,371 @@ +package vm + +import ( + "fmt" + "math/big" + "testing" + + "github.com/consensys/gnark-crypto/ecc/bn254" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/bn254util" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm/precompiles/dasigners" + "github.com/ethereum/go-ethereum/params" + "github.com/holiman/uint256" + "github.com/stretchr/testify/suite" +) + +type DASignersTestSuite struct { + suite.Suite + + abi abi.ABI + statedb *state.StateDB + evm *EVM + dasigners *DASignersPrecompile + signerOne common.Address + signerTwo common.Address +} + +func (suite *DASignersTestSuite) SetupTest() { + suite.dasigners = NewDASignersPrecompile() + suite.abi = suite.dasigners.abi + + statedb, _ := state.New(types.EmptyRootHash, state.NewDatabaseForTesting()) + suite.statedb = statedb + suite.evm = NewEVM(BlockContext{ + BlockNumber: big.NewInt(1), + }, statedb, params.TestChainConfig, Config{}) + suite.signerOne = common.HexToAddress("0x0000000000000000000000000000000100000000") + suite.signerTwo = common.HexToAddress("0x0000000000000000000000000000000100000001") +} + +func (suite *DASignersTestSuite) runTx(input []byte, signer common.Address, gas uint64, value *uint256.Int, readonly bool) ([]byte, error) { + suite.evm.Origin = signer + bz, _, err := RunPrecompiledContract(suite.evm, suite.dasigners, signer, input, gas, value, readonly, nil) + if err == nil { + suite.statedb.Finalise(true) + suite.statedb.Commit(suite.evm.Context.BlockNumber.Uint64(), true, false) + } + return bz, err +} + +func (suite *DASignersTestSuite) registerSigner(testSigner common.Address, sk *big.Int) *dasigners.IDASignersSignerDetail { + pkG1 := new(bn254.G1Affine).ScalarMultiplication(bn254util.GetG1Generator(), sk) + pkG2 := new(bn254.G2Affine).ScalarMultiplication(bn254util.GetG2Generator(), sk) + hash := dasigners.PubkeyRegistrationHash(testSigner, suite.evm.chainConfig.ChainID) + signature := new(bn254.G1Affine).ScalarMultiplication(hash, sk) + signer := dasigners.IDASignersSignerDetail{ + Signer: testSigner, + Socket: "0.0.0.0:1234", + PkG1: dasigners.NewBN254G1Point(bn254util.SerializeG1(pkG1)), + PkG2: dasigners.NewBN254G2Point(bn254util.SerializeG2(pkG2)), + } + input, err := suite.abi.Pack( + "registerSigner", + signer, + dasigners.NewBN254G1Point(bn254util.SerializeG1(signature)), + ) + suite.Assert().NoError(err) + + oldLogs := suite.statedb.Logs() + _, err = suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), false) + suite.Assert().NoError(err) + logs := suite.statedb.Logs() + suite.Assert().EqualValues(len(logs), len(oldLogs)+2) + + _, err = suite.abi.Unpack("SocketUpdated", logs[len(logs)-1].Data) + suite.Assert().NoError(err) + _, err = suite.abi.Unpack("NewSigner", logs[len(logs)-2].Data) + suite.Assert().NoError(err) + return &signer +} + +func (suite *DASignersTestSuite) makeEpoch(testSigner common.Address) { + input, err := suite.abi.Pack( + "makeEpoch", + ) + suite.Assert().NoError(err) + + _, err = suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), false) + suite.Assert().NoError(err) +} + +func (suite *DASignersTestSuite) updateSocket(testSigner common.Address, signer *dasigners.IDASignersSignerDetail) { + input, err := suite.abi.Pack( + "updateSocket", + "0.0.0.0:2345", + ) + suite.Assert().NoError(err) + + oldLogs := suite.statedb.Logs() + _, err = suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), false) + suite.Assert().NoError(err) + logs := suite.statedb.Logs() + suite.Assert().EqualValues(len(logs), len(oldLogs)+1) + + _, err = suite.abi.Unpack("SocketUpdated", logs[len(logs)-1].Data) + suite.Assert().NoError(err) + + signer.Socket = "0.0.0.0:2345" +} + +func (suite *DASignersTestSuite) registerEpoch(testSigner common.Address, sk *big.Int) { + epoch := suite.dasigners.epochNumber(suite.evm) + 1 + hash := dasigners.EpochRegistrationHash(testSigner, epoch, suite.evm.chainConfig.ChainID) + signature := new(bn254.G1Affine).ScalarMultiplication(hash, sk) + + input, err := suite.abi.Pack( + "registerNextEpoch", + dasigners.NewBN254G1Point(bn254util.SerializeG1(signature)), + ) + suite.Assert().NoError(err) + + _, err = suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), false) + suite.Assert().NoError(err) +} + +func (suite *DASignersTestSuite) queryEpochNumber(testSigner common.Address, expected *big.Int) { + input, err := suite.abi.Pack( + "epochNumber", + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), true) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["epochNumber"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + suite.Assert().EqualValues(out[0].(*big.Int).Uint64(), expected.Uint64()) +} + +func (suite *DASignersTestSuite) queryQuorumCount(testSigner common.Address) { + epoch := suite.dasigners.epochNumber(suite.evm) + input, err := suite.abi.Pack( + "quorumCount", + big.NewInt(int64(epoch)), + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), true) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["quorumCount"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + suite.Assert().EqualValues(out[0], big.NewInt(1)) +} + +func (suite *DASignersTestSuite) queryGetSigner(testSigner common.Address, answer []dasigners.IDASignersSignerDetail) { + input, err := suite.abi.Pack( + "getSigner", + []common.Address{suite.signerOne, suite.signerTwo}, + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), true) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["getSigner"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + suite.Assert().EqualValues(out[0], answer) +} + +func (suite *DASignersTestSuite) queryIsSigner(testSigner common.Address) { + input, err := suite.abi.Pack( + "isSigner", + suite.signerOne, + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), true) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["isSigner"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + suite.Assert().EqualValues(out[0], true) +} + +func (suite *DASignersTestSuite) queryRegisteredEpoch(testSigner common.Address, account common.Address, epoch *big.Int) bool { + input, err := suite.abi.Pack( + "registeredEpoch", + account, + epoch, + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), true) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["registeredEpoch"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + return out[0].(bool) +} + +func (suite *DASignersTestSuite) queryGetQuorum(testSigner common.Address) []common.Address { + epoch := suite.dasigners.epochNumber(suite.evm) + input, err := suite.abi.Pack( + "getQuorum", + big.NewInt(int64(epoch)), + big.NewInt(0), + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), true) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["getQuorum"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + return out[0].([]common.Address) +} + +func (suite *DASignersTestSuite) queryGetQuorumRow(testSigner common.Address, row uint32) common.Address { + epoch := suite.dasigners.epochNumber(suite.evm) + input, err := suite.abi.Pack( + "getQuorumRow", + big.NewInt(int64(epoch)), + big.NewInt(0), + row, + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), true) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["getQuorumRow"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + return out[0].(common.Address) +} + +func (suite *DASignersTestSuite) queryGetAggPkG1(testSigner common.Address, bitmap []byte) struct { + AggPkG1 dasigners.BN254G1Point + Total *big.Int + Hit *big.Int +} { + epoch := suite.dasigners.epochNumber(suite.evm) + input, err := suite.abi.Pack( + "getAggPkG1", + big.NewInt(int64(epoch)), + big.NewInt(0), + bitmap, + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), true) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["getAggPkG1"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + return struct { + AggPkG1 dasigners.BN254G1Point + Total *big.Int + Hit *big.Int + }{ + AggPkG1: out[0].(dasigners.BN254G1Point), + Total: out[1].(*big.Int), + Hit: out[2].(*big.Int), + } +} + +func (suite *DASignersTestSuite) Test_DASigners() { + // tx test + fmt.Println("registering signer 1..") + signer1 := suite.registerSigner(suite.signerOne, big.NewInt(1)) + fmt.Println("registering signer 2..") + signer2 := suite.registerSigner(suite.signerTwo, big.NewInt(11)) + fmt.Println("signers registered..") + suite.updateSocket(suite.signerOne, signer1) + suite.updateSocket(suite.signerTwo, signer2) + suite.registerEpoch(suite.signerOne, big.NewInt(1)) + suite.registerEpoch(suite.signerTwo, big.NewInt(11)) + // move to next epochs + daparams := suite.dasigners.params() + suite.queryEpochNumber(suite.signerOne, big.NewInt(0)) + // move to epoch 1 & register + suite.makeEpoch(suite.signerOne) + suite.queryEpochNumber(suite.signerOne, big.NewInt(1)) + suite.makeEpoch(suite.signerOne) + suite.queryEpochNumber(suite.signerOne, big.NewInt(1)) + suite.registerEpoch(suite.signerOne, big.NewInt(1)) + suite.registerEpoch(suite.signerTwo, big.NewInt(11)) + // move to epoch 2 + suite.evm.Context.BlockNumber = suite.evm.Context.BlockNumber.Add(suite.evm.Context.BlockNumber, daparams.EpochBlocks) + suite.makeEpoch(suite.signerOne) + suite.queryEpochNumber(suite.signerOne, big.NewInt(2)) + // query test + suite.queryQuorumCount(suite.signerOne) + suite.queryGetSigner(suite.signerOne, []dasigners.IDASignersSignerDetail{*signer1, *signer2}) + suite.queryIsSigner(suite.signerOne) + suite.Assert().EqualValues(suite.queryRegisteredEpoch(suite.signerOne, suite.signerOne, big.NewInt(0)), false) + suite.Assert().EqualValues(suite.queryRegisteredEpoch(suite.signerOne, suite.signerTwo, big.NewInt(0)), false) + suite.Assert().EqualValues(suite.queryRegisteredEpoch(suite.signerOne, suite.signerOne, big.NewInt(1)), true) + suite.Assert().EqualValues(suite.queryRegisteredEpoch(suite.signerOne, suite.signerTwo, big.NewInt(1)), true) + suite.Assert().EqualValues(suite.queryRegisteredEpoch(suite.signerOne, suite.signerOne, big.NewInt(2)), true) + suite.Assert().EqualValues(suite.queryRegisteredEpoch(suite.signerOne, suite.signerTwo, big.NewInt(2)), true) + suite.Assert().EqualValues(suite.queryRegisteredEpoch(suite.signerOne, suite.signerOne, big.NewInt(3)), false) + suite.Assert().EqualValues(suite.queryRegisteredEpoch(suite.signerOne, suite.signerTwo, big.NewInt(3)), false) + + quorum := suite.queryGetQuorum(suite.signerOne) + suite.Assert().EqualValues(len(quorum), daparams.EncodedSlices.Int64()) + cnt := map[common.Address]int{suite.signerOne: 0, suite.signerTwo: 0} + onePos := len(quorum) + twoPos := len(quorum) + for i, v := range quorum { + suite.Assert().EqualValues(suite.queryGetQuorumRow(suite.signerOne, uint32(i)), v) + cnt[v] += 1 + if v == suite.signerOne { + onePos = min(onePos, i) + } else { + twoPos = min(twoPos, i) + } + } + suite.Assert().EqualValues(cnt[suite.signerOne], len(quorum)/2) + suite.Assert().EqualValues(cnt[suite.signerTwo], len(quorum)/2) + // suite.Assert().EqualValues(cnt[suite.signerOne], len(quorum)/3) + // suite.Assert().EqualValues(cnt[suite.signerTwo], len(quorum)*2/3) + + bitMap := make([]byte, len(quorum)/8) + bitMap[onePos/8] |= 1 << (onePos % 8) + suite.Assert().EqualValues(suite.queryGetAggPkG1(suite.signerOne, bitMap), struct { + AggPkG1 dasigners.BN254G1Point + Total *big.Int + Hit *big.Int + }{ + AggPkG1: dasigners.NewBN254G1Point(bn254util.SerializeG1(new(bn254.G1Affine).ScalarMultiplication(bn254util.GetG1Generator(), big.NewInt(1)))), + Total: big.NewInt(int64(len(quorum))), + Hit: big.NewInt(int64(len(quorum) / 2)), + // Hit: big.NewInt(int64(len(quorum) / 3)), + }) + + bitMap[twoPos/8] |= 1 << (twoPos % 8) + suite.Assert().EqualValues(suite.queryGetAggPkG1(suite.signerOne, bitMap), struct { + AggPkG1 dasigners.BN254G1Point + Total *big.Int + Hit *big.Int + }{ + AggPkG1: dasigners.NewBN254G1Point(bn254util.SerializeG1(new(bn254.G1Affine).ScalarMultiplication(bn254util.GetG1Generator(), big.NewInt(1+11)))), + Total: big.NewInt(int64(len(quorum))), + Hit: big.NewInt(int64(len(quorum))), + }) + +} + +func (suite *DASignersTestSuite) getParams() dasigners.IDASignersParams { + input, err := suite.abi.Pack( + "params", + ) + suite.Assert().NoError(err) + + bz, err := suite.runTx(input, suite.signerOne, 10000000, uint256.NewInt(0), false) + suite.Assert().NoError(err) + out, err := suite.abi.Methods["params"].Outputs.Unpack(bz) + suite.Assert().NoError(err) + params := out[0].(dasigners.IDASignersParams) + return params +} + +func (suite *DASignersTestSuite) Test_Params() { + daParams := suite.getParams() + expected := suite.dasigners.params() + suite.Assert().EqualValues(expected.TokensPerVote, daParams.TokensPerVote) + suite.Assert().EqualValues(expected.MaxVotesPerSigner, daParams.MaxVotesPerSigner) + suite.Assert().EqualValues(expected.MaxQuorums, daParams.MaxQuorums) + suite.Assert().EqualValues(expected.EpochBlocks, daParams.EpochBlocks) + suite.Assert().EqualValues(expected.EncodedSlices, daParams.EncodedSlices) +} + +func TestKeeperSuite(t *testing.T) { + suite.Run(t, new(DASignersTestSuite)) +} diff --git a/core/vm/precompiles/dasigners/contract.go b/core/vm/precompiles/dasigners/contract.go index 5b01731c38..268c11d70c 100644 --- a/core/vm/precompiles/dasigners/contract.go +++ b/core/vm/precompiles/dasigners/contract.go @@ -28,35 +28,6 @@ var ( _ = event.NewSubscription ) -// BN254G1Point is an auto generated low-level Go binding around an user-defined struct. -type BN254G1Point struct { - X *big.Int - Y *big.Int -} - -// BN254G2Point is an auto generated low-level Go binding around an user-defined struct. -type BN254G2Point struct { - X [2]*big.Int - Y [2]*big.Int -} - -// IDASignersParams is an auto generated low-level Go binding around an user-defined struct. -type IDASignersParams struct { - TokensPerVote *big.Int - MaxVotesPerSigner *big.Int - MaxQuorums *big.Int - EpochBlocks *big.Int - EncodedSlices *big.Int -} - -// IDASignersSignerDetail is an auto generated low-level Go binding around an user-defined struct. -type IDASignersSignerDetail struct { - Signer common.Address - Socket string - PkG1 BN254G1Point - PkG2 BN254G2Point -} - // DASignersMetaData contains all meta data concerning the DASigners contract. var DASignersMetaData = &bind.MetaData{ ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"makeEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"structIDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", diff --git a/core/vm/precompiles/dasigners/types.go b/core/vm/precompiles/dasigners/types.go index de4af31b92..7d76a6e05c 100644 --- a/core/vm/precompiles/dasigners/types.go +++ b/core/vm/precompiles/dasigners/types.go @@ -7,6 +7,31 @@ import ( "github.com/ethereum/go-ethereum/crypto" ) +type BN254G1Point = struct { + X *big.Int "json:\"X\"" + Y *big.Int "json:\"Y\"" +} + +type BN254G2Point = struct { + X [2]*big.Int "json:\"X\"" + Y [2]*big.Int "json:\"Y\"" +} + +type IDASignersSignerDetail = struct { + Signer common.Address "json:\"signer\"" + Socket string "json:\"socket\"" + PkG1 BN254G1Point "json:\"pkG1\"" + PkG2 BN254G2Point "json:\"pkG2\"" +} + +type IDASignersParams = struct { + TokensPerVote *big.Int "json:\"tokensPerVote\"" + MaxVotesPerSigner *big.Int "json:\"maxVotesPerSigner\"" + MaxQuorums *big.Int "json:\"maxQuorums\"" + EpochBlocks *big.Int "json:\"epochBlocks\"" + EncodedSlices *big.Int "json:\"encodedSlices\"" +} + func NewBN254G1Point(b []byte) BN254G1Point { return BN254G1Point{ X: new(big.Int).SetBytes(b[:32]), @@ -55,7 +80,7 @@ var ( ) func SignerKey(account common.Address) common.Hash { - return crypto.Keccak256Hash(append(quorumCountKey, account.Bytes()...)) + return crypto.Keccak256Hash(append(signerKey, account.Bytes()...)) } func QuorumKey(epochNumber uint64, quorumId uint64) common.Hash { diff --git a/core/vm/precompiles/wrapped_a0gi_base/contract.go b/core/vm/precompiles/wrapped_a0gi_base/contract.go index 54763e8f5f..d0f3e10cf1 100644 --- a/core/vm/precompiles/wrapped_a0gi_base/contract.go +++ b/core/vm/precompiles/wrapped_a0gi_base/contract.go @@ -28,13 +28,6 @@ var ( _ = event.NewSubscription ) -// Supply is an auto generated low-level Go binding around an user-defined struct. -type Supply struct { - Cap *big.Int - InitialSupply *big.Int - Supply *big.Int -} - // Wrappeda0gibaseMetaData contains all meta data concerning the Wrappeda0gibase contract. var Wrappeda0gibaseMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWA0GI\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"supply\",\"type\":\"uint256\"}],\"internalType\":\"structSupply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"initialSupply\",\"type\":\"uint256\"}],\"name\":\"setMinterCap\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", diff --git a/core/vm/precompiles/wrapped_a0gi_base/types.go b/core/vm/precompiles/wrapped_a0gi_base/types.go index f49a84696f..3e2d054dbf 100644 --- a/core/vm/precompiles/wrapped_a0gi_base/types.go +++ b/core/vm/precompiles/wrapped_a0gi_base/types.go @@ -1,10 +1,18 @@ package wrappeda0gibase import ( + "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" ) +type Supply = struct { + Cap *big.Int "json:\"cap\"" + InitialSupply *big.Int "json:\"initialSupply\"" + Supply *big.Int "json:\"supply\"" +} + var ( supplyKey = []byte{0x00} ) From 24fd415442889e3d4ed0c6515e7be822911f1bfd Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Thu, 10 Apr 2025 03:00:23 +0800 Subject: [PATCH 08/11] fix: wa0gi; add ut --- core/vm/dasigners_test.go | 4 - core/vm/wrapped_a0gi_base.go | 4 +- core/vm/wrapped_a0gi_base_test.go | 657 ++++++++++++++++++++++++++++++ 3 files changed, 659 insertions(+), 6 deletions(-) create mode 100644 core/vm/wrapped_a0gi_base_test.go diff --git a/core/vm/dasigners_test.go b/core/vm/dasigners_test.go index 4c973ad265..2504b934d5 100644 --- a/core/vm/dasigners_test.go +++ b/core/vm/dasigners_test.go @@ -1,7 +1,6 @@ package vm import ( - "fmt" "math/big" "testing" @@ -261,11 +260,8 @@ func (suite *DASignersTestSuite) queryGetAggPkG1(testSigner common.Address, bitm func (suite *DASignersTestSuite) Test_DASigners() { // tx test - fmt.Println("registering signer 1..") signer1 := suite.registerSigner(suite.signerOne, big.NewInt(1)) - fmt.Println("registering signer 2..") signer2 := suite.registerSigner(suite.signerTwo, big.NewInt(11)) - fmt.Println("signers registered..") suite.updateSocket(suite.signerOne, signer1) suite.updateSocket(suite.signerTwo, signer2) suite.registerEpoch(suite.signerOne, big.NewInt(1)) diff --git a/core/vm/wrapped_a0gi_base.go b/core/vm/wrapped_a0gi_base.go index 685b0c1e47..6c15a6bb90 100644 --- a/core/vm/wrapped_a0gi_base.go +++ b/core/vm/wrapped_a0gi_base.go @@ -241,7 +241,7 @@ func (w *WrappedA0giBasePrecompile) Burn( } func (w *WrappedA0giBasePrecompile) getAgency() common.Address { - // This is a Wrapped A0GI Agency contract deployed by a raw transaction: + // This is a Multi-sig contract deployed by a raw transaction: // raw tx params: // from: // nonce: 0 @@ -268,7 +268,7 @@ func (w *WrappedA0giBasePrecompile) SetMinterCap( // validation agency := w.getAgency() if contract.caller != agency { - return nil, wrappeda0gibase.ErrSenderNotWA0GI + return nil, wrappeda0gibase.ErrSenderNotAgency } // execute supply, err := w.getMinterSupply(evm, minter) diff --git a/core/vm/wrapped_a0gi_base_test.go b/core/vm/wrapped_a0gi_base_test.go new file mode 100644 index 0000000000..7e5fc774cf --- /dev/null +++ b/core/vm/wrapped_a0gi_base_test.go @@ -0,0 +1,657 @@ +package vm + +import ( + "fmt" + "math/big" + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + wrappeda0gibase "github.com/ethereum/go-ethereum/core/vm/precompiles/wrapped_a0gi_base" + "github.com/ethereum/go-ethereum/params" + "github.com/holiman/uint256" + "github.com/stretchr/testify/suite" +) + +type WrappedA0giBaseTestSuite struct { + suite.Suite + + abi abi.ABI + statedb *state.StateDB + evm *EVM + wa0gibase *WrappedA0giBasePrecompile + signerOne common.Address + signerTwo common.Address +} + +func (suite *WrappedA0giBaseTestSuite) SetupTest() { + suite.wa0gibase = NewWrappedA0giBasePrecompile() + suite.abi = suite.wa0gibase.abi + + statedb, _ := state.New(types.EmptyRootHash, state.NewDatabaseForTesting()) + suite.statedb = statedb + suite.evm = NewEVM(BlockContext{ + BlockNumber: big.NewInt(1), + }, statedb, params.TestChainConfig, Config{}) + suite.signerOne = common.HexToAddress("0x0000000000000000000000000000000100000000") + suite.signerTwo = common.HexToAddress("0x0000000000000000000000000000000100000001") +} + +func (suite *WrappedA0giBaseTestSuite) runTx(input []byte, signer common.Address, gas uint64, value *uint256.Int, readonly bool) ([]byte, error) { + suite.evm.Origin = signer + bz, _, err := RunPrecompiledContract(suite.evm, suite.wa0gibase, signer, input, gas, value, readonly, nil) + if err == nil { + suite.statedb.Finalise(true) + suite.statedb.Commit(suite.evm.Context.BlockNumber.Uint64(), true, false) + } + return bz, err +} + +func (s *WrappedA0giBaseTestSuite) TestGetW0GI() { + method := WrappedA0GIBaseFunctionGetWA0GI + + testCases := []struct { + name string + malleate func() []byte + postCheck func(bz []byte) + gas uint64 + expErr bool + errContains string + }{ + { + "success", + func() []byte { + input, err := s.abi.Pack( + method, + ) + s.Assert().NoError(err) + return input + }, + func(data []byte) { + out, err := s.abi.Methods[method].Outputs.Unpack(data) + s.Require().NoError(err, "failed to unpack output") + wa0gi := out[0].(common.Address) + s.Require().Equal(wa0gi, s.wa0gibase.getWA0GI()) + // fmt.Println(wa0gi) + }, + 100000, + false, + "", + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + s.SetupTest() + + bz, err := s.runTx(tc.malleate(), s.signerOne, 10000000, uint256.NewInt(0), true) + + if tc.expErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.errContains) + } else { + s.Require().NoError(err) + s.Require().NotNil(bz) + tc.postCheck(bz) + } + }) + } +} + +func (s *WrappedA0giBaseTestSuite) TestMinterSupply() { + method := WrappedA0GIBaseFunctionMinterSupply + agency := s.wa0gibase.getAgency() + + testCases := []struct { + name string + malleate func() []byte + postCheck func(bz []byte) + gas uint64 + expErr bool + errContains string + }{ + { + "non-empty", + func() []byte { + input, err := s.abi.Pack( + method, + s.signerOne, + ) + s.Assert().NoError(err) + return input + }, + func(data []byte) { + out, err := s.abi.Methods[method].Outputs.Unpack(data) + s.Require().NoError(err, "failed to unpack output") + supply := out[0].(wrappeda0gibase.Supply) + fmt.Println(supply) + s.Require().Equal(supply.Cap, big.NewInt(8e18)) + s.Require().Equal(supply.InitialSupply, big.NewInt(4e18)) + s.Require().Equal(supply.Supply, big.NewInt(4e18+1e18)) + // fmt.Println(wa0gi) + }, + 100000, + false, + "", + }, { + "empty", + func() []byte { + input, err := s.abi.Pack( + method, + s.signerTwo, + ) + s.Assert().NoError(err) + return input + }, + func(data []byte) { + out, err := s.abi.Methods[method].Outputs.Unpack(data) + s.Require().NoError(err, "failed to unpack output") + supply := out[0].(wrappeda0gibase.Supply) + s.Require().Equal(supply.Cap.Bytes(), big.NewInt(0).Bytes()) + s.Require().Equal(supply.InitialSupply.Bytes(), big.NewInt(0).Bytes()) + s.Require().Equal(supply.Supply.Bytes(), big.NewInt(0).Bytes()) + // fmt.Println(wa0gi) + }, + 100000, + false, + "", + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + s.SetupTest() + // set minter cap + input, err := s.abi.Pack( + WrappedA0GIBaseFunctionSetMinterCap, + s.signerOne, + big.NewInt(8e18), + big.NewInt(4e18), + ) + s.Assert().NoError(err) + _, err = s.runTx(input, agency, 10000000, uint256.NewInt(0), false) + s.Assert().NoError(err) + // mint + input, err = s.abi.Pack( + WrappedA0GIBaseFunctionMint, + s.signerOne, + big.NewInt(1e18), + ) + s.Assert().NoError(err) + _, err = s.runTx(input, s.wa0gibase.getWA0GI(), 10000000, uint256.NewInt(0), false) + s.Assert().NoError(err) + + bz, err := s.runTx(tc.malleate(), s.signerOne, 10000000, uint256.NewInt(0), true) + + if tc.expErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.errContains) + } else { + s.Require().NoError(err) + s.Require().NotNil(bz) + tc.postCheck(bz) + } + }) + } +} + +func (s *WrappedA0giBaseTestSuite) TestMint() { + method := WrappedA0GIBaseFunctionMint + agency := s.wa0gibase.getAgency() + + testCases := []struct { + name string + malleate func() []byte + postCheck func() + gas uint64 + expErr bool + errContains string + isSenderWA0GI bool + }{ + { + "success", + func() []byte { + input, err := s.abi.Pack( + method, + s.signerOne, + big.NewInt(1e18), + ) + s.Assert().NoError(err) + return input + }, + func() { + supply, err := s.wa0gibase.getMinterSupply(s.evm, s.signerOne) + s.Assert().NoError(err) + s.Require().Equal(supply.Cap, big.NewInt(8e18)) + s.Require().Equal(supply.InitialSupply, big.NewInt(4e18)) + s.Require().Equal(supply.Supply, big.NewInt(4e18+1e18)) + }, + 100000, + false, + "", + true, + }, { + "fail", + func() []byte { + input, err := s.abi.Pack( + method, + s.signerOne, + big.NewInt(9e18), + ) + s.Assert().NoError(err) + return input + }, + func() {}, + 100000, + true, + "insufficient mint cap", + true, + }, { + "invalid sender", + func() []byte { + input, err := s.abi.Pack( + method, + s.signerTwo, + big.NewInt(9e18), + ) + s.Assert().NoError(err) + return input + }, + func() {}, + 100000, + true, + "sender is not WA0GI", + false, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + s.SetupTest() + + input, err := s.abi.Pack( + WrappedA0GIBaseFunctionSetMinterCap, + s.signerOne, + big.NewInt(8e18), + big.NewInt(4e18), + ) + s.Assert().NoError(err) + _, err = s.runTx(input, agency, 10000000, uint256.NewInt(0), false) + s.Assert().NoError(err) + + if tc.isSenderWA0GI { + _, err = s.runTx(tc.malleate(), s.wa0gibase.getWA0GI(), 10000000, uint256.NewInt(0), false) + } else { + _, err = s.runTx(tc.malleate(), s.signerTwo, 10000000, uint256.NewInt(0), false) + } + + if tc.expErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.errContains) + } else { + s.Require().NoError(err) + tc.postCheck() + } + }) + } +} + +func (s *WrappedA0giBaseTestSuite) TestBurn() { + method := WrappedA0GIBaseFunctionBurn + agency := s.wa0gibase.getAgency() + + testCases := []struct { + name string + malleate func() []byte + postCheck func() + gas uint64 + expErr bool + errContains string + isSenderWA0GI bool + }{ + { + "success", + func() []byte { + input, err := s.abi.Pack( + method, + s.signerOne, + big.NewInt(1e18), + ) + s.Assert().NoError(err) + return input + }, + func() { + supply, err := s.wa0gibase.getMinterSupply(s.evm, s.signerOne) + s.Assert().NoError(err) + s.Require().Equal(supply.Cap, big.NewInt(8e18)) + s.Require().Equal(supply.InitialSupply, big.NewInt(4e18)) + s.Require().Equal(supply.Supply, big.NewInt(3e18)) + // fmt.Println(wa0gi) + }, + 100000, + false, + "", + true, + }, { + "fail", + func() []byte { + input, err := s.abi.Pack( + method, + s.signerOne, + big.NewInt(9e18), + ) + s.Assert().NoError(err) + return input + }, + func() {}, + 100000, + true, + "insufficient mint supply", + true, + }, { + "invalid sender", + func() []byte { + input, err := s.abi.Pack( + method, + s.signerTwo, + big.NewInt(9e18), + ) + s.Assert().NoError(err) + return input + }, + func() {}, + 100000, + true, + "sender is not WA0GI", + false, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + s.SetupTest() + + input, err := s.abi.Pack( + WrappedA0GIBaseFunctionSetMinterCap, + s.signerOne, + big.NewInt(8e18), + big.NewInt(4e18), + ) + s.Assert().NoError(err) + _, err = s.runTx(input, agency, 10000000, uint256.NewInt(0), false) + s.Assert().NoError(err) + + if tc.isSenderWA0GI { + _, err = s.runTx(tc.malleate(), s.wa0gibase.getWA0GI(), 10000000, uint256.NewInt(0), false) + } else { + _, err = s.runTx(tc.malleate(), s.signerTwo, 10000000, uint256.NewInt(0), false) + } + + if tc.expErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.errContains) + } else { + s.Require().NoError(err) + tc.postCheck() + } + }) + } +} + +func (s *WrappedA0giBaseTestSuite) TestSetMinterCap() { + agency := s.wa0gibase.getAgency() + + testCases := []struct { + name string + caps []struct { + account common.Address + cap *big.Int + initialSupply *big.Int + } + }{ + { + name: "success", + caps: []struct { + account common.Address + cap *big.Int + initialSupply *big.Int + }{ + { + account: common.HexToAddress("0x0000000000000000000000000000000000000000"), + cap: big.NewInt(100000), + initialSupply: big.NewInt(50000), + }, + { + account: common.HexToAddress("0x0000000000000000000000000000000000000001"), + cap: big.NewInt(200000), + initialSupply: big.NewInt(100000), + }, + { + account: common.HexToAddress("0x0000000000000000000000000000000000000002"), + cap: big.NewInt(300000), + initialSupply: big.NewInt(150000), + }, + { + account: common.HexToAddress("0x0000000000000000000000000000000000000003"), + cap: big.NewInt(400000), + initialSupply: big.NewInt(200000), + }, + { + account: common.HexToAddress("0x0000000000000000000000000000000000000002"), + cap: big.NewInt(500000), + initialSupply: big.NewInt(250000), + }, + { + account: common.HexToAddress("0x0000000000000000000000000000000000000001"), + cap: big.NewInt(600000), + initialSupply: big.NewInt(300000), + }, + { + account: common.HexToAddress("0x0000000000000000000000000000000000000000"), + cap: big.NewInt(700000), + initialSupply: big.NewInt(350000), + }, + }, + }, + } + s.Run("invalid authority", func() { + s.SetupTest() + input, err := s.abi.Pack( + WrappedA0GIBaseFunctionSetMinterCap, + s.signerOne, + big.NewInt(8e18), + big.NewInt(4e18), + ) + s.Assert().NoError(err) + _, err = s.runTx(input, s.signerOne, 10000000, uint256.NewInt(0), false) + s.Require().Error(err) + s.Require().Contains(err.Error(), "sender is not agency") + }) + for _, tc := range testCases { + s.Run(tc.name, func() { + s.SetupTest() + + c := make(map[common.Address]struct { + Cap *big.Int + InitialSupply *big.Int + }) + for _, cap := range tc.caps { + input, err := s.abi.Pack( + WrappedA0GIBaseFunctionSetMinterCap, + cap.account, + cap.cap, + cap.initialSupply, + ) + s.Assert().NoError(err) + _, err = s.runTx(input, agency, 10000000, uint256.NewInt(0), false) + s.Require().NoError(err) + + supply, err := s.wa0gibase.getMinterSupply(s.evm, cap.account) + s.Require().NoError(err) + s.Require().Equal(supply.Cap, cap.cap) + s.Require().Equal(supply.InitialSupply, cap.initialSupply) + s.Require().Equal(supply.Supply, cap.initialSupply) + c[cap.account] = struct { + Cap *big.Int + InitialSupply *big.Int + }{ + Cap: cap.cap, + InitialSupply: cap.initialSupply, + } + } + for account, cap := range c { + supply, err := s.wa0gibase.getMinterSupply(s.evm, account) + s.Require().NoError(err) + s.Require().Equal(supply.Cap, cap.Cap) + s.Require().Equal(supply.InitialSupply, cap.InitialSupply) + s.Require().Equal(supply.Supply, cap.InitialSupply) + } + }) + } +} + +type MintBurn struct { + IsMint bool + Minter common.Address + Amount *big.Int + Success bool +} + +func (s *WrappedA0giBaseTestSuite) TestSetMintBurn() { + agency := s.wa0gibase.getAgency() + + minter1 := common.HexToAddress("0x0000000000000000000000000000000000000001") + minter2 := common.HexToAddress("0x0000000000000000000000000000000000000002") + + // set mint cap of minter 1 to 8 a0gi + input, err := s.abi.Pack( + WrappedA0GIBaseFunctionSetMinterCap, + minter1, + big.NewInt(8e18), + big.NewInt(0), + ) + s.Assert().NoError(err) + _, err = s.runTx(input, agency, 10000000, uint256.NewInt(0), false) + s.Require().NoError(err) + // set mint cap of minter 2 to 5 a0gi + input, err = s.abi.Pack( + WrappedA0GIBaseFunctionSetMinterCap, + minter2, + big.NewInt(5e18), + big.NewInt(0), + ) + s.Assert().NoError(err) + _, err = s.runTx(input, agency, 10000000, uint256.NewInt(0), false) + s.Require().NoError(err) + + testCases := []MintBurn{ + // #0, failed burn + { + IsMint: false, + Minter: minter1, + Amount: big.NewInt(1e18), + Success: false, + }, + // #1, mint 5 a0gi by minter 1 + { + IsMint: true, + Minter: minter1, + Amount: big.NewInt(5e18), + Success: true, + }, + // #2, burn 0.5 a0gi by minter 1 + { + IsMint: false, + Minter: minter1, + Amount: big.NewInt(5e17), + Success: true, + }, + // #3, mint 0.7 a0gi by minter 2 + { + IsMint: true, + Minter: minter2, + Amount: big.NewInt(7e17), + Success: true, + }, + // #4, mint 2 a0gi by minter 2 + { + IsMint: true, + Minter: minter2, + Amount: big.NewInt(2e18), + Success: true, + }, + // #5, burn 0.3 a0gi by minter 2 + { + IsMint: false, + Minter: minter1, + Amount: big.NewInt(3e17), + Success: true, + }, + // #6, failed to mint 4 a0gi by minter 1 + { + IsMint: true, + Minter: minter1, + Amount: big.NewInt(4e18), + Success: false, + }, + // #7, mint 3.5 a0gi by minter 1 + { + IsMint: true, + Minter: minter1, + Amount: big.NewInt(3e18 + 5e17), + Success: true, + }, + } + minted := big.NewInt(0) + supplied := make(map[common.Address]*big.Int) + for _, c := range testCases { + if c.IsMint { + input, err = s.abi.Pack( + WrappedA0GIBaseFunctionMint, + c.Minter, + c.Amount, + ) + s.Assert().NoError(err) + _, err = s.runTx(input, s.wa0gibase.getWA0GI(), 10000000, uint256.NewInt(0), false) + } else { + input, err = s.abi.Pack( + WrappedA0GIBaseFunctionBurn, + c.Minter, + c.Amount, + ) + s.Assert().NoError(err) + _, err = s.runTx(input, s.wa0gibase.getWA0GI(), 10000000, uint256.NewInt(0), false) + } + if c.Success { + if c.IsMint { + minted.Add(minted, c.Amount) + if amt, ok := supplied[c.Minter]; ok { + amt.Add(amt, c.Amount) + } else { + supplied[c.Minter] = new(big.Int).Set(c.Amount) + } + } else { + minted.Sub(minted, c.Amount) + if amt, ok := supplied[c.Minter]; ok { + amt.Sub(amt, c.Amount) + } else { + supplied[c.Minter] = new(big.Int).Set(c.Amount) + } + } + s.Require().NoError(err) + supply, err := s.wa0gibase.getMinterSupply(s.evm, c.Minter) + s.Require().NoError(err) + s.Require().Equal(supplied[c.Minter].Bytes(), supply.Supply.Bytes()) + } else { + s.Require().Error(err) + } + balance := s.evm.StateDB.GetBalance(s.wa0gibase.getWA0GI()) + s.Require().Equal(balance.ToBig().Bytes(), minted.Bytes()) + } +} + +func TestWrappedA0giBaseTestSuite(t *testing.T) { + suite.Run(t, new(WrappedA0giBaseTestSuite)) +} From f77f62ec5f274880fc83e64939560be4041aadbf Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Wed, 16 Apr 2025 04:55:48 +0800 Subject: [PATCH 09/11] feat: agency raw tx --- core/vm/wrapped_a0gi_base.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/vm/wrapped_a0gi_base.go b/core/vm/wrapped_a0gi_base.go index 6c15a6bb90..af5633618f 100644 --- a/core/vm/wrapped_a0gi_base.go +++ b/core/vm/wrapped_a0gi_base.go @@ -241,16 +241,20 @@ func (w *WrappedA0giBasePrecompile) Burn( } func (w *WrappedA0giBasePrecompile) getAgency() common.Address { - // This is a Multi-sig contract deployed by a raw transaction: + // This is a upgradeable contract deployed in Beacon-Proxy pattern in three raw transaction: // raw tx params: - // from: - // nonce: 0 + // from: 0x3504d167b83f6fc763ed006ad9b3ae2c90ad1c5b + // nonce: 0..2 // gasPrice: 100 Gwei // gasLimit: 1000000 // The sender is an ephemeral account, nobody holds its private key and this is the only transaction it signed. // This transaction is a legacy transaction without chain ID so it can be deployed at any EVM chain which supports pre-EIP155 transactions. - // raw tx: - return common.HexToAddress("0x0000000000000000000000000000000000000000") + // raw tx #0(implementation): 0xf905ef8085174876e800830f42408080b9059c608060405234801561001057600080fd5b5061057c806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c8063715018a6146100675780638129fc1c146100715780638da5cb5b14610079578063c8dd1a26146100c1578063dddba6c8146100ca578063f2fde38b146100dd575b600080fd5b61006f6100f0565b005b61006f610104565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b6100a561100281565b61006f6100d83660046104c2565b610227565b61006f6100eb3660046104f5565b61033a565b6100f8610378565b61010260006103d3565b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff1660008115801561014a5750825b905060008267ffffffffffffffff1660011480156101675750303b155b905081158015610175575080155b156101935760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff1916600117855583156101bd57845460ff60401b1916600160401b1785555b6101da732d7f2d2286994477ba878f321b17a7e40e52cda4610444565b831561022057845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b5050505050565b61022f610378565b6040516001600160a01b038416602482015260448101839052606481018290526000906110029060840160408051601f198184030181529181526020820180516001600160e01b0316631bbb74d960e31b1790525161028e9190610517565b6000604051808303816000865af19150503d80600081146102cb576040519150601f19603f3d011682016040523d82523d6000602084013e6102d0565b606091505b50509050806103345760405162461bcd60e51b815260206004820152602560248201527f7772617070656420613067692062617365207365744d696e7465724361702066604482015264185a5b195960da1b60648201526084015b60405180910390fd5b50505050565b610342610378565b6001600160a01b03811661036c57604051631e4fbdf760e01b81526000600482015260240161032b565b610375816103d3565b50565b336103aa7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146101025760405163118cdaa760e01b815233600482015260240161032b565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b61044c610455565b6103758161049e565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661010257604051631afcd79f60e31b815260040160405180910390fd5b610342610455565b80356001600160a01b03811681146104bd57600080fd5b919050565b6000806000606084860312156104d757600080fd5b6104e0846104a6565b95602085013595506040909401359392505050565b60006020828403121561050757600080fd5b610510826104a6565b9392505050565b6000825160005b81811015610538576020818601810151858301520161051e565b50600092019182525091905056fea26469706673582212201bc776e718351abafec5f665778c1e36e86e42d150a1555947e32c251669ef2564736f6c634300081400331ca0387754e94e273cf7d520ee01bf551d277a8de7da62a95fe38691c413294b0bfda0015e1f3af836be67761814b0bf20f49e9b6455836c7fd363a1d10c518f1d66c7 + // raw tx #1(beacon): 0xf904cb0185174876e800830f42408080b90478608060405234801561001057600080fd5b5060405161043838038061043883398101604081905261002f91610165565b806001600160a01b03811661005f57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61006881610079565b50610072826100c9565b5050610198565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b806001600160a01b03163b6000036100ff5760405163211eb15960e21b81526001600160a01b0382166004820152602401610056565b600180546001600160a01b0319166001600160a01b0383169081179091556040517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b80516001600160a01b038116811461016057600080fd5b919050565b6000806040838503121561017857600080fd5b61018183610149565b915061018f60208401610149565b90509250929050565b610291806101a76000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80633659cfe61461005c5780635c60da1b14610071578063715018a61461009a5780638da5cb5b146100a2578063f2fde38b146100b3575b600080fd5b61006f61006a36600461022b565b6100c6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006f6100da565b6000546001600160a01b031661007e565b61006f6100c136600461022b565b6100ee565b6100ce61012e565b6100d78161015b565b50565b6100e261012e565b6100ec60006101db565b565b6100f661012e565b6001600160a01b03811661012557604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6100d7816101db565b6000546001600160a01b031633146100ec5760405163118cdaa760e01b815233600482015260240161011c565b806001600160a01b03163b6000036101915760405163211eb15960e21b81526001600160a01b038216600482015260240161011c565b600180546001600160a01b0319166001600160a01b0383169081179091556040517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561023d57600080fd5b81356001600160a01b038116811461025457600080fd5b939250505056fea26469706673582212205220e5b3095ab739313888ed7a605b359ca52e79f2a5a6297e03c439e8e8b30764736f6c63430008140033000000000000000000000000cc46de259693c7ca0a776903381fd9b30f7973680000000000000000000000002d7f2d2286994477ba878f321b17a7e40e52cda41ba0a6796d9b4d10a35400ed45febe7bd9966c02b85da7926d1cabe262ff02fe7f63a05a0c76c708bc0af68cb1dc911eef76d71dfbc519b85ce848a8844eff51a0b8af + // raw tx #2(proxy): 0xf906720285174876e800830f42408080b9061f60a06040526040516105bf3803806105bf83398101604081905261002291610387565b61002c828261003e565b506001600160a01b031660805261047e565b610047826100fe565b6040516001600160a01b038316907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a28051156100f2576100ed826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e79190610447565b82610211565b505050565b6100fa610288565b5050565b806001600160a01b03163b60000361013957604051631933b43b60e21b81526001600160a01b03821660048201526024015b60405180910390fd5b807fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392831617905560408051635c60da1b60e01b81529051600092841691635c60da1b9160048083019260209291908290030181865afa1580156101b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d99190610447565b9050806001600160a01b03163b6000036100fa57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610130565b6060600080846001600160a01b03168460405161022e9190610462565b600060405180830381855af49150503d8060008114610269576040519150601f19603f3d011682016040523d82523d6000602084013e61026e565b606091505b50909250905061027f8583836102a9565b95945050505050565b34156102a75760405163b398979f60e01b815260040160405180910390fd5b565b6060826102be576102b982610308565b610301565b81511580156102d557506001600160a01b0384163b155b156102fe57604051639996b31560e01b81526001600160a01b0385166004820152602401610130565b50805b9392505050565b8051156103185780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80516001600160a01b038116811461034857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561037e578181015183820152602001610366565b50506000910152565b6000806040838503121561039a57600080fd5b6103a383610331565b60208401519092506001600160401b03808211156103c057600080fd5b818501915085601f8301126103d457600080fd5b8151818111156103e6576103e661034d565b604051601f8201601f19908116603f0116810190838211818310171561040e5761040e61034d565b8160405282815288602084870101111561042757600080fd5b610438836020830160208801610363565b80955050505050509250929050565b60006020828403121561045957600080fd5b61030182610331565b60008251610474818460208701610363565b9190910192915050565b6080516101276104986000396000601e01526101276000f3fe6080604052600a600c565b005b60186014601a565b60a0565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156079573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190609b919060c3565b905090565b3660008037600080366000845af43d6000803e80801560be573d6000f35b3d6000fd5b60006020828403121560d457600080fd5b81516001600160a01b038116811460ea57600080fd5b939250505056fea264697066735822122039e43d51fa1bcd8fe79599db2a7e6dd3e5358b756c53210827bbf02fda62be6c64736f6c63430008140033000000000000000000000000357f0f6bff45b51bd84121aab517c63c3c9d003a000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000001ba09c5d3b7c86539764e213c89c5ebefa8bc1533c53d6f533e8bc403f6765efed76a077d056d4f3d618d8cf4bac4f1bbf09ba8ffaa2875058d59670c05c124e670f5f + // The owners of the contract and the beacon will be set to 0x2D7F2d2286994477Ba878f321b17A7e40E52cDa4, + // and after the network has launched and reached a stable state, ownership will be transferred to a timelock contract controlled by a multisig + return common.HexToAddress("0xe1a5162f99e075f8c6681ae28191ab3ac250b468") } func (w *WrappedA0giBasePrecompile) SetMinterCap( From 7e030622830f88c2e4754fba50a89f94a5fb3e11 Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Wed, 16 Apr 2025 08:33:23 +0800 Subject: [PATCH 10/11] refactor: DA --- core/vm/dasigners.go | 72 +++++++++++++------ core/vm/dasigners_test.go | 25 ++++--- core/vm/precompiles/dasigners/contract.go | 26 +++---- core/vm/precompiles/dasigners/types.go | 17 +++-- core/vm/precompiles/errors.go | 3 +- .../interfaces/abis/IDASigners.json | 10 +++ .../interfaces/contracts/IDASigners.sol | 8 ++- 7 files changed, 105 insertions(+), 56 deletions(-) diff --git a/core/vm/dasigners.go b/core/vm/dasigners.go index a8a443b666..eb766345a3 100644 --- a/core/vm/dasigners.go +++ b/core/vm/dasigners.go @@ -221,16 +221,24 @@ func (d *DASignersPrecompile) MakeEpoch( // new epoch epoch += 1 cnt := d.epochRegistration(evm, epoch) - ballots := make([]Ballot, cnt) + ballots := []Ballot{} for index := range cnt { account := d.epochRegisteredSigner(evm, epoch, index) sigHash, _ := d.getRegistration(evm, epoch, account) - ballots[index] = Ballot{ - account: account, - content: sigHash, + votes := d.getVotes(evm, epoch, account) + // MaxVotesPerSigner is hard limit + if params.MaxVotesPerSigner.Int64() < int64(votes) { + votes = int(params.MaxVotesPerSigner.Int64()) + } + content := sigHash + for j := 0; j < votes; j += 1 { + ballots = append(ballots, Ballot{ + account: account, + content: content, + }) + content = crypto.Keccak256(content) } } - // TODO: calculate ballots based on staked amount sort.Slice(ballots, func(i, j int) bool { return bytes.Compare(ballots[i].content, ballots[j].content) < 0 }) @@ -289,6 +297,23 @@ func (d *DASignersPrecompile) setSigner(evm *EVM, signer dasigners.IDASignersSig return nil } +func (d *DASignersPrecompile) getRegistry() common.Address { + // This is a upgradeable contract deployed in Beacon-Proxy pattern in three raw transaction: + // raw tx params: + // from: 0xeb995d37799ad4a2db524e5ff0825ae2d4711757 + // nonce: 0..2 + // gasPrice: 100 Gwei + // gasLimit: 1000000 + // The sender is an ephemeral account, nobody holds its private key and this is the only transaction it signed. + // This transaction is a legacy transaction without chain ID so it can be deployed at any EVM chain which supports pre-EIP155 transactions. + // raw tx #0(implementation): 0xf90b708085174876e800830f42408080b90b1d608060405234801561001057600080fd5b50610afd806100206000396000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c8063807f063a1161005b578063807f063a146100b25780638129fc1c146100d75780638da5cb5b146100df578063f2fde38b1461010f57600080fd5b806356a3237214610082578063715018a6146100975780637ca4dd5e1461009f575b600080fd5b6100956100903660046106e6565b610122565b005b610095610242565b6100956100ad3660046107b5565b610256565b6100bb61100081565b6040516001600160a01b03909116815260200160405180910390f35b610095610395565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b03166100bb565b61009561011d3660046108bd565b6104b7565b33321461014257604051630f15d65160e01b815260040160405180910390fd5b6000806110006001600160a01b0316630f62bda560e01b3385600160405160240161016f939291906108d8565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516101ad9190610934565b6000604051808303816000865af19150503d80600081146101ea576040519150601f19603f3d011682016040523d82523d6000602084013e6101ef565b606091505b509150915081816040516020016102069190610950565b6040516020818303038152906040529061023c5760405162461bcd60e51b815260040161023391906109c1565b60405180910390fd5b50505050565b61024a6104f5565b6102546000610550565b565b33321461027657604051630f15d65160e01b815260040160405180910390fd5b81516001600160a01b031633146102a057604051631024390d60e21b815260040160405180910390fd5b6000806110006001600160a01b0316637ca4dd5e60e01b85856040516024016102ca9291906109f7565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516103089190610934565b6000604051808303816000865af19150503d8060008114610345576040519150601f19603f3d011682016040523d82523d6000602084013e61034a565b606091505b509150915081816040516020016103619190610a82565b6040516020818303038152906040529061038e5760405162461bcd60e51b815260040161023391906109c1565b5050505050565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a008054600160401b810460ff16159067ffffffffffffffff166000811580156103db5750825b905060008267ffffffffffffffff1660011480156103f85750303b155b905081158015610406575080155b156104245760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff19166001178555831561044e57845460ff60401b1916600160401b1785555b61046b732d7f2d2286994477ba878f321b17a7e40e52cda46105c1565b831561038e57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15050505050565b6104bf6104f5565b6001600160a01b0381166104e957604051631e4fbdf760e01b815260006004820152602401610233565b6104f281610550565b50565b336105277f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300546001600160a01b031690565b6001600160a01b0316146102545760405163118cdaa760e01b8152336004820152602401610233565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930080546001600160a01b031981166001600160a01b03848116918217845560405192169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3505050565b6105c96105d2565b6104f28161061b565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0054600160401b900460ff1661025457604051631afcd79f60e31b815260040160405180910390fd5b6104bf6105d2565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561065c5761065c610623565b60405290565b6040516080810167ffffffffffffffff8111828210171561065c5761065c610623565b604051601f8201601f1916810167ffffffffffffffff811182821017156106ae576106ae610623565b604052919050565b6000604082840312156106c857600080fd5b6106d0610639565b9050813581526020820135602082015292915050565b6000604082840312156106f857600080fd5b61070283836106b6565b9392505050565b80356001600160a01b038116811461072057600080fd5b919050565b600082601f83011261073657600080fd5b61073e610639565b80604084018581111561075057600080fd5b845b8181101561076a578035845260209384019301610752565b509095945050505050565b60006080828403121561078757600080fd5b61078f610639565b905061079b8383610725565b81526107aa8360408401610725565b602082015292915050565b600080606083850312156107c857600080fd5b823567ffffffffffffffff808211156107e057600080fd5b9084019061010082870312156107f557600080fd5b6107fd610662565b61080683610709565b81526020808401358381111561081b57600080fd5b8401601f8101891361082c57600080fd5b80358481111561083e5761083e610623565b610850601f8201601f19168401610685565b9450808552898382840101111561086657600080fd5b808383018487013760008382870101525050828183015261088a88604086016106b6565b604083015261089c8860808601610775565b60608301528195506108b0888289016106b6565b9450505050509250929050565b6000602082840312156108cf57600080fd5b61070282610709565b6001600160a01b0384168152608081016108ff602083018580518252602090810151910152565b60ff83166060830152949350505050565b60005b8381101561092b578181015183820152602001610913565b50506000910152565b60008251610946818460208701610910565b9190910192915050565b7f72656769737465724e65787445706f63682063616c6c206661696c65643a200081526000825161098881601f850160208701610910565b91909101601f0192915050565b600081518084526109ad816020860160208601610910565b601f01601f19169290920160200192915050565b6020815260006107026020830184610995565b8060005b600281101561023c5781518452602093840193909101906001016109d8565b606080825283516001600160a01b03169082015260208301516101006080830152600090610a29610160840182610995565b6040860151805160a0860152602081015160c0860152909150506060850151610a5660e0850182516109d4565b60200151610a686101208501826109d4565b509050610702602083018480518252602090810151910152565b7f72656769737465725369676e65722063616c6c206661696c65643a2000000000815260008251610aba81601c850160208701610910565b91909101601c019291505056fea2646970667358221220bb50c03fb5e1cc5e8bb317ff0bf7889ef0b368a37ea3568a9d02d8379ebc351164736f6c634300081400331ba04ce6e58373b6023b7ffc717cc0db01847ed8da661c7c3c98693957d3248af35fa0727edc90561444dcb4e91a329e8ef7916cb018dfef5f18e86e2bd90391e7a204 + // raw tx #1(beacon): 0xf904cb0185174876e800830f42408080b90478608060405234801561001057600080fd5b5060405161043838038061043883398101604081905261002f91610165565b806001600160a01b03811661005f57604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b61006881610079565b50610072826100c9565b5050610198565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b806001600160a01b03163b6000036100ff5760405163211eb15960e21b81526001600160a01b0382166004820152602401610056565b600180546001600160a01b0319166001600160a01b0383169081179091556040517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b80516001600160a01b038116811461016057600080fd5b919050565b6000806040838503121561017857600080fd5b61018183610149565b915061018f60208401610149565b90509250929050565b610291806101a76000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80633659cfe61461005c5780635c60da1b14610071578063715018a61461009a5780638da5cb5b146100a2578063f2fde38b146100b3575b600080fd5b61006f61006a36600461022b565b6100c6565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b61006f6100da565b6000546001600160a01b031661007e565b61006f6100c136600461022b565b6100ee565b6100ce61012e565b6100d78161015b565b50565b6100e261012e565b6100ec60006101db565b565b6100f661012e565b6001600160a01b03811661012557604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6100d7816101db565b6000546001600160a01b031633146100ec5760405163118cdaa760e01b815233600482015260240161011c565b806001600160a01b03163b6000036101915760405163211eb15960e21b81526001600160a01b038216600482015260240161011c565b600180546001600160a01b0319166001600160a01b0383169081179091556040517fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561023d57600080fd5b81356001600160a01b038116811461025457600080fd5b939250505056fea26469706673582212205220e5b3095ab739313888ed7a605b359ca52e79f2a5a6297e03c439e8e8b30764736f6c634300081400330000000000000000000000007ad29425f6d68ed6bd8eb8a77d73bb2ad81b8afa0000000000000000000000002d7f2d2286994477ba878f321b17a7e40e52cda41ca0a1e38aac4e65cf5d87e9c2f857d3f0b3cc9f24d42639689f01c9876a45665ebda0330c349d845c3403c9be2b8e31ed0c17e5b3824d02c9e11e71564df71d6621ee + // raw tx #2(proxy): 0xf906720285174876e800830f42408080b9061f60a06040526040516105bf3803806105bf83398101604081905261002291610387565b61002c828261003e565b506001600160a01b031660805261047e565b610047826100fe565b6040516001600160a01b038316907f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e90600090a28051156100f2576100ed826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100e79190610447565b82610211565b505050565b6100fa610288565b5050565b806001600160a01b03163b60000361013957604051631933b43b60e21b81526001600160a01b03821660048201526024015b60405180910390fd5b807fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080546001600160a01b0319166001600160a01b0392831617905560408051635c60da1b60e01b81529051600092841691635c60da1b9160048083019260209291908290030181865afa1580156101b5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d99190610447565b9050806001600160a01b03163b6000036100fa57604051634c9c8ce360e01b81526001600160a01b0382166004820152602401610130565b6060600080846001600160a01b03168460405161022e9190610462565b600060405180830381855af49150503d8060008114610269576040519150601f19603f3d011682016040523d82523d6000602084013e61026e565b606091505b50909250905061027f8583836102a9565b95945050505050565b34156102a75760405163b398979f60e01b815260040160405180910390fd5b565b6060826102be576102b982610308565b610301565b81511580156102d557506001600160a01b0384163b155b156102fe57604051639996b31560e01b81526001600160a01b0385166004820152602401610130565b50805b9392505050565b8051156103185780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b80516001600160a01b038116811461034857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561037e578181015183820152602001610366565b50506000910152565b6000806040838503121561039a57600080fd5b6103a383610331565b60208401519092506001600160401b03808211156103c057600080fd5b818501915085601f8301126103d457600080fd5b8151818111156103e6576103e661034d565b604051601f8201601f19908116603f0116810190838211818310171561040e5761040e61034d565b8160405282815288602084870101111561042757600080fd5b610438836020830160208801610363565b80955050505050509250929050565b60006020828403121561045957600080fd5b61030182610331565b60008251610474818460208701610363565b9190910192915050565b6080516101276104986000396000601e01526101276000f3fe6080604052600a600c565b005b60186014601a565b60a0565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156079573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190609b919060c3565b905090565b3660008037600080366000845af43d6000803e80801560be573d6000f35b3d6000fd5b60006020828403121560d457600080fd5b81516001600160a01b038116811460ea57600080fd5b939250505056fea264697066735822122039e43d51fa1bcd8fe79599db2a7e6dd3e5358b756c53210827bbf02fda62be6c64736f6c63430008140033000000000000000000000000762662fb644cdd051f35e0dd8fb6ac15a4bf65ad000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000001ca04189ff3e2929af3203bb5041d582084f676c866a1faae88b0a1fad3f616b90ada0309a30d2c3fabc8e659b9a747c75f62556f1db3b269b1377fa936b7c236685cb + // The owners of the contract and the beacon will be set to 0x2D7F2d2286994477Ba878f321b17A7e40E52cDa4, + // and after the network has launched and reached a stable state, ownership will be transferred to a timelock contract controlled by a multisig + return common.HexToAddress("0x20f30b2584f3096ea0d6c18c3b5cacc0585e12fc") +} + func (d *DASignersPrecompile) RegisterSigner( evm *EVM, contract *Contract, @@ -301,15 +326,12 @@ func (d *DASignersPrecompile) RegisterSigner( signer := args[0].(dasigners.IDASignersSignerDetail) signature := dasigners.SerializeG1(args[1].(dasigners.BN254G1Point)) // validation - if evm.Origin != signer.Signer { - return nil, dasigners.ErrInvalidSender - } - if contract.caller != evm.Origin { - return nil, precompiles.ErrSenderNotOrigin + if contract.caller != d.getRegistry() { + return nil, precompiles.ErrSenderNotRegistry } // execute // validate sender - // TODO: check staked + // staked value is checked in registry contract _, found, err := d.getSigner(evm, signer.Signer) if err != nil { return nil, err @@ -344,12 +366,14 @@ func (d *DASignersPrecompile) epochRegisteredSigner(evm *EVM, epoch uint64, inde return common.Address(h[12:]) } -func (d *DASignersPrecompile) storeRegistration(evm *EVM, epoch uint64, signer common.Address, signature []byte) error { +func (d *DASignersPrecompile) storeRegistration(evm *EVM, epoch uint64, signer common.Address, signature []byte, votes *big.Int) error { if _, found := d.getRegistration(evm, epoch, signer); found { return nil } // save signature hash evm.StateDB.SetState(d.Address(), dasigners.RegistrationKey(epoch, signer), crypto.Keccak256Hash(signature)) + // save votes + evm.StateDB.SetState(d.Address(), dasigners.VotesKey(epoch, signer), common.BigToHash(votes)) // increment epoch registration count registration := d.epochRegistration(evm, epoch) evm.StateDB.SetState(d.Address(), dasigners.EpochRegistrationKey(epoch), common.BigToHash(big.NewInt(int64(registration+1)))) @@ -364,18 +388,20 @@ func (d *DASignersPrecompile) RegisterNextEpoch( method *abi.Method, args []interface{}, ) ([]byte, error) { - if len(args) != 1 { + if len(args) != 3 { return nil, ErrExecutionReverted } - signature := dasigners.SerializeG1(args[0].(dasigners.BN254G1Point)) + account := args[0].(common.Address) + signature := dasigners.SerializeG1(args[1].(dasigners.BN254G1Point)) + votes := args[2].(*big.Int) // validation - if contract.caller != evm.Origin { - return nil, precompiles.ErrSenderNotOrigin + if contract.caller != d.getRegistry() { + return nil, precompiles.ErrSenderNotRegistry } // execute // get signer - // TODO: check staked - signer, found, err := d.getSigner(evm, contract.caller) + // staked value is checked in registry contract + signer, found, err := d.getSigner(evm, account) if err != nil { return nil, err } @@ -385,12 +411,12 @@ func (d *DASignersPrecompile) RegisterNextEpoch( // validate signature epochNumber := d.epochNumber(evm) chainID := evm.chainConfig.ChainID - hash := dasigners.EpochRegistrationHash(contract.caller, epochNumber+1, chainID) + hash := dasigners.EpochRegistrationHash(account, epochNumber+1, chainID) if !dasigners.ValidateSignature(signer, hash, bn254util.DeserializeG1(signature)) { return nil, dasigners.ErrInvalidSignature } // save registration - if err := d.storeRegistration(evm, epochNumber+1, contract.caller, signature); err != nil { + if err := d.storeRegistration(evm, epochNumber+1, account, signature, votes); err != nil { return nil, err } return method.Outputs.Pack() @@ -432,7 +458,7 @@ func (d *DASignersPrecompile) UpdateSocket( func (d *DASignersPrecompile) params() dasigners.IDASignersParams { return dasigners.IDASignersParams{ - TokensPerVote: big.NewInt(10), + TokensPerVote: big.NewInt(10), // deprecated MaxVotesPerSigner: big.NewInt(1024), MaxQuorums: big.NewInt(10), EpochBlocks: big.NewInt(5760), @@ -524,6 +550,10 @@ func (d *DASignersPrecompile) getRegistration(evm *EVM, epoch uint64, account co return h.Bytes(), true } +func (d *DASignersPrecompile) getVotes(evm *EVM, epoch uint64, account common.Address) int { + return int(evm.StateDB.GetState(d.Address(), dasigners.VotesKey(epoch, account)).Big().Int64()) +} + func (d *DASignersPrecompile) RegisteredEpoch(evm *EVM, method *abi.Method, args []interface{}) ([]byte, error) { if len(args) != 2 { return nil, ErrExecutionReverted diff --git a/core/vm/dasigners_test.go b/core/vm/dasigners_test.go index 2504b934d5..c7f67f0731 100644 --- a/core/vm/dasigners_test.go +++ b/core/vm/dasigners_test.go @@ -69,7 +69,7 @@ func (suite *DASignersTestSuite) registerSigner(testSigner common.Address, sk *b suite.Assert().NoError(err) oldLogs := suite.statedb.Logs() - _, err = suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), false) + _, err = suite.runTx(input, suite.dasigners.getRegistry(), 10000000, uint256.NewInt(0), false) suite.Assert().NoError(err) logs := suite.statedb.Logs() suite.Assert().EqualValues(len(logs), len(oldLogs)+2) @@ -110,18 +110,20 @@ func (suite *DASignersTestSuite) updateSocket(testSigner common.Address, signer signer.Socket = "0.0.0.0:2345" } -func (suite *DASignersTestSuite) registerEpoch(testSigner common.Address, sk *big.Int) { +func (suite *DASignersTestSuite) registerEpoch(testSigner common.Address, sk *big.Int, votes *big.Int) { epoch := suite.dasigners.epochNumber(suite.evm) + 1 hash := dasigners.EpochRegistrationHash(testSigner, epoch, suite.evm.chainConfig.ChainID) signature := new(bn254.G1Affine).ScalarMultiplication(hash, sk) input, err := suite.abi.Pack( "registerNextEpoch", + testSigner, dasigners.NewBN254G1Point(bn254util.SerializeG1(signature)), + votes, ) suite.Assert().NoError(err) - _, err = suite.runTx(input, testSigner, 10000000, uint256.NewInt(0), false) + _, err = suite.runTx(input, suite.dasigners.getRegistry(), 10000000, uint256.NewInt(0), false) suite.Assert().NoError(err) } @@ -264,8 +266,8 @@ func (suite *DASignersTestSuite) Test_DASigners() { signer2 := suite.registerSigner(suite.signerTwo, big.NewInt(11)) suite.updateSocket(suite.signerOne, signer1) suite.updateSocket(suite.signerTwo, signer2) - suite.registerEpoch(suite.signerOne, big.NewInt(1)) - suite.registerEpoch(suite.signerTwo, big.NewInt(11)) + suite.registerEpoch(suite.signerOne, big.NewInt(1), big.NewInt(1)) + suite.registerEpoch(suite.signerTwo, big.NewInt(11), big.NewInt(2)) // move to next epochs daparams := suite.dasigners.params() suite.queryEpochNumber(suite.signerOne, big.NewInt(0)) @@ -274,8 +276,8 @@ func (suite *DASignersTestSuite) Test_DASigners() { suite.queryEpochNumber(suite.signerOne, big.NewInt(1)) suite.makeEpoch(suite.signerOne) suite.queryEpochNumber(suite.signerOne, big.NewInt(1)) - suite.registerEpoch(suite.signerOne, big.NewInt(1)) - suite.registerEpoch(suite.signerTwo, big.NewInt(11)) + suite.registerEpoch(suite.signerOne, big.NewInt(1), big.NewInt(1)) + suite.registerEpoch(suite.signerTwo, big.NewInt(11), big.NewInt(2)) // move to epoch 2 suite.evm.Context.BlockNumber = suite.evm.Context.BlockNumber.Add(suite.evm.Context.BlockNumber, daparams.EpochBlocks) suite.makeEpoch(suite.signerOne) @@ -307,10 +309,8 @@ func (suite *DASignersTestSuite) Test_DASigners() { twoPos = min(twoPos, i) } } - suite.Assert().EqualValues(cnt[suite.signerOne], len(quorum)/2) - suite.Assert().EqualValues(cnt[suite.signerTwo], len(quorum)/2) - // suite.Assert().EqualValues(cnt[suite.signerOne], len(quorum)/3) - // suite.Assert().EqualValues(cnt[suite.signerTwo], len(quorum)*2/3) + suite.Assert().EqualValues(cnt[suite.signerOne], len(quorum)/3) + suite.Assert().EqualValues(cnt[suite.signerTwo], len(quorum)*2/3) bitMap := make([]byte, len(quorum)/8) bitMap[onePos/8] |= 1 << (onePos % 8) @@ -321,8 +321,7 @@ func (suite *DASignersTestSuite) Test_DASigners() { }{ AggPkG1: dasigners.NewBN254G1Point(bn254util.SerializeG1(new(bn254.G1Affine).ScalarMultiplication(bn254util.GetG1Generator(), big.NewInt(1)))), Total: big.NewInt(int64(len(quorum))), - Hit: big.NewInt(int64(len(quorum) / 2)), - // Hit: big.NewInt(int64(len(quorum) / 3)), + Hit: big.NewInt(int64(len(quorum) / 3)), }) bitMap[twoPos/8] |= 1 << (twoPos % 8) diff --git a/core/vm/precompiles/dasigners/contract.go b/core/vm/precompiles/dasigners/contract.go index 268c11d70c..083bec8fa9 100644 --- a/core/vm/precompiles/dasigners/contract.go +++ b/core/vm/precompiles/dasigners/contract.go @@ -30,7 +30,7 @@ var ( // DASignersMetaData contains all meta data concerning the DASigners contract. var DASignersMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"makeEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"structIDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"indexed\":false,\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"indexed\":false,\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"name\":\"NewSigner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"}],\"name\":\"SocketUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"epochNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_quorumBitmap\",\"type\":\"bytes\"}],\"name\":\"getAggPkG1\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"aggPkG1\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"hit\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"}],\"name\":\"getQuorum\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorumId\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"_rowIndex\",\"type\":\"uint32\"}],\"name\":\"getQuorumRow\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"_account\",\"type\":\"address[]\"}],\"name\":\"getSigner\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isSigner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"makeEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"params\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"tokensPerVote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVotesPerSigner\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxQuorums\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"epochBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"encodedSlices\",\"type\":\"uint256\"}],\"internalType\":\"structIDASigners.Params\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"quorumCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"}],\"name\":\"registerNextEpoch\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"signer\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"socket\",\"type\":\"string\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"pkG1\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256[2]\",\"name\":\"X\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"Y\",\"type\":\"uint256[2]\"}],\"internalType\":\"structBN254.G2Point\",\"name\":\"pkG2\",\"type\":\"tuple\"}],\"internalType\":\"structIDASigners.SignerDetail\",\"name\":\"_signer\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"X\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"Y\",\"type\":\"uint256\"}],\"internalType\":\"structBN254.G1Point\",\"name\":\"_signature\",\"type\":\"tuple\"}],\"name\":\"registerSigner\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_epoch\",\"type\":\"uint256\"}],\"name\":\"registeredEpoch\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"_socket\",\"type\":\"string\"}],\"name\":\"updateSocket\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // DASignersABI is the input ABI used to generate the binding from. @@ -498,25 +498,25 @@ func (_DASigners *DASignersTransactorSession) MakeEpoch() (*types.Transaction, e return _DASigners.Contract.MakeEpoch(&_DASigners.TransactOpts) } -// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x56a32372. +// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x0f62bda5. // -// Solidity: function registerNextEpoch((uint256,uint256) _signature) returns() -func (_DASigners *DASignersTransactor) RegisterNextEpoch(opts *bind.TransactOpts, _signature BN254G1Point) (*types.Transaction, error) { - return _DASigners.contract.Transact(opts, "registerNextEpoch", _signature) +// Solidity: function registerNextEpoch(address signer, (uint256,uint256) _signature, uint256 votes) returns() +func (_DASigners *DASignersTransactor) RegisterNextEpoch(opts *bind.TransactOpts, signer common.Address, _signature BN254G1Point, votes *big.Int) (*types.Transaction, error) { + return _DASigners.contract.Transact(opts, "registerNextEpoch", signer, _signature, votes) } -// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x56a32372. +// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x0f62bda5. // -// Solidity: function registerNextEpoch((uint256,uint256) _signature) returns() -func (_DASigners *DASignersSession) RegisterNextEpoch(_signature BN254G1Point) (*types.Transaction, error) { - return _DASigners.Contract.RegisterNextEpoch(&_DASigners.TransactOpts, _signature) +// Solidity: function registerNextEpoch(address signer, (uint256,uint256) _signature, uint256 votes) returns() +func (_DASigners *DASignersSession) RegisterNextEpoch(signer common.Address, _signature BN254G1Point, votes *big.Int) (*types.Transaction, error) { + return _DASigners.Contract.RegisterNextEpoch(&_DASigners.TransactOpts, signer, _signature, votes) } -// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x56a32372. +// RegisterNextEpoch is a paid mutator transaction binding the contract method 0x0f62bda5. // -// Solidity: function registerNextEpoch((uint256,uint256) _signature) returns() -func (_DASigners *DASignersTransactorSession) RegisterNextEpoch(_signature BN254G1Point) (*types.Transaction, error) { - return _DASigners.Contract.RegisterNextEpoch(&_DASigners.TransactOpts, _signature) +// Solidity: function registerNextEpoch(address signer, (uint256,uint256) _signature, uint256 votes) returns() +func (_DASigners *DASignersTransactorSession) RegisterNextEpoch(signer common.Address, _signature BN254G1Point, votes *big.Int) (*types.Transaction, error) { + return _DASigners.Contract.RegisterNextEpoch(&_DASigners.TransactOpts, signer, _signature, votes) } // RegisterSigner is a paid mutator transaction binding the contract method 0x7ca4dd5e. diff --git a/core/vm/precompiles/dasigners/types.go b/core/vm/precompiles/dasigners/types.go index 7d76a6e05c..f27b930b2e 100644 --- a/core/vm/precompiles/dasigners/types.go +++ b/core/vm/precompiles/dasigners/types.go @@ -71,12 +71,13 @@ func SerializeG2(p BN254G2Point) []byte { var ( signerKey = []byte{0x00} // signer => registered signer info quorumKey = []byte{0x01} // epoch => quorumId => quorum - registrationKey = []byte{0x02} // signer => signature hash - quorumCountKey = []byte{0x03} // epoch => quorum count - epochNumberKey = []byte{0x04} // epoch number - epochBlockKey = []byte{0x05} // epoch number => block number - epochRegistrationKey = []byte{0x06} // epoch number => registration count - epochRegisteredSignerKey = []byte{0x07} // epoch number => index => signer + registrationKey = []byte{0x02} // epoch => signer => signature(vrf) + votesKey = []byte{0x03} // epoch => signer => votes + quorumCountKey = []byte{0x04} // epoch => quorum count + epochNumberKey = []byte{0x05} // epoch number + epochBlockKey = []byte{0x06} // epoch number => block number + epochRegistrationKey = []byte{0x07} // epoch number => registration count + epochRegisteredSignerKey = []byte{0x08} // epoch number => index => signer ) func SignerKey(account common.Address) common.Hash { @@ -91,6 +92,10 @@ func RegistrationKey(epochNumber uint64, account common.Address) common.Hash { return crypto.Keccak256Hash(append(append(registrationKey, common.Uint64ToBytes(epochNumber)...), account.Bytes()...)) } +func VotesKey(epochNumber uint64, account common.Address) common.Hash { + return crypto.Keccak256Hash(append(append(votesKey, common.Uint64ToBytes(epochNumber)...), account.Bytes()...)) +} + func QuorumCountKey(epochNumber uint64) common.Hash { return crypto.Keccak256Hash(append(quorumCountKey, common.Uint64ToBytes(epochNumber)...)) } diff --git a/core/vm/precompiles/errors.go b/core/vm/precompiles/errors.go index c2b23b44f6..6d0cffd6c1 100644 --- a/core/vm/precompiles/errors.go +++ b/core/vm/precompiles/errors.go @@ -3,5 +3,6 @@ package precompiles import "errors" var ( - ErrSenderNotOrigin = errors.New("sender not origin") + ErrSenderNotOrigin = errors.New("sender not origin") + ErrSenderNotRegistry = errors.New("sender not registry") ) diff --git a/core/vm/precompiles/interfaces/abis/IDASigners.json b/core/vm/precompiles/interfaces/abis/IDASigners.json index d75f52ee55..65054a5d39 100644 --- a/core/vm/precompiles/interfaces/abis/IDASigners.json +++ b/core/vm/precompiles/interfaces/abis/IDASigners.json @@ -336,6 +336,11 @@ }, { "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, { "components": [ { @@ -352,6 +357,11 @@ "internalType": "struct BN254.G1Point", "name": "_signature", "type": "tuple" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" } ], "name": "registerNextEpoch", diff --git a/core/vm/precompiles/interfaces/contracts/IDASigners.sol b/core/vm/precompiles/interfaces/contracts/IDASigners.sol index 050a1a69c6..d17f6d93a8 100644 --- a/core/vm/precompiles/interfaces/contracts/IDASigners.sol +++ b/core/vm/precompiles/interfaces/contracts/IDASigners.sol @@ -24,7 +24,7 @@ interface IDASigners { } struct Params { - uint tokensPerVote; + uint tokensPerVote; // deprecated uint maxVotesPerSigner; uint maxQuorums; uint epochBlocks; @@ -75,7 +75,11 @@ interface IDASigners { uint _epoch ) external view returns (bool); - function registerNextEpoch(BN254.G1Point memory _signature) external; + function registerNextEpoch( + address signer, + BN254.G1Point memory _signature, + uint votes + ) external; function makeEpoch() external; From 18941379eb0724c3b9408662ac5135ed76e0189f Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Wed, 16 Apr 2025 15:06:46 +0800 Subject: [PATCH 11/11] refactor: DA params --- core/vm/dasigners.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/vm/dasigners.go b/core/vm/dasigners.go index eb766345a3..849c7cedfd 100644 --- a/core/vm/dasigners.go +++ b/core/vm/dasigners.go @@ -461,7 +461,7 @@ func (d *DASignersPrecompile) params() dasigners.IDASignersParams { TokensPerVote: big.NewInt(10), // deprecated MaxVotesPerSigner: big.NewInt(1024), MaxQuorums: big.NewInt(10), - EpochBlocks: big.NewInt(5760), + EpochBlocks: big.NewInt(28800), EncodedSlices: big.NewInt(3072), } }