diff --git a/.circleci/config.yml b/.circleci/config.yml index 377657af4e..04dbccdb4b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -248,6 +248,7 @@ end-to-end-test: &end-to-end-test no_output_timeout: 15m command: | export PATH=${PATH}:~/repos/golang/go/bin + export E2E_TESTS_FORCE_USE_MYCELO=true cd celo-monorepo/packages/celotool ./${TEST_NAME} local ~/repos/geth # Note, all e2e tests call 'make all' in ~/repos/geth, this causes most code diff --git a/cmd/uptime/report.go b/cmd/uptime/report.go index ecaddaa4ae..6ce22ca3a2 100644 --- a/cmd/uptime/report.go +++ b/cmd/uptime/report.go @@ -33,9 +33,9 @@ var valSetSizeFlag = cli.Int64Flag{ var reportUptimeCommand = cli.Command{ Name: "report", Usage: "Reports uptime for all validators", - Action: reportUptime, + Action: utils.MigrateFlags(reportUptime), ArgsUsage: "", - Flags: []cli.Flag{epochFlag, lookbackFlag, valSetSizeFlag}, + Flags: []cli.Flag{epochFlag, lookbackFlag, valSetSizeFlag, utils.DataDirFlag}, } // getHeaderByNumber retrieves a block header from the database by number, diff --git a/consensus/istanbul/core/core.go b/consensus/istanbul/core/core.go index a6a02879db..7116763572 100644 --- a/consensus/istanbul/core/core.go +++ b/consensus/istanbul/core/core.go @@ -152,10 +152,6 @@ type core struct { // New creates an Istanbul consensus core func New(backend CoreBackend, config *istanbul.Config) Engine { - rsdb, err := newRoundStateDB(config.RoundStateDBPath, nil) - if err != nil { - log.Crit("Failed to open RoundStateDB", "err", err) - } c := &core{ config: config, @@ -167,7 +163,6 @@ func New(backend CoreBackend, config *istanbul.Config) Engine { pendingRequests: prque.New(nil), pendingRequestsMu: new(sync.Mutex), consensusTimestamp: time.Time{}, - rsdb: rsdb, consensusPrepareTimeGauge: metrics.NewRegisteredGauge("consensus/istanbul/core/consensus_prepare", nil), consensusCommitTimeGauge: metrics.NewRegisteredGauge("consensus/istanbul/core/consensus_commit", nil), verifyGauge: metrics.NewRegisteredGauge("consensus/istanbul/core/verify", nil), diff --git a/consensus/istanbul/core/handler.go b/consensus/istanbul/core/handler.go index ed1ed6b9e1..3482e82e15 100644 --- a/consensus/istanbul/core/handler.go +++ b/consensus/istanbul/core/handler.go @@ -22,11 +22,16 @@ import ( "github.com/celo-org/celo-blockchain/common" "github.com/celo-org/celo-blockchain/common/hexutil" "github.com/celo-org/celo-blockchain/consensus/istanbul" + "github.com/celo-org/celo-blockchain/log" ) // Start implements core.Engine.Start func (c *core) Start() error { - + rsdb, err := newRoundStateDB(c.config.RoundStateDBPath, nil) + if err != nil { + log.Crit("Failed to open RoundStateDB", "err", err) + } + c.rsdb = rsdb roundState, err := c.createRoundState() if err != nil { return err @@ -63,10 +68,11 @@ func (c *core) Stop() error { // Make sure the handler goroutine exits c.handlerWg.Wait() + err := c.rsdb.Close() c.currentMu.Lock() defer c.currentMu.Unlock() c.current = nil - return nil + return err } // ---------------------------------------------------------------------------- diff --git a/contracts/testutil/utils.go b/contracts/testutil/utils.go index d0d93be2dd..7974f20dac 100644 --- a/contracts/testutil/utils.go +++ b/contracts/testutil/utils.go @@ -8,6 +8,13 @@ import ( "github.com/celo-org/celo-blockchain/core/vm" ) +var ( + // When executing the transaction, we expect to send base fee to governance contract. + // Hence, we mock registryMock, registry and register governance without implementation. + RegistryProxyOpcodes = common.FromHex("0x60806040526004361061004a5760003560e01c806303386ba3146101e757806342404e0714610280578063bb913f41146102d7578063d29d44ee14610328578063f7e6af8014610379575b6000600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050600081549050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610136576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4e6f20496d706c656d656e746174696f6e20736574000000000000000000000081525060200191505060405180910390fd5b61013f816103d0565b6101b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c696420636f6e74726163742061646472657373000000000000000081525060200191505060405180910390fd5b60405136810160405236600082376000803683855af43d604051818101604052816000823e82600081146101e3578282f35b8282fd5b61027e600480360360408110156101fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561023a57600080fd5b82018360208201111561024c57600080fd5b8035906020019184600183028401116401000000008311171561026e57600080fd5b909192939192939050505061041b565b005b34801561028c57600080fd5b506102956105c1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e357600080fd5b50610326600480360360208110156102fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061060d565b005b34801561033457600080fd5b506103776004803603602081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107bd565b005b34801561038557600080fd5b5061038e610871565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f915080821415801561041257506000801b8214155b92505050919050565b610423610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b6104cc8361060d565b600060608473ffffffffffffffffffffffffffffffffffffffff168484604051808383808284378083019250505092505050600060405180830381855af49150503d8060008114610539576040519150601f19603f3d011682016040523d82523d6000602084013e61053e565b606091505b508092508193505050816105ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f696e697469616c697a6174696f6e2063616c6c6261636b206661696c6564000081525060200191505060405180910390fd5b5050505050565b600080600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050805491505090565b610615610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b6000600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050610701826103d0565b610773576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c696420636f6e74726163742061646472657373000000000000000081525060200191505060405180910390fd5b8181558173ffffffffffffffffffffffffffffffffffffffff167fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1360405160405180910390a25050565b6107c5610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610865576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b61086e816108bd565b50565b600080600160405180807f656970313936372e70726f78792e61646d696e000000000000000000000000008152506013019050604051809103902060001c0360001b9050805491505090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610960576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f6f776e65722063616e6e6f74206265203000000000000000000000000000000081525060200191505060405180910390fd5b6000600160405180807f656970313936372e70726f78792e61646d696e000000000000000000000000008152506013019050604051809103902060001c0360001b90508181558173ffffffffffffffffffffffffffffffffffffffff167f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe260405160405180910390a2505056fea165627a7a72305820f4f741dbef8c566cb1690ae708b8ef1113bdb503225629cc1f9e86bd47efd1a40029") + RegistryOpcodes = common.FromHex("0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638932cbf41161008c578063c586579311610066578063c586579314610407578063dcf0aaed146104a0578063dd9272331461050e578063f2fde38b1461057c576100cf565b80638932cbf4146102e25780638da5cb5b1461039b5780638f32d59b146103e5576100cf565b8063158ef93e146100d457806317c50818146100f6578063715018a6146101a75780637ef50298146101b15780638129fc1c1461021f578063853db32314610229575b600080fd5b6100dc6105c0565b604051808215151515815260200191505060405180910390f35b61018d6004803603604081101561010c57600080fd5b810190808035906020019064010000000081111561012957600080fd5b82018360208201111561013b57600080fd5b8035906020019184602083028401116401000000008311171561015d57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105d3565b604051808215151515815260200191505060405180910390f35b6101af610691565b005b6101dd600480360360208110156101c757600080fd5b81019080803590602001909291905050506107ca565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102276107fd565b005b6102a06004803603602081101561023f57600080fd5b810190808035906020019064010000000081111561025c57600080fd5b82018360208201111561026e57600080fd5b8035906020019184600183028401116401000000008311171561029057600080fd5b90919293919293905050506108a6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610359600480360360208110156102f857600080fd5b810190808035906020019064010000000081111561031557600080fd5b82018360208201111561032757600080fd5b8035906020019184600183028401116401000000008311171561034957600080fd5b9091929391929390505050610918565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a3610a60565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103ed610a89565b604051808215151515815260200191505060405180910390f35b61049e6004803603604081101561041d57600080fd5b810190808035906020019064010000000081111561043a57600080fd5b82018360208201111561044c57600080fd5b8035906020019184600183028401116401000000008311171561046e57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae7565b005b6104cc600480360360208110156104b657600080fd5b8101908080359060200190929190505050610c68565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61053a6004803603602081101561052457600080fd5b8101908080359060200190929190505050610d7a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105be6004803603602081101561059257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610db7565b005b600060149054906101000a900460ff1681565b600080600090505b84849050811015610684578273ffffffffffffffffffffffffffffffffffffffff166001600087878581811061060d57fe5b90506020020135815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561066957600191505061068a565b61067d600182610e3d90919063ffffffff16565b90506105db565b50600090505b9392505050565b610699610a89565b61070b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060149054906101000a900460ff1615610880576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f636f6e747261637420616c726561647920696e697469616c697a65640000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055506108a433610ec5565b565b60008083836040516020018083838082843780830192505050925050506040516020818303038152906040528051906020012090506001600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505092915050565b6000808383604051602001808383808284378083019250505092505050604051602081830303815290604052805190602001209050600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6964656e74696669657220686173206e6f20726567697374727920656e74727981525060200191505060405180910390fd5b6001600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610acb611009565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b610aef610a89565b610b61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008383604051602001808383808284378083019250505092505050604051602081830303815290604052805190602001209050816001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817f4166d073a7a5e704ce0db7113320f88da2457f872d46dc020c805c562c1582a0868660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a350505050565b60008073ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6964656e74696669657220686173206e6f20726567697374727920656e74727981525060200191505060405180910390fd5b6001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b610dbf610a89565b610e31576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e3a81610ec5565b50565b600080828401905083811015610ebb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f4b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806110126026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60003390509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a7231582021f804e21a59bd673149265b250bf50ab40b86b057ee8f9aeab3d3c904a82cdc64736f6c634300050d0032") +) + // decapitalise makes a camel-case string which starts with a lower case character. func decapitalise(input string) string { if len(input) == 0 { diff --git a/core/blockchain.go b/core/blockchain.go index 1d04b28b19..f1b6be4b0b 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1174,7 +1174,21 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [ // Rewind may have occurred, skip in that case. if bc.CurrentHeader().Number.Cmp(head.Number()) >= 0 { currentFastBlock, td := bc.CurrentFastBlock(), bc.GetTd(head.Hash(), head.NumberU64()) - if bc.GetTd(currentFastBlock.Hash(), currentFastBlock.NumberU64()).Cmp(td) < 0 { + fastBlockTd := bc.GetTd(currentFastBlock.Hash(), currentFastBlock.NumberU64()) + + // These two should not be nil under normal circumstances, + // but it apparently can happen in edge cases. See + // https://github.com/celo-org/celo-blockchain/issues/1920 + if fastBlockTd == nil { + log.Warn("InsertReceiptChain: fastBlockTd is nil") + return false + } + if td == nil { + log.Warn("InsertReceiptChain: td is nil") + return false + } + + if fastBlockTd.Cmp(td) < 0 { rawdb.WriteHeadFastBlockHash(bc.db, head.Hash()) bc.currentFastBlock.Store(head) headFastBlockGauge.Update(int64(head.NumberU64())) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 0fb050cbd9..349f65de5a 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -29,6 +29,7 @@ import ( "github.com/celo-org/celo-blockchain/common" "github.com/celo-org/celo-blockchain/consensus" mockEngine "github.com/celo-org/celo-blockchain/consensus/consensustest" + "github.com/celo-org/celo-blockchain/contracts/testutil" "github.com/celo-org/celo-blockchain/core/rawdb" "github.com/celo-org/celo-blockchain/core/state" "github.com/celo-org/celo-blockchain/core/types" @@ -2961,19 +2962,14 @@ func TestEIP2718Transition(t *testing.T) { // TestEIP1559Transition tests the following: // -// 1. A transaction whose gasFeeCap is greater than the baseFee is valid. -// 2. Gas accounting for access lists on EIP-1559 transactions is correct. -// 3. Only the transaction's tip will be received by the coinbase. -// 4. The transaction sender pays for both the tip and baseFee. -// 5. The coinbase receives only the partially realized tip when -// gasFeeCap - gasTipCap < baseFee. -// 6. Legacy transaction behave as expected (e.g. gasPrice = gasFeeCap = gasTipCap). +// 1. A transaction whose gasFeeCap is greater than the baseFee is valid. +// 2. Gas accounting for access lists on EIP-1559 transactions is correct. +// 3. Only the transaction's tip will be received by the coinbase. +// 4. The transaction sender pays for both the tip and baseFee. +// 5. The coinbase receives only the partially realized tip when +// gasFeeCap - gasTipCap < baseFee. +// 6. Legacy transaction behave as expected (e.g. gasPrice = gasFeeCap = gasTipCap). func TestEIP1559Transition(t *testing.T) { - // When executing the transaction, we expect to send base fee to governance contract. - // Hence, we mock registryMock, registry and register governance without implementation. - RegistryProxyOpcodes := common.FromHex("0x60806040526004361061004a5760003560e01c806303386ba3146101e757806342404e0714610280578063bb913f41146102d7578063d29d44ee14610328578063f7e6af8014610379575b6000600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050600081549050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610136576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4e6f20496d706c656d656e746174696f6e20736574000000000000000000000081525060200191505060405180910390fd5b61013f816103d0565b6101b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c696420636f6e74726163742061646472657373000000000000000081525060200191505060405180910390fd5b60405136810160405236600082376000803683855af43d604051818101604052816000823e82600081146101e3578282f35b8282fd5b61027e600480360360408110156101fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561023a57600080fd5b82018360208201111561024c57600080fd5b8035906020019184600183028401116401000000008311171561026e57600080fd5b909192939192939050505061041b565b005b34801561028c57600080fd5b506102956105c1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e357600080fd5b50610326600480360360208110156102fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061060d565b005b34801561033457600080fd5b506103776004803603602081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107bd565b005b34801561038557600080fd5b5061038e610871565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f915080821415801561041257506000801b8214155b92505050919050565b610423610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b6104cc8361060d565b600060608473ffffffffffffffffffffffffffffffffffffffff168484604051808383808284378083019250505092505050600060405180830381855af49150503d8060008114610539576040519150601f19603f3d011682016040523d82523d6000602084013e61053e565b606091505b508092508193505050816105ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f696e697469616c697a6174696f6e2063616c6c6261636b206661696c6564000081525060200191505060405180910390fd5b5050505050565b600080600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050805491505090565b610615610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b6000600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050610701826103d0565b610773576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c696420636f6e74726163742061646472657373000000000000000081525060200191505060405180910390fd5b8181558173ffffffffffffffffffffffffffffffffffffffff167fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1360405160405180910390a25050565b6107c5610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610865576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b61086e816108bd565b50565b600080600160405180807f656970313936372e70726f78792e61646d696e000000000000000000000000008152506013019050604051809103902060001c0360001b9050805491505090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610960576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f6f776e65722063616e6e6f74206265203000000000000000000000000000000081525060200191505060405180910390fd5b6000600160405180807f656970313936372e70726f78792e61646d696e000000000000000000000000008152506013019050604051809103902060001c0360001b90508181558173ffffffffffffffffffffffffffffffffffffffff167f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe260405160405180910390a2505056fea165627a7a72305820f4f741dbef8c566cb1690ae708b8ef1113bdb503225629cc1f9e86bd47efd1a40029") - RegistryOpcodes := common.FromHex("0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638932cbf41161008c578063c586579311610066578063c586579314610407578063dcf0aaed146104a0578063dd9272331461050e578063f2fde38b1461057c576100cf565b80638932cbf4146102e25780638da5cb5b1461039b5780638f32d59b146103e5576100cf565b8063158ef93e146100d457806317c50818146100f6578063715018a6146101a75780637ef50298146101b15780638129fc1c1461021f578063853db32314610229575b600080fd5b6100dc6105c0565b604051808215151515815260200191505060405180910390f35b61018d6004803603604081101561010c57600080fd5b810190808035906020019064010000000081111561012957600080fd5b82018360208201111561013b57600080fd5b8035906020019184602083028401116401000000008311171561015d57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105d3565b604051808215151515815260200191505060405180910390f35b6101af610691565b005b6101dd600480360360208110156101c757600080fd5b81019080803590602001909291905050506107ca565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102276107fd565b005b6102a06004803603602081101561023f57600080fd5b810190808035906020019064010000000081111561025c57600080fd5b82018360208201111561026e57600080fd5b8035906020019184600183028401116401000000008311171561029057600080fd5b90919293919293905050506108a6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610359600480360360208110156102f857600080fd5b810190808035906020019064010000000081111561031557600080fd5b82018360208201111561032757600080fd5b8035906020019184600183028401116401000000008311171561034957600080fd5b9091929391929390505050610918565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a3610a60565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103ed610a89565b604051808215151515815260200191505060405180910390f35b61049e6004803603604081101561041d57600080fd5b810190808035906020019064010000000081111561043a57600080fd5b82018360208201111561044c57600080fd5b8035906020019184600183028401116401000000008311171561046e57600080fd5b9091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae7565b005b6104cc600480360360208110156104b657600080fd5b8101908080359060200190929190505050610c68565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61053a6004803603602081101561052457600080fd5b8101908080359060200190929190505050610d7a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105be6004803603602081101561059257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610db7565b005b600060149054906101000a900460ff1681565b600080600090505b84849050811015610684578273ffffffffffffffffffffffffffffffffffffffff166001600087878581811061060d57fe5b90506020020135815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561066957600191505061068a565b61067d600182610e3d90919063ffffffff16565b90506105db565b50600090505b9392505050565b610699610a89565b61070b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060149054906101000a900460ff1615610880576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f636f6e747261637420616c726561647920696e697469616c697a65640000000081525060200191505060405180910390fd5b6001600060146101000a81548160ff0219169083151502179055506108a433610ec5565b565b60008083836040516020018083838082843780830192505050925050506040516020818303038152906040528051906020012090506001600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505092915050565b6000808383604051602001808383808284378083019250505092505050604051602081830303815290604052805190602001209050600073ffffffffffffffffffffffffffffffffffffffff166001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6964656e74696669657220686173206e6f20726567697374727920656e74727981525060200191505060405180910390fd5b6001600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610acb611009565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b610aef610a89565b610b61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008383604051602001808383808284378083019250505092505050604051602081830303815290604052805190602001209050816001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff16817f4166d073a7a5e704ce0db7113320f88da2457f872d46dc020c805c562c1582a0868660405180806020018281038252848482818152602001925080828437600081840152601f19601f820116905080830192505050935050505060405180910390a350505050565b60008073ffffffffffffffffffffffffffffffffffffffff166001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610d3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6964656e74696669657220686173206e6f20726567697374727920656e74727981525060200191505060405180910390fd5b6001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b610dbf610a89565b610e31576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e3a81610ec5565b50565b600080828401905083811015610ebb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f4b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806110126026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60003390509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a7231582021f804e21a59bd673149265b250bf50ab40b86b057ee8f9aeab3d3c904a82cdc64736f6c634300050d0032") - var ( aa = common.HexToAddress("0x000000000000000000000000000000000000aaaa") @@ -3004,7 +3000,7 @@ func TestEIP1559Transition(t *testing.T) { Balance: big.NewInt(0), }, common.HexToAddress("0xce10"): { // Registry Proxy - Code: RegistryProxyOpcodes, + Code: testutil.RegistryProxyOpcodes, Storage: map[common.Hash]common.Hash{ common.HexToHash("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"): common.HexToHash("0xce11"), // Registry Implementation common.HexToHash("0x91646b8507bf2e54d7c3de9155442ba111546b81af1cbdd1f68eeb6926b98d58"): common.HexToHash("0xd023"), // Governance Proxy @@ -3012,7 +3008,7 @@ func TestEIP1559Transition(t *testing.T) { Balance: big.NewInt(0), }, common.HexToAddress("0xce11"): { // Registry Implementation - Code: RegistryOpcodes, + Code: testutil.RegistryOpcodes, Balance: big.NewInt(0), }, }, diff --git a/core/chain_makers.go b/core/chain_makers.go index 1476523f8c..134c1f0301 100644 --- a/core/chain_makers.go +++ b/core/chain_makers.go @@ -178,6 +178,10 @@ func (b *BlockGen) OffsetTime(seconds int64) { } } +func (b *BlockGen) Config() *params.ChainConfig { + return b.config +} + // GenerateChain creates a chain of n blocks. The first block's // parent will be the provided parent. db is used to store // intermediate states and should contain the parent's state trie. diff --git a/e2e_test/e2e_test.go b/e2e_test/e2e_test.go index 2282cd4cdf..5d528b267e 100644 --- a/e2e_test/e2e_test.go +++ b/e2e_test/e2e_test.go @@ -196,6 +196,14 @@ func TestStartStopValidators(t *testing.T) { err = network[2].Start() require.NoError(t, err) + // We need to wait here to allow the call to "Backend.RefreshValPeers" to + // complete before adding peers. This is because "Backend.RefreshValPeers" + // deletes all peers and then re-adds any peers from the cached + // connections, but in the case that peers were recently added there may + // not have been enough time to connect to them and populate the connection + // cache, and in that case "Backend.RefreshValPeers" simply removes all the + // peers. + time.Sleep(250 * time.Millisecond) // Connect last stopped node to running nodes network[2].AddPeers(network[:2]...) time.Sleep(25 * time.Millisecond) @@ -221,6 +229,14 @@ func TestStartStopValidators(t *testing.T) { err = network[3].Start() require.NoError(t, err) + // We need to wait here to allow the call to "Backend.RefreshValPeers" to + // complete before adding peers. This is because "Backend.RefreshValPeers" + // deletes all peers and then re-adds any peers from the cached + // connections, but in the case that peers were recently added there may + // not have been enough time to connect to them and populate the connection + // cache, and in that case "Backend.RefreshValPeers" simply removes all the + // peers. + time.Sleep(250 * time.Millisecond) // Connect final node to rest of network network[3].AddPeers(network[:3]...) time.Sleep(25 * time.Millisecond) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 7e240e6829..ba96e75dc5 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -23,6 +23,7 @@ import ( "errors" "fmt" "io/ioutil" + "math/big" "os" "runtime" "sync" @@ -275,13 +276,16 @@ func (api *API) traceChain(ctx context.Context, start, end *types.Block, config for task := range tasks { signer := types.MakeSigner(api.backend.ChainConfig(), task.block.Number()) blockCtx := core.NewEVMBlockContext(task.block.Header(), api.chainContext(localctx), nil) + + isEspresso := api.backend.ChainConfig().IsEspresso(blockCtx.BlockNumber) var sysCtx *core.SysContractCallCtx - if api.backend.ChainConfig().IsEspresso(blockCtx.BlockNumber) { + if isEspresso { sysCtx = core.NewSysContractCallCtx(task.block.Header(), task.statedb, api.backend) } // Trace all the transactions contained within for i, tx := range task.block.Transactions() { - msg, _ := tx.AsMessage(signer, nil) + baseFee := getBaseFee(isEspresso, sysCtx, tx.FeeCurrency()) + msg, _ := tx.AsMessage(signer, baseFee) txctx := &Context{ BlockHash: task.block.Hash(), TxIndex: i, @@ -525,14 +529,16 @@ func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config vmctx = core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil) deleteEmptyObjects = chainConfig.IsEIP158(block.Number()) ) + isEspresso := api.backend.ChainConfig().IsEspresso(block.Number()) var sysCtx *core.SysContractCallCtx - if api.backend.ChainConfig().IsEspresso(block.Number()) { + if isEspresso { sysCtx = core.NewSysContractCallCtx(block.Header(), statedb, api.backend) } vmRunner := api.backend.NewEVMRunner(block.Header(), statedb) for i, tx := range block.Transactions() { var ( - msg, _ = tx.AsMessage(signer, nil) + baseFee = getBaseFee(isEspresso, sysCtx, tx.FeeCurrency()) + msg, _ = tx.AsMessage(signer, baseFee) txContext = core.NewEVMTxContext(msg) vmenv = vm.NewEVM(vmctx, txContext, statedb, chainConfig, vm.Config{}) ) @@ -599,8 +605,10 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac } blockCtx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil) blockHash := block.Hash() + + isEspresso := api.backend.ChainConfig().IsEspresso(block.Number()) var sysCtx *core.SysContractCallCtx - if api.backend.ChainConfig().IsEspresso(block.Number()) { + if isEspresso { sysCtx = core.NewSysContractCallCtx(block.Header(), statedb, api.backend) } for th := 0; th < threads; th++ { @@ -609,7 +617,8 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac defer pend.Done() // Fetch and execute the next transaction trace tasks for task := range jobs { - msg, _ := txs[task.index].AsMessage(signer, nil) + baseFee := getBaseFee(isEspresso, sysCtx, txs[task.index].FeeCurrency()) + msg, _ := txs[task.index].AsMessage(signer, baseFee) txctx := &Context{ BlockHash: blockHash, TxIndex: task.index, @@ -633,7 +642,8 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac jobs <- &txTraceTask{statedb: statedb.Copy(), index: i} // Generate the next state snapshot fast without tracing - msg, _ := tx.AsMessage(signer, nil) + baseFee := getBaseFee(isEspresso, sysCtx, tx.FeeCurrency()) + msg, _ := tx.AsMessage(signer, baseFee) statedb.Prepare(tx.Hash(), i) vmenv := vm.NewEVM(blockCtx, core.NewEVMTxContext(msg), statedb, api.backend.ChainConfig(), vm.Config{}) if _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(msg.Gas()), vmRunner, sysCtx); err != nil { @@ -714,14 +724,17 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block canon = false } } + + isEspresso := api.backend.ChainConfig().IsEspresso(block.Number()) var sysCtx *core.SysContractCallCtx - if api.backend.ChainConfig().IsEspresso(block.Number()) { + if isEspresso { sysCtx = core.NewSysContractCallCtx(block.Header(), statedb, api.backend) } for i, tx := range block.Transactions() { - // Prepare the trasaction for un-traced execution + // Prepare the transaction for un-traced execution var ( - msg, _ = tx.AsMessage(signer, nil) + baseFee = getBaseFee(isEspresso, sysCtx, tx.FeeCurrency()) + msg, _ = tx.AsMessage(signer, baseFee) txContext = core.NewEVMTxContext(msg) vmConf vm.Config dump *os.File @@ -776,6 +789,14 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block return dumps, nil } +func getBaseFee(isEspresso bool, sysCtx *core.SysContractCallCtx, feeCurrency *common.Address) *big.Int { + var baseFee *big.Int + if isEspresso { + baseFee = sysCtx.GetGasPriceMinimum(feeCurrency) + } + return baseFee +} + // containsTx reports whether the transaction with a certain hash // is contained within the specified block. func containsTx(block *types.Block, hash common.Hash) bool { diff --git a/eth/tracers/api_test.go b/eth/tracers/api_test.go index 525997ff57..b0471e3863 100644 --- a/eth/tracers/api_test.go +++ b/eth/tracers/api_test.go @@ -60,8 +60,13 @@ type testBackend struct { } func newTestBackend(t *testing.T, n int, gspec *core.Genesis, generator func(i int, b *core.BlockGen)) *testBackend { + chainConfig := params.TestChainConfig + if gspec.Config != nil { + chainConfig = gspec.Config + } + chainConfig.Faker = true backend := &testBackend{ - chainConfig: params.TestChainConfig, + chainConfig: chainConfig, engine: mockEngine.NewFaker(), chaindb: rawdb.NewMemoryDatabase(), } @@ -601,6 +606,82 @@ func TestTraceBlock(t *testing.T) { } } +// Regression test for https://github.com/celo-org/celo-blockchain/issues/2002 +// The tracer module didn't correctly calculate gas prices when EIP1559 style +// transactions are used. +func TestTraceBlockWithEIP1559Tx(t *testing.T) { + // Initialize test accounts + accounts := newAccounts(2) + genesis := &core.Genesis{ + Config: params.IstanbulEHFTestChainConfig, + Alloc: core.GenesisAlloc{ + accounts[0].addr: {Balance: big.NewInt(231001)}, + accounts[1].addr: {Balance: common.Big0}, + common.HexToAddress("0xce10"): { // Registry Proxy + Code: testutil.RegistryProxyOpcodes, + Storage: map[common.Hash]common.Hash{ + common.HexToHash("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"): common.HexToHash("0xce11"), // Registry Implementation + common.HexToHash("0x91646b8507bf2e54d7c3de9155442ba111546b81af1cbdd1f68eeb6926b98d58"): common.HexToHash("0xd023"), // Governance Proxy + }, + Balance: big.NewInt(0), + }, + common.HexToAddress("0xce11"): { // Registry Implementation + Code: testutil.RegistryOpcodes, + Balance: big.NewInt(0), + }, + }, + } + + api := NewAPI(newTestBackend(t, 1, genesis, func(i int, b *core.BlockGen) { + // The block base fee is mocked to be 3 + // Two transactions are build, so that the correct gas price is 5 (base fee of 3 + tip of 2), but the + // incorrect calculation leads to a gas price of 6. + // The account balance is chosen in a way that the second transaction won't be able to execute if the + // calculation is wrong. + + bf := core.MockSysContractCallCtx().GetGasPriceMinimum(nil) + tip := big.NewInt(2) + cap := new(big.Int).Set(common.Big1) + cap = cap.Add(cap, tip).Add(cap, bf) + + txdata1 := types.NewTx(&types.CeloDynamicFeeTx{ + ChainID: b.Config().ChainID, + Nonce: 0, + GasTipCap: tip, + GasFeeCap: cap, + Gas: 21_000, + To: &accounts[1].addr, + }) + tx1, _ := types.SignTx( + txdata1, + types.LatestSignerForChainID(b.Config().ChainID), + accounts[0].key, + ) + b.AddTx(tx1) + + txdata2 := types.NewTx(&types.CeloDynamicFeeTx{ + ChainID: b.Config().ChainID, + Nonce: 1, + GasTipCap: tip, + GasFeeCap: cap, + Gas: 21_000, + To: &accounts[1].addr, + }) + tx2, _ := types.SignTx( + txdata2, + types.LatestSignerForChainID(b.Config().ChainID), + accounts[0].key, + ) + b.AddTx(tx2) + })) + + // Run tracing, this should not throw + _, err := api.TraceBlockByNumber(context.Background(), rpc.LatestBlockNumber, nil) + if err != nil { + t.Errorf("Expect no error, get %v", err) + } +} + type Account struct { key *ecdsa.PrivateKey addr common.Address diff --git a/go.mod b/go.mod index 420b7fa275..82c5f6729c 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/btcsuite/btcd v0.20.1-beta github.com/btcsuite/btcutil v1.0.2 github.com/buraksezer/consistent v0.0.0-20191006190839-693edf70fd72 - github.com/celo-org/celo-bls-go v0.3.3 + github.com/celo-org/celo-bls-go v0.3.4 github.com/cespare/cp v0.1.0 github.com/cespare/xxhash/v2 v2.1.1 github.com/cloudflare/cloudflare-go v0.14.0 diff --git a/go.sum b/go.sum index 26881272b7..3500ea0ad1 100644 --- a/go.sum +++ b/go.sum @@ -121,21 +121,20 @@ github.com/buraksezer/consistent v0.0.0-20191006190839-693edf70fd72 h1:fUmDBbSvv github.com/buraksezer/consistent v0.0.0-20191006190839-693edf70fd72/go.mod h1:OEE5igu/CDjGegM1Jn6ZMo7R6LlV/JChAkjfQQIRLpg= github.com/c-bata/go-prompt v0.2.2 h1:uyKRz6Z6DUyj49QVijyM339UJV9yhbr70gESwbNU3e0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= -github.com/celo-org/celo-bls-go v0.3.3 h1:kOkm/BeM0YwHWUTwSLprxhk1IFq/ZjaWVtW6jTZ0+ys= -github.com/celo-org/celo-bls-go v0.3.3/go.mod h1:eoMAORYWgZ5HOo3Z0bIAv/nbPtj/eArIO0nh7XFx7rk= -github.com/celo-org/celo-bls-go-android v0.3.2 h1:pa6T14NUaf5S1vkq+90gya4ckVLefl4YtUhQKi22wvI= -github.com/celo-org/celo-bls-go-android v0.3.2/go.mod h1:cFgtFRH8+6x5b+EyG5SqniXY3aKd03NBSGDgITscX34= -github.com/celo-org/celo-bls-go-ios v0.3.2 h1:xR+3h80nyB1jRZB7GUChHpX93+iDIywH0qeGhWiZ/6w= -github.com/celo-org/celo-bls-go-ios v0.3.2/go.mod h1:eaSoMpx29YV5oF7jXVChzJpNfxeZHnAa8G4PjL5CyW0= -github.com/celo-org/celo-bls-go-linux v0.3.2 h1:je4JIot91S9uPLvh0D2mK3yxbE9VynGhEP56nmer0l4= -github.com/celo-org/celo-bls-go-linux v0.3.2/go.mod h1:DVpJadg22OrxBtMb0ub6iNVdqDBL/r6EDdWVAA0bHa0= -github.com/celo-org/celo-bls-go-macos v0.3.2 h1:S5C3kwXXiPlS4pPRr3t7nDeyJVo5lSFMzhfUEaHlg6I= -github.com/celo-org/celo-bls-go-macos v0.3.2/go.mod h1:mYPuRqGMVxj6yZUeL6Q6ggtP52HPBS1jz+FvBPXQ7QA= -github.com/celo-org/celo-bls-go-other v0.3.2 h1:Onbcv1FkNl/1TfBI/AfedzTCGAlChOOPEcEvPnE99M4= -github.com/celo-org/celo-bls-go-other v0.3.2/go.mod h1:tNxZNfekzyT7TdYQbyNPhkfpcYtA3KCU/IKX5FNxM/U= -github.com/celo-org/celo-bls-go-windows v0.3.2 h1:HpauxEhxeGedvsfZC4aBo8ADlNstihm1gKnVQMmdxuY= -github.com/celo-org/celo-bls-go-windows v0.3.2/go.mod h1:82GC5iJA9Qw5gynhYqR8ht3J+l/MO8eSNzgSTMI8UdA= -github.com/celo-org/mobile v0.0.0-20210324213558-66ac87d7fb95 h1:X0tWCNjfHVI3NkXhfHPXdQA/Hdi4XexGDER9QPh3V9A= +github.com/celo-org/celo-bls-go v0.3.4 h1:slNePT/gVjgUi7f8M4KTwBz/YYgv3JWU6XqyY0xKN84= +github.com/celo-org/celo-bls-go v0.3.4/go.mod h1:qDZHMC3bBqOw5qle28cRtKlEyJhslZtckcc2Tomqdks= +github.com/celo-org/celo-bls-go-android v0.3.3 h1:iZ2Gragn3JItkptmppeq1SENmNVc1f1W25UE4u231HY= +github.com/celo-org/celo-bls-go-android v0.3.3/go.mod h1:cFgtFRH8+6x5b+EyG5SqniXY3aKd03NBSGDgITscX34= +github.com/celo-org/celo-bls-go-ios v0.3.3 h1:/yHaEYft9WfXyPIGuJz7V2/r+tp2IqSpkvKsMsVgbuY= +github.com/celo-org/celo-bls-go-ios v0.3.3/go.mod h1:eaSoMpx29YV5oF7jXVChzJpNfxeZHnAa8G4PjL5CyW0= +github.com/celo-org/celo-bls-go-linux v0.3.3 h1:ukSQSIRyFCQeC1i7LJJunRKvlLuG1JMwNZ6DQZC51fE= +github.com/celo-org/celo-bls-go-linux v0.3.3/go.mod h1:DVpJadg22OrxBtMb0ub6iNVdqDBL/r6EDdWVAA0bHa0= +github.com/celo-org/celo-bls-go-macos v0.3.3 h1:H4ZGc+kS3e/w9Q6qru6FtlkYtVDS8eIQgw6UURB/Jlo= +github.com/celo-org/celo-bls-go-macos v0.3.3/go.mod h1:mYPuRqGMVxj6yZUeL6Q6ggtP52HPBS1jz+FvBPXQ7QA= +github.com/celo-org/celo-bls-go-other v0.3.3 h1:/Q9SLJK22hibPm/WI/OPxbBmgXTgUhjUgobfzz7qj/w= +github.com/celo-org/celo-bls-go-other v0.3.3/go.mod h1:tNxZNfekzyT7TdYQbyNPhkfpcYtA3KCU/IKX5FNxM/U= +github.com/celo-org/celo-bls-go-windows v0.3.3 h1:0IP+Ad9l+op50TIfkmFr+j7+TIjKksVROe+EoF7Ixa4= +github.com/celo-org/celo-bls-go-windows v0.3.3/go.mod h1:82GC5iJA9Qw5gynhYqR8ht3J+l/MO8eSNzgSTMI8UdA= github.com/celo-org/mobile v0.0.0-20210324213558-66ac87d7fb95/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= diff --git a/graphql/graphql.go b/graphql/graphql.go index 35b162afaa..4ee8b1de19 100644 --- a/graphql/graphql.go +++ b/graphql/graphql.go @@ -228,9 +228,9 @@ func (t *Transaction) GasPrice(ctx context.Context) (hexutil.Big, error) { switch tx.Type() { case types.AccessListTxType: return hexutil.Big(*tx.GasPrice()), nil - case types.DynamicFeeTxType: + case types.DynamicFeeTxType, types.CeloDynamicFeeTxType: if t.block != nil { - if baseFee, _ := t.block.BaseFeePerGas(ctx); baseFee != nil { + if baseFee, _ := t.block.BaseFeePerGasForCurrency(ctx, tx.FeeCurrency()); baseFee != nil { // price = min(tip, gasFeeCap - baseFee) + baseFee return (hexutil.Big)(*math.BigMin(new(big.Int).Add(tx.GasTipCap(), baseFee.ToInt()), tx.GasFeeCap())), nil } @@ -246,16 +246,16 @@ func (t *Transaction) EffectiveGasPrice(ctx context.Context) (*hexutil.Big, erro if err != nil || tx == nil { return nil, err } - header, err := t.block.resolveHeader(ctx) - if err != nil || header == nil { - return nil, err + switch tx.Type() { + case types.DynamicFeeTxType, types.CeloDynamicFeeTxType: + if t.block != nil { + if baseFee, _ := t.block.BaseFeePerGasForCurrency(ctx, tx.FeeCurrency()); baseFee != nil { + // price = min(tip, gasFeeCap - baseFee) + baseFee + return (*hexutil.Big)(math.BigMin(new(big.Int).Add(tx.GasTipCap(), baseFee.ToInt()), tx.GasFeeCap())), nil + } + } } - return (*hexutil.Big)(tx.GasPrice()), nil - // TODO: Substitute GPM - // if header.BaseFee == nil { - // return (*hexutil.Big)(tx.GasPrice()), nil - // } - // return (*hexutil.Big)(math.BigMin(new(big.Int).Add(tx.GasTipCap(), header.BaseFee), tx.GasFeeCap())), nil + return nil, nil } func (t *Transaction) MaxFeePerGas(ctx context.Context) (*hexutil.Big, error) { @@ -579,18 +579,23 @@ func (b *Block) GasUsed(ctx context.Context) (Long, error) { return Long(header.GasUsed), nil } -// TODO: Enable GasLimit graphQL interface - func (b *Block) BaseFeePerGas(ctx context.Context) (*hexutil.Big, error) { - // header, err := b.resolveHeader(ctx) - // if err != nil { - // return nil, err - // } - // if header.BaseFee == nil { - // return nil, nil - // } - // return (*hexutil.Big)(header.BaseFee), nil - return nil, nil + // To have an external API as compatible to geth as possible, we return the + // base for celo gold, here. We can add a separate variable for the base + // fees for each currency. + return b.BaseFeePerGasForCurrency(ctx, nil) +} + +func (b *Block) BaseFeePerGasForCurrency(ctx context.Context, feeCurrency *common.Address) (*hexutil.Big, error) { + header, err := b.resolveHeader(ctx) + if err != nil { + return nil, err + } + baseFee, err := b.backend.GasPriceMinimumForHeader(ctx, feeCurrency, header) + if err != nil { + return nil, err + } + return (*hexutil.Big)(baseFee), nil } func (b *Block) Parent(ctx context.Context) (*Block, error) { diff --git a/graphql/graphql_test.go b/graphql/graphql_test.go index 8c92f2fae4..f145f954a7 100644 --- a/graphql/graphql_test.go +++ b/graphql/graphql_test.go @@ -161,6 +161,43 @@ func TestGraphQLBlockSerialization(t *testing.T) { } } +// Tests that a graphQL request is successfully handled when graphql is enabled on the specified endpoint +func TestGraphQLTransactionSerialization(t *testing.T) { + stack := createNode(t, true, true) + defer stack.Close() + // start node + if err := stack.Start(); err != nil { + t.Fatalf("could not start node: %v", err) + } + + for i, tt := range []struct { + body string + want string + code int + }{ + { + body: `{"query":"{ transaction(hash: \"0x22f565cfeb33d5e6f81c8923ef0633a49fef0848a089a6d8564b655d5605fb13\") { gas gasUsed gasPrice maxFeePerGas maxPriorityFeePerGas effectiveGasPrice index from { address } to { address } value inputData block { transactionCount baseFeePerGas } status type }}"}`, + want: `{"data":{"transaction":{"gas":"0xc350","gasUsed":22604,"gasPrice":"0xa","maxFeePerGas":"0x7530","maxPriorityFeePerGas":"0xa","effectiveGasPrice":"0xa","index":2,"from":{"address":"0x71562b71999873db5b286df957af199ec94617f7"},"to":{"address":"0x0000000000000000000000000000000000000dad"},"value":"0x32","inputData":"0x","block":{"transactionCount":3,"baseFeePerGas":"0x0"},"status":1,"type":2}}}`, + code: 200, + }, + } { + resp, err := http.Post(fmt.Sprintf("%s/graphql", stack.HTTPEndpoint()), "application/json", strings.NewReader(tt.body)) + if err != nil { + t.Fatalf("could not post: %v", err) + } + bodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("could not read from response body: %v", err) + } + if have := string(bodyBytes); have != tt.want { + t.Errorf("testcase %d %s,\nhave:\n%v\nwant:\n%v", i, tt.body, have, tt.want) + } + if tt.code != resp.StatusCode { + t.Errorf("testcase %d %s,\nwrong statuscode, have: %v, want: %v", i, tt.body, resp.StatusCode, tt.code) + } + } +} + func TestGraphQLBlockSerializationEIP2718(t *testing.T) { stack := createNode(t, true, true) defer stack.Close() @@ -176,7 +213,7 @@ func TestGraphQLBlockSerializationEIP2718(t *testing.T) { }{ { body: `{"query": "{block {number transactions { from { address } to { address } value hash type accessList { address storageKeys } index}}}"}`, - want: `{"data":{"block":{"number":1,"transactions":[{"from":{"address":"0x71562b71999873db5b286df957af199ec94617f7"},"to":{"address":"0x0000000000000000000000000000000000000dad"},"value":"0x64","hash":"0x46933b8a43e70320bb41910f015c4b2aded1caaba32b55b56054e4d1811d06d6","type":0,"accessList":[],"index":0},{"from":{"address":"0x71562b71999873db5b286df957af199ec94617f7"},"to":{"address":"0x0000000000000000000000000000000000000dad"},"value":"0x32","hash":"0x03682ed7cc9cf9e9fa3bb6f58a62d6a350c09ec4d22b71b884503ae469e8640b","type":1,"accessList":[{"address":"0x0000000000000000000000000000000000000dad","storageKeys":["0x0000000000000000000000000000000000000000000000000000000000000000"]}],"index":1}]}}}`, + want: `{"data":{"block":{"number":1,"transactions":[{"from":{"address":"0x71562b71999873db5b286df957af199ec94617f7"},"to":{"address":"0x0000000000000000000000000000000000000dad"},"value":"0x64","hash":"0x46933b8a43e70320bb41910f015c4b2aded1caaba32b55b56054e4d1811d06d6","type":0,"accessList":[],"index":0},{"from":{"address":"0x71562b71999873db5b286df957af199ec94617f7"},"to":{"address":"0x0000000000000000000000000000000000000dad"},"value":"0x32","hash":"0x03682ed7cc9cf9e9fa3bb6f58a62d6a350c09ec4d22b71b884503ae469e8640b","type":1,"accessList":[{"address":"0x0000000000000000000000000000000000000dad","storageKeys":["0x0000000000000000000000000000000000000000000000000000000000000000"]}],"index":1},{"from":{"address":"0x71562b71999873db5b286df957af199ec94617f7"},"to":{"address":"0x0000000000000000000000000000000000000dad"},"value":"0x32","hash":"0x22f565cfeb33d5e6f81c8923ef0633a49fef0848a089a6d8564b655d5605fb13","type":2,"accessList":[],"index":2}]}}}`, code: 200, }, } { @@ -330,6 +367,15 @@ func createGQLServiceWithTransactions(t *testing.T, stack *node.Node) { StorageKeys: []common.Hash{{0}}, }}, }) + dynamicTx, _ := types.SignNewTx(key, signer, &types.DynamicFeeTx{ + ChainID: ethConf.Genesis.Config.ChainID, + Nonce: uint64(2), + To: &dad, + Gas: 50000, + GasFeeCap: big.NewInt(30000), + GasTipCap: big.NewInt(10), + Value: big.NewInt(50), + }) // Create some blocks and import them chain, _ := core.GenerateChain(params.IstanbulEHFTestChainConfig, ethBackend.BlockChain().Genesis(), @@ -337,6 +383,7 @@ func createGQLServiceWithTransactions(t *testing.T, stack *node.Node) { b.SetCoinbase(common.Address{1}) b.AddTx(legacyTx) b.AddTx(envelopTx) + b.AddTx(dynamicTx) }) _, err = ethBackend.BlockChain().InsertChain(chain) diff --git a/miner/worker.go b/miner/worker.go index 1a7180140e..80fd24f62d 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -240,7 +240,10 @@ func (w *worker) stop() { atomic.StoreInt32(&w.running, 0) if istanbul, ok := w.engine.(consensus.Istanbul); ok { - istanbul.StopValidating() + err := istanbul.StopValidating() + if err != nil { + log.Error("Error while calling engine.StopValidating", "err", err) + } } } diff --git a/monorepo_commit b/monorepo_commit index 3651e36397..f202f8e3ed 100644 --- a/monorepo_commit +++ b/monorepo_commit @@ -1 +1 @@ -gastonponti/core-contracts.v7-fix-v2 +gastonponti/core-contracts.v8-fix diff --git a/mycelo/contract/README.md b/mycelo/contract/README.md index 3720eadbf6..2c678b9559 100644 --- a/mycelo/contract/README.md +++ b/mycelo/contract/README.md @@ -1,6 +1,12 @@ To generate gen_abis.go run +Using the monorepo_commit file: +``` +go run ./mycelo/internal/scripts/generate -buildpath ./compiled-system-contracts +``` + +For a custom one: ``` go run ./mycelo/internal/scripts/generate -buildpath $CELO_MONOREPO/packages/protocol/build/contracts ``` \ No newline at end of file diff --git a/mycelo/contract/gen_abis.go b/mycelo/contract/gen_abis.go index f73ad2d7b1..2188aa4756 100644 --- a/mycelo/contract/gen_abis.go +++ b/mycelo/contract/gen_abis.go @@ -1,5 +1,5 @@ // Code generated by go generate; DO NOT EDIT. -// 2022-08-19 00:12:00.139851 -0300 -03 m=+0.320554251 +// 2023-02-14 09:28:52.792897 -0300 -03 m=+0.298628811 package contract import "github.com/celo-org/celo-blockchain/accounts/abi" @@ -1007,15 +1007,6 @@ func init() { "stateMutability": "nonpayable", "type": "function" }, - { - "constant": false, - "inputs": [], - "name": "deletePaymentDelegation", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, { "constant": true, "inputs": [ @@ -8884,17 +8875,24 @@ func init() { { "indexed": true, "internalType": "address", - "name": "previousOwner", + "name": "trustedIssuer", "type": "address" - }, + } + ], + "name": "DefaultTrustedIssuerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "trustedIssuer", "type": "address" } ], - "name": "OwnershipTransferred", + "name": "DefaultTrustedIssuerRemoved", "type": "event" }, { @@ -8903,11 +8901,17 @@ func init() { { "indexed": true, "internalType": "address", - "name": "registryAddress", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", "type": "address" } ], - "name": "RegistrySet", + "name": "OwnershipTransferred", "type": "event" }, { @@ -8990,6 +8994,38 @@ func init() { "name": "Transfer", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paymentId", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "trustedIssuers", + "type": "address[]" + } + ], + "name": "TrustedIssuersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "paymentId", + "type": "address" + } + ], + "name": "TrustedIssuersUnset", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -9027,6 +9063,42 @@ func init() { "name": "Withdrawal", "type": "event" }, + { + "constant": true, + "inputs": [], + "name": "MAX_TRUSTED_ISSUERS_PER_PAYMENT", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "defaultTrustedIssuers", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [ @@ -9174,6 +9246,21 @@ func init() { "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "registryContract", + "outputs": [ + { + "internalType": "contract IRegistry", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": false, "inputs": [], @@ -9214,29 +9301,40 @@ func init() { "inputs": [ { "internalType": "address", - "name": "registryAddress", + "name": "newOwner", "type": "address" } ], - "name": "setRegistry", + "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { "internalType": "address", - "name": "newOwner", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "trustedIssuersPerPayment", + "outputs": [ + { + "internalType": "address", + "name": "", "type": "address" } ], - "name": "transferOwnership", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { @@ -9269,16 +9367,45 @@ func init() { "stateMutability": "pure", "type": "function" }, + { + "constant": false, + "inputs": [], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ { "internalType": "address", - "name": "registryAddress", + "name": "trustedIssuer", "type": "address" } ], - "name": "initialize", + "name": "addDefaultTrustedIssuer", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "trustedIssuer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "removeDefaultTrustedIssuer", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -9330,6 +9457,57 @@ func init() { "stateMutability": "nonpayable", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expirySeconds", + "type": "uint256" + }, + { + "internalType": "address", + "name": "paymentId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minAttestations", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "trustedIssuers", + "type": "address[]" + } + ], + "name": "transferWithTrustedIssuers", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -9428,6 +9606,42 @@ func init() { "payable": false, "stateMutability": "view", "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "paymentId", + "type": "address" + } + ], + "name": "getTrustedIssuersPerPayment", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getDefaultTrustedIssuers", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" } ]`)// Exchange ABI abis["Exchange"] = mustParseABI(`[ @@ -11589,8 +11803,8 @@ func init() { "stateMutability": "pure", "type": "function" } - ]`)// FeeCurrencyWhitelist ABI - abis["FeeCurrencyWhitelist"] = mustParseABI(`[ + ]`)// FederatedAttestations ABI + abis["FederatedAttestations"] = mustParseABI(`[ { "inputs": [ { @@ -11606,31 +11820,130 @@ func init() { { "anonymous": false, "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, { "indexed": true, "internalType": "address", - "name": "previousOwner", + "name": "issuer", "type": "address" }, { "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "account", "type": "address" - } - ], + }, + { + "indexed": false, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "issuedOn", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "publishedOn", + "type": "uint64" + } + ], + "name": "AttestationRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "issuer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "issuedOn", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "publishedOn", + "type": "uint64" + } + ], + "name": "AttestationRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "eip712DomainSeparator", + "type": "bytes32" + } + ], + "name": "EIP712DomainSeparatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], "name": "OwnershipTransferred", "type": "event" }, { "constant": true, "inputs": [], - "name": "initialized", + "name": "EIP712_OWNERSHIP_ATTESTATION_TYPEHASH", "outputs": [ { - "internalType": "bool", + "internalType": "bytes32", "name": "", - "type": "bool" + "type": "bytes32" } ], "payable": false, @@ -11640,12 +11953,12 @@ func init() { { "constant": true, "inputs": [], - "name": "isOwner", + "name": "MAX_ATTESTATIONS_PER_IDENTIFIER", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "payable": false, @@ -11655,12 +11968,12 @@ func init() { { "constant": true, "inputs": [], - "name": "owner", + "name": "MAX_IDENTIFIERS_PER_ADDRESS", "outputs": [ { - "internalType": "address", + "internalType": "uint256", "name": "", - "type": "address" + "type": "uint256" } ], "payable": false, @@ -11668,121 +11981,96 @@ func init() { "type": "function" }, { - "constant": false, - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, + "constant": true, "inputs": [ { "internalType": "address", - "name": "newOwner", + "name": "", "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, { "internalType": "uint256", "name": "", "type": "uint256" } ], - "name": "whitelist", + "name": "addressToIdentifiers", "outputs": [ { - "internalType": "address", + "internalType": "bytes32", "name": "", - "type": "address" + "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" }, - { - "constant": false, - "inputs": [], - "name": "initialize", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } - ], - "name": "addToken", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, { "constant": true, "inputs": [], - "name": "getWhitelist", + "name": "eip712DomainSeparator", "outputs": [ { - "internalType": "address[]", + "internalType": "bytes32", "name": "", - "type": "address[]" + "type": "bytes32" } ], "payable": false, "stateMutability": "view", "type": "function" - } - ]`)// Freezer ABI - abis["Freezer"] = mustParseABI(`[ + }, { + "constant": true, "inputs": [ { - "internalType": "bool", - "name": "test", - "type": "bool" + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ + "name": "identifierToAttestations", + "outputs": [ { - "indexed": true, "internalType": "address", - "name": "previousOwner", + "name": "account", "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "signer", "type": "address" + }, + { + "internalType": "uint64", + "name": "issuedOn", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "publishedOn", + "type": "uint64" } ], - "name": "OwnershipTransferred", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { "constant": true, @@ -11801,14 +12089,8 @@ func init() { }, { "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isFrozen", + "inputs": [], + "name": "isOwner", "outputs": [ { "internalType": "bool", @@ -11823,12 +12105,12 @@ func init() { { "constant": true, "inputs": [], - "name": "isOwner", + "name": "owner", "outputs": [ { - "internalType": "bool", + "internalType": "address", "name": "", - "type": "bool" + "type": "address" } ], "payable": false, @@ -11838,10 +12120,10 @@ func init() { { "constant": true, "inputs": [], - "name": "owner", + "name": "registryContract", "outputs": [ { - "internalType": "address", + "internalType": "contract IRegistry", "name": "", "type": "address" } @@ -11860,27 +12142,24 @@ func init() { "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "revokedAttestations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "transferOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "initialize", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { @@ -11888,101 +12167,1699 @@ func init() { "inputs": [ { "internalType": "address", - "name": "target", + "name": "newOwner", "type": "address" } ], - "name": "freeze", + "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint64", + "name": "issuedOn", + "type": "uint64" + } + ], + "name": "registerAttestationAsIssuer", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "issuer", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "uint64", + "name": "issuedOn", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "registerAttestation", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "issuer", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "revokeAttestation", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "issuer", + "type": "address" + }, + { + "internalType": "bytes32[]", + "name": "identifiers", + "type": "bytes32[]" + }, + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + } + ], + "name": "batchRevokeAttestations", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "address[]", + "name": "trustedIssuers", + "type": "address[]" + } + ], + "name": "lookupAttestations", + "outputs": [ + { + "internalType": "uint256[]", + "name": "countsPerIssuer", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "accounts", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "signers", + "type": "address[]" + }, + { + "internalType": "uint64[]", + "name": "issuedOns", + "type": "uint64[]" + }, + { + "internalType": "uint64[]", + "name": "publishedOns", + "type": "uint64[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address[]", + "name": "trustedIssuers", + "type": "address[]" + } + ], + "name": "lookupIdentifiers", + "outputs": [ + { + "internalType": "uint256[]", + "name": "countsPerIssuer", + "type": "uint256[]" + }, + { + "internalType": "bytes32[]", + "name": "identifiers", + "type": "bytes32[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "issuer", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "uint64", + "name": "issuedOn", + "type": "uint64" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "validateAttestationSig", + "outputs": [], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "identifier", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "issuer", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "uint64", + "name": "issuedOn", + "type": "uint64" + } + ], + "name": "getUniqueAttestationHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + } + ]`)// FeeCurrencyWhitelist ABI + abis["FeeCurrencyWhitelist"] = mustParseABI(`[ + { + "inputs": [ + { + "internalType": "bool", + "name": "test", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "initialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "addToken", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getWhitelist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ]`)// Freezer ABI + abis["Freezer"] = mustParseABI(`[ + { + "inputs": [ + { + "internalType": "bool", + "name": "test", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "initialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isFrozen", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "freeze", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "unfreeze", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } + ]`)// GasPriceMinimum ABI + abis["GasPriceMinimum"] = mustParseABI(`[ + { + "inputs": [ + { + "internalType": "bool", + "name": "test", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "adjustmentSpeed", + "type": "uint256" + } + ], + "name": "AdjustmentSpeedSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "gasPriceMinimumFloor", + "type": "uint256" + } + ], + "name": "GasPriceMinimumFloorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "gasPriceMinimum", + "type": "uint256" + } + ], + "name": "GasPriceMinimumUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "registryAddress", + "type": "address" + } + ], + "name": "RegistrySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "targetDensity", + "type": "uint256" + } + ], + "name": "TargetDensitySet", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "adjustmentSpeed", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "gasPriceMinimum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "gasPriceMinimumFloor", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "initialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "registry", + "outputs": [ + { + "internalType": "contract IRegistry", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "registryAddress", + "type": "address" + } + ], + "name": "setRegistry", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "targetDensity", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_registryAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_gasPriceMinimumFloor", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_targetDensity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_adjustmentSpeed", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_adjustmentSpeed", + "type": "uint256" + } + ], + "name": "setAdjustmentSpeed", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_targetDensity", + "type": "uint256" + } + ], + "name": "setTargetDensity", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_gasPriceMinimumFloor", + "type": "uint256" + } + ], + "name": "setGasPriceMinimumFloor", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "getGasPriceMinimum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "blockGasTotal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blockGasLimit", + "type": "uint256" + } + ], + "name": "updateGasPriceMinimum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "uint256", + "name": "blockGasTotal", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "blockGasLimit", + "type": "uint256" + } + ], + "name": "getUpdatedGasPriceMinimum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ]`)// GoldToken ABI + abis["GoldToken"] = mustParseABI(`[ + { + "inputs": [ + { + "internalType": "bool", + "name": "test", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "registryAddress", + "type": "address" + } + ], + "name": "RegistrySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "comment", + "type": "string" + } + ], + "name": "TransferComment", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "initialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "registry", + "outputs": [ + { + "internalType": "contract IRegistry", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "registryAddress", + "type": "address" + } + ], + "name": "setRegistry", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "registryAddress", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "string", + "name": "comment", + "type": "string" + } + ], + "name": "transferWithComment", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ { "internalType": "address", - "name": "target", + "name": "spender", "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "unfreeze", - "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" - } - ]`)// GasPriceMinimum ABI - abis["GasPriceMinimum"] = mustParseABI(`[ + }, { + "constant": false, "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ { "internalType": "bool", - "name": "test", + "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", - "type": "constructor" + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { "internalType": "uint256", - "name": "adjustmentSpeed", + "name": "value", "type": "uint256" } ], - "name": "AdjustmentSpeedSet", - "type": "event" + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": false, + "internalType": "address", + "name": "to", + "type": "address" + }, + { "internalType": "uint256", - "name": "gasPriceMinimumFloor", + "name": "value", "type": "uint256" } ], - "name": "GasPriceMinimumFloorSet", - "type": "event" + "name": "mint", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ { - "indexed": false, "internalType": "uint256", - "name": "gasPriceMinimum", + "name": "", "type": "uint256" } ], - "name": "GasPriceMinimumUpdated", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, + "constant": true, "inputs": [ { - "indexed": true, "internalType": "address", - "name": "previousOwner", + "name": "owner", "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "spender", "type": "address" } ], - "name": "OwnershipTransferred", + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "increaseSupply", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } + ]`)// Governance ABI + abis["Governance"] = mustParseABI(`[ + { + "inputs": [ + { + "internalType": "bool", + "name": "test", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "approvalStageDuration", + "type": "uint256" + } + ], + "name": "ApprovalStageDurationSet", "type": "event" }, { @@ -11991,11 +13868,11 @@ func init() { { "indexed": true, "internalType": "address", - "name": "registryAddress", + "name": "approver", "type": "address" } ], - "name": "RegistrySet", + "name": "ApproverSet", "type": "event" }, { @@ -12004,387 +13881,330 @@ func init() { { "indexed": false, "internalType": "uint256", - "name": "targetDensity", + "name": "concurrentProposals", "type": "uint256" } ], - "name": "TargetDensitySet", + "name": "ConcurrentProposalsSet", "type": "event" }, { - "constant": true, - "inputs": [], - "name": "adjustmentSpeed", - "outputs": [ + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes4", + "name": "functionId", + "type": "bytes4" + }, { + "indexed": false, "internalType": "uint256", - "name": "value", + "name": "threshold", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "ConstitutionSet", + "type": "event" }, { - "constant": true, - "inputs": [], - "name": "gasPriceMinimum", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "dequeueFrequency", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "DequeueFrequencySet", + "type": "event" }, { - "constant": true, - "inputs": [], - "name": "gasPriceMinimumFloor", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "executionStageDuration", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "ExecutionStageDurationSet", + "type": "event" }, { - "constant": true, - "inputs": [], - "name": "initialized", - "outputs": [ + "anonymous": false, + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "indexed": true, + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "HotfixApproved", + "type": "event" }, { - "constant": true, - "inputs": [], - "name": "isOwner", - "outputs": [ + "anonymous": false, + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "indexed": true, + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "HotfixExecuted", + "type": "event" }, { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ + "anonymous": false, + "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "registry", - "outputs": [ + "indexed": true, + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, { - "internalType": "contract IRegistry", - "name": "", - "type": "address" + "indexed": true, + "internalType": "uint256", + "name": "epoch", + "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "HotfixPrepared", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": true, + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "indexed": false, "internalType": "address", - "name": "registryAddress", + "name": "whitelister", "type": "address" } ], - "name": "setRegistry", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "HotfixWhitelisted", + "type": "event" }, { - "constant": true, - "inputs": [], - "name": "targetDensity", - "outputs": [ + "anonymous": false, + "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "value", + "name": "minDeposit", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "MinDepositSet", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], - "name": "transferOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "OwnershipTransferred", + "type": "event" }, { - "constant": true, - "inputs": [], - "name": "getVersionNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, + "anonymous": false, + "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "baselineQuorumFactor", "type": "uint256" } ], - "payable": false, - "stateMutability": "pure", - "type": "function" + "name": "ParticipationBaselineQuorumFactorSet", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { - "internalType": "address", - "name": "_registryAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_gasPriceMinimumFloor", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_targetDensity", - "type": "uint256" - }, - { + "indexed": false, "internalType": "uint256", - "name": "_adjustmentSpeed", + "name": "baselineUpdateFactor", "type": "uint256" } ], - "name": "initialize", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "ParticipationBaselineUpdateFactorSet", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "_adjustmentSpeed", + "name": "participationBaseline", "type": "uint256" } ], - "name": "setAdjustmentSpeed", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "ParticipationBaselineUpdated", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "_targetDensity", + "name": "participationFloor", "type": "uint256" } ], - "name": "setTargetDensity", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "ParticipationFloorSet", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "uint256", - "name": "_gasPriceMinimumFloor", + "name": "proposalId", "type": "uint256" } ], - "name": "setGasPriceMinimumFloor", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "ProposalApproved", + "type": "event" }, { - "constant": true, + "anonymous": false, "inputs": [ { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } - ], - "name": "getGasPriceMinimum", - "outputs": [ + "indexed": true, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "timestamp", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "ProposalDequeued", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "uint256", - "name": "blockGasTotal", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blockGasLimit", + "name": "proposalId", "type": "uint256" } ], - "name": "updateGasPriceMinimum", - "outputs": [ + "name": "ProposalExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { + "indexed": true, "internalType": "uint256", - "name": "", + "name": "proposalId", "type": "uint256" } ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "ProposalExpired", + "type": "event" }, { - "constant": true, + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "uint256", - "name": "blockGasTotal", + "name": "proposalId", "type": "uint256" }, { + "indexed": true, + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "indexed": false, "internalType": "uint256", - "name": "blockGasLimit", + "name": "transactionCount", "type": "uint256" - } - ], - "name": "getUpdatedGasPriceMinimum", - "outputs": [ + }, { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "deposit", "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - } - ]`)// GoldToken ABI - abis["GoldToken"] = mustParseABI(`[ - { - "inputs": [ + }, { - "internalType": "bool", - "name": "test", - "type": "bool" + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" } ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" + "name": "ProposalQueued", + "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" }, { "indexed": true, "internalType": "address", - "name": "spender", + "name": "account", "type": "address" }, { "indexed": false, "internalType": "uint256", - "name": "value", + "name": "revokedUpvotes", "type": "uint256" } ], - "name": "Approval", + "name": "ProposalUpvoteRevoked", "type": "event" }, { @@ -12392,31 +14212,55 @@ func init() { "inputs": [ { "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" }, { "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "account", "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "upvotes", + "type": "uint256" } ], - "name": "OwnershipTransferred", + "name": "ProposalUpvoted", "type": "event" }, { "anonymous": false, "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, { "indexed": true, "internalType": "address", - "name": "registryAddress", + "name": "account", "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" } ], - "name": "RegistrySet", + "name": "ProposalVoteRevoked", "type": "event" }, { @@ -12424,14 +14268,14 @@ func init() { "inputs": [ { "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" }, { "indexed": true, "internalType": "address", - "name": "to", + "name": "account", "type": "address" }, { @@ -12439,9 +14283,15 @@ func init() { "internalType": "uint256", "name": "value", "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" } ], - "name": "Transfer", + "name": "ProposalVoted", "type": "event" }, { @@ -12449,23 +14299,54 @@ func init() { "inputs": [ { "indexed": false, - "internalType": "string", - "name": "comment", - "type": "string" + "internalType": "uint256", + "name": "queueExpiry", + "type": "uint256" } ], - "name": "TransferComment", + "name": "QueueExpirySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "referendumStageDuration", + "type": "uint256" + } + ], + "name": "ReferendumStageDurationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "registryAddress", + "type": "address" + } + ], + "name": "RegistrySet", "type": "event" }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, { "constant": true, "inputs": [], - "name": "initialized", + "name": "approver", "outputs": [ { - "internalType": "bool", + "internalType": "address", "name": "", - "type": "bool" + "type": "address" } ], "payable": false, @@ -12474,8 +14355,24 @@ func init() { }, { "constant": true, - "inputs": [], - "name": "isOwner", + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bytes", + "name": "blsKey", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "blsPop", + "type": "bytes" + } + ], + "name": "checkProofOfPossession", "outputs": [ { "internalType": "bool", @@ -12490,12 +14387,12 @@ func init() { { "constant": true, "inputs": [], - "name": "owner", + "name": "concurrentProposals", "outputs": [ { - "internalType": "address", + "internalType": "uint256", "name": "", - "type": "address" + "type": "uint256" } ], "payable": false, @@ -12505,12 +14402,12 @@ func init() { { "constant": true, "inputs": [], - "name": "registry", + "name": "dequeueFrequency", "outputs": [ { - "internalType": "contract IRegistry", + "internalType": "uint256", "name": "", - "type": "address" + "type": "uint256" } ], "payable": false, @@ -12518,59 +14415,83 @@ func init() { "type": "function" }, { - "constant": false, - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "registryAddress", - "type": "address" + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "dequeued", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "name": "setRegistry", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "emptyIndices", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "name": "transferOwnership", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": true, - "inputs": [], - "name": "getVersionNumber", - "outputs": [ + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "aNumerator", "type": "uint256" }, { "internalType": "uint256", - "name": "", + "name": "aDenominator", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bNumerator", "type": "uint256" }, + { + "internalType": "uint256", + "name": "bDenominator", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "exponent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_decimals", + "type": "uint256" + } + ], + "name": "fractionMulExp", + "outputs": [ { "internalType": "uint256", "name": "", @@ -12583,225 +14504,184 @@ func init() { } ], "payable": false, - "stateMutability": "pure", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "registryAddress", - "type": "address" + "internalType": "bytes", + "name": "header", + "type": "bytes" } ], - "name": "initialize", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, + "name": "getBlockNumberFromHeader", + "outputs": [ { "internalType": "uint256", - "name": "value", + "name": "", "type": "uint256" } ], - "name": "transfer", + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getEpochNumber", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, { "internalType": "uint256", - "name": "value", + "name": "blockNumber", "type": "uint256" - }, - { - "internalType": "string", - "name": "comment", - "type": "string" } ], - "name": "transferWithComment", + "name": "getEpochNumberOfBlock", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "approve", + "constant": true, + "inputs": [], + "name": "getEpochSize", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, { "internalType": "uint256", - "name": "value", + "name": "blockNumber", "type": "uint256" } ], - "name": "increaseAllowance", + "name": "getParentSealBitmap", "outputs": [ { - "internalType": "bool", + "internalType": "bytes32", "name": "", - "type": "bool" + "type": "bytes32" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" + "internalType": "bytes", + "name": "header", + "type": "bytes" } ], - "name": "decreaseAllowance", + "name": "getVerifiedSealBitmapFromHeader", "outputs": [ { - "internalType": "bool", + "internalType": "bytes32", "name": "", - "type": "bool" + "type": "bytes32" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" + "internalType": "bytes", + "name": "header", + "type": "bytes" } ], - "name": "transferFrom", + "name": "hashHeader", "outputs": [ { - "internalType": "bool", + "internalType": "bytes32", "name": "", - "type": "bool" + "type": "bytes32" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" + "internalType": "bytes32", + "name": "", + "type": "bytes32" } ], - "name": "mint", + "name": "hotfixes", "outputs": [ { "internalType": "bool", - "name": "", + "name": "executed", + "type": "bool" + }, + { + "internalType": "bool", + "name": "approved", "type": "bool" + }, + { + "internalType": "uint256", + "name": "preparedEpoch", + "type": "uint256" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], - "name": "name", + "name": "initialized", "outputs": [ { - "internalType": "string", + "internalType": "bool", "name": "", - "type": "string" + "type": "bool" } ], "payable": false, @@ -12811,12 +14691,12 @@ func init() { { "constant": true, "inputs": [], - "name": "symbol", + "name": "isOwner", "outputs": [ { - "internalType": "string", + "internalType": "bool", "name": "", - "type": "string" + "type": "bool" } ], "payable": false, @@ -12826,12 +14706,12 @@ func init() { { "constant": true, "inputs": [], - "name": "decimals", + "name": "lastDequeue", "outputs": [ { - "internalType": "uint8", + "internalType": "uint256", "name": "", - "type": "uint8" + "type": "uint256" } ], "payable": false, @@ -12841,7 +14721,7 @@ func init() { { "constant": true, "inputs": [], - "name": "totalSupply", + "name": "minDeposit", "outputs": [ { "internalType": "uint256", @@ -12857,17 +14737,12 @@ func init() { "constant": true, "inputs": [ { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" } ], - "name": "allowance", + "name": "minQuorumSize", "outputs": [ { "internalType": "uint256", @@ -12880,30 +14755,24 @@ func init() { "type": "function" }, { - "constant": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "minQuorumSizeInCurrentSet", + "outputs": [ { "internalType": "uint256", - "name": "amount", + "name": "", "type": "uint256" } ], - "name": "increaseSupply", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "balanceOf", + "inputs": [], + "name": "numberValidatorsInCurrentSet", "outputs": [ { "internalType": "uint256", @@ -12914,689 +14783,560 @@ func init() { "payable": false, "stateMutability": "view", "type": "function" - } - ]`)// Governance ABI - abis["Governance"] = mustParseABI(`[ - { - "inputs": [ - { - "internalType": "bool", - "name": "test", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor" }, { - "anonymous": false, + "constant": true, "inputs": [ { - "indexed": false, "internalType": "uint256", - "name": "approvalStageDuration", + "name": "blockNumber", "type": "uint256" } ], - "name": "ApprovalStageDurationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "approver", - "type": "address" - } - ], - "name": "ApproverSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "numberValidatorsInSet", + "outputs": [ { - "indexed": false, "internalType": "uint256", - "name": "concurrentProposals", + "name": "", "type": "uint256" } ], - "name": "ConcurrentProposalsSet", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ { - "indexed": true, "internalType": "address", - "name": "destination", + "name": "", "type": "address" - }, - { - "indexed": true, - "internalType": "bytes4", - "name": "functionId", - "type": "bytes4" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "threshold", - "type": "uint256" } ], - "name": "ConstitutionSet", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "proposalCount", + "outputs": [ { - "indexed": false, "internalType": "uint256", - "name": "dequeueFrequency", + "name": "", "type": "uint256" } ], - "name": "DequeueFrequencySet", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "queueExpiry", + "outputs": [ { - "indexed": false, "internalType": "uint256", - "name": "executionStageDuration", + "name": "", "type": "uint256" } ], - "name": "ExecutionStageDurationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - } - ], - "name": "HotfixApproved", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, + "constant": true, "inputs": [ { - "indexed": true, - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" + "internalType": "address", + "name": "", + "type": "address" } ], - "name": "HotfixExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - }, + "name": "refundedDeposits", + "outputs": [ { - "indexed": true, "internalType": "uint256", - "name": "epoch", + "name": "", "type": "uint256" } ], - "name": "HotfixPrepared", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - }, + "constant": true, + "inputs": [], + "name": "registry", + "outputs": [ { - "indexed": false, - "internalType": "address", - "name": "whitelister", + "internalType": "contract IRegistry", + "name": "", "type": "address" } ], - "name": "HotfixWhitelisted", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minDeposit", - "type": "uint256" - } - ], - "name": "MinDepositSet", - "type": "event" + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, "internalType": "address", - "name": "newOwner", + "name": "registryAddress", "type": "address" } ], - "name": "OwnershipTransferred", - "type": "event" + "name": "setRegistry", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "stageDurations", + "outputs": [ { - "indexed": false, "internalType": "uint256", - "name": "baselineQuorumFactor", + "name": "approval", "type": "uint256" - } - ], - "name": "ParticipationBaselineQuorumFactorSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { - "indexed": false, "internalType": "uint256", - "name": "baselineUpdateFactor", + "name": "referendum", "type": "uint256" - } - ], - "name": "ParticipationBaselineUpdateFactorSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { - "indexed": false, "internalType": "uint256", - "name": "participationBaseline", + "name": "execution", "type": "uint256" } ], - "name": "ParticipationBaselineUpdated", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": false, - "internalType": "uint256", - "name": "participationFloor", - "type": "uint256" + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "name": "ParticipationFloorSet", - "type": "event" + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": true, "inputs": [ { - "indexed": true, "internalType": "uint256", - "name": "proposalId", + "name": "index", "type": "uint256" } ], - "name": "ProposalApproved", - "type": "event" + "name": "validatorSignerAddressFromCurrentSet", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, + "constant": true, "inputs": [ { - "indexed": true, "internalType": "uint256", - "name": "proposalId", + "name": "index", "type": "uint256" }, { - "indexed": false, - "internalType": "uint256", - "name": "timestamp", - "type": "uint256" - } - ], - "name": "ProposalDequeued", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, "internalType": "uint256", - "name": "proposalId", + "name": "blockNumber", "type": "uint256" } ], - "name": "ProposalExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "name": "validatorSignerAddressFromSet", + "outputs": [ { - "indexed": true, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" + "internalType": "address", + "name": "", + "type": "address" } ], - "name": "ProposalExpired", - "type": "event" + "payable": false, + "stateMutability": "view", + "type": "function" }, { - "anonymous": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "getVersionNumber", + "outputs": [ { - "indexed": true, "internalType": "uint256", - "name": "proposalId", + "name": "", "type": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "indexed": false, "internalType": "uint256", - "name": "transactionCount", + "name": "", "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "deposit", + "name": "", "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "timestamp", + "name": "", "type": "uint256" } ], - "name": "ProposalQueued", - "type": "event" + "payable": false, + "stateMutability": "pure", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": true, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" + "internalType": "address", + "name": "registryAddress", + "type": "address" }, { - "indexed": true, "internalType": "address", - "name": "account", + "name": "_approver", "type": "address" }, { - "indexed": false, "internalType": "uint256", - "name": "revokedUpvotes", + "name": "_concurrentProposals", "type": "uint256" - } - ], - "name": "ProposalUpvoteRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { - "indexed": true, "internalType": "uint256", - "name": "proposalId", + "name": "_minDeposit", "type": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, "internalType": "uint256", - "name": "upvotes", + "name": "_queueExpiry", "type": "uint256" - } - ], - "name": "ProposalUpvoted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { - "indexed": true, "internalType": "uint256", - "name": "proposalId", + "name": "_dequeueFrequency", "type": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "uint256", + "name": "approvalStageDuration", + "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "value", + "name": "referendumStageDuration", "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "weight", + "name": "executionStageDuration", "type": "uint256" - } - ], - "name": "ProposalVoteRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { - "indexed": true, "internalType": "uint256", - "name": "proposalId", + "name": "participationBaseline", "type": "uint256" }, { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "uint256", + "name": "participationFloor", + "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "value", + "name": "baselineUpdateFactor", "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "weight", + "name": "baselineQuorumFactor", "type": "uint256" } ], - "name": "ProposalVoted", - "type": "event" + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "_approver", + "type": "address" + } + ], + "name": "setApprover", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": false, "internalType": "uint256", - "name": "queueExpiry", + "name": "_concurrentProposals", "type": "uint256" } ], - "name": "QueueExpirySet", - "type": "event" + "name": "setConcurrentProposals", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": false, "internalType": "uint256", - "name": "referendumStageDuration", + "name": "_minDeposit", "type": "uint256" } ], - "name": "ReferendumStageDurationSet", - "type": "event" + "name": "setMinDeposit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "registryAddress", - "type": "address" + "internalType": "uint256", + "name": "_queueExpiry", + "type": "uint256" } ], - "name": "RegistrySet", - "type": "event" - }, - { - "payable": true, - "stateMutability": "payable", - "type": "fallback" + "name": "setQueueExpiry", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "constant": true, - "inputs": [], - "name": "approver", - "outputs": [ + "constant": false, + "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "internalType": "uint256", + "name": "_dequeueFrequency", + "type": "uint256" } ], + "name": "setDequeueFrequency", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "bytes", - "name": "blsKey", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "blsPop", - "type": "bytes" - } - ], - "name": "checkProofOfPossession", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "uint256", + "name": "approvalStageDuration", + "type": "uint256" } ], + "name": "setApprovalStageDuration", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, - "inputs": [], - "name": "concurrentProposals", - "outputs": [ + "constant": false, + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "referendumStageDuration", "type": "uint256" } ], + "name": "setReferendumStageDuration", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, - "inputs": [], - "name": "dequeueFrequency", - "outputs": [ + "constant": false, + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "executionStageDuration", "type": "uint256" } ], + "name": "setExecutionStageDuration", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { "internalType": "uint256", - "name": "", + "name": "participationBaseline", "type": "uint256" } ], - "name": "dequeued", - "outputs": [ + "name": "setParticipationBaseline", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "participationFloor", "type": "uint256" } ], + "name": "setParticipationFloor", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { "internalType": "uint256", - "name": "", + "name": "baselineUpdateFactor", "type": "uint256" } ], - "name": "emptyIndices", - "outputs": [ + "name": "setBaselineUpdateFactor", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "baselineQuorumFactor", "type": "uint256" } ], + "name": "setBaselineQuorumFactor", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "uint256", - "name": "aNumerator", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "aDenominator", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "bNumerator", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "bDenominator", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "exponent", - "type": "uint256" + "internalType": "address", + "name": "destination", + "type": "address" }, { - "internalType": "uint256", - "name": "_decimals", - "type": "uint256" - } - ], - "name": "fractionMulExp", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "bytes4", + "name": "functionId", + "type": "bytes4" }, { "internalType": "uint256", - "name": "", + "name": "threshold", "type": "uint256" } ], + "name": "setConstitution", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "destinations", + "type": "address[]" + }, { "internalType": "bytes", - "name": "header", + "name": "data", "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "dataLengths", + "type": "uint256[]" + }, + { + "internalType": "string", + "name": "descriptionUrl", + "type": "string" } ], - "name": "getBlockNumberFromHeader", + "name": "propose", "outputs": [ { "internalType": "uint256", @@ -13604,59 +15344,39 @@ func init() { "type": "uint256" } ], - "payable": false, - "stateMutability": "view", + "payable": true, + "stateMutability": "payable", "type": "function" }, { - "constant": true, - "inputs": [], - "name": "getEpochNumber", - "outputs": [ + "constant": false, + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "proposalId", "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [ + }, { "internalType": "uint256", - "name": "blockNumber", + "name": "lesser", "type": "uint256" - } - ], - "name": "getEpochNumberOfBlock", - "outputs": [ + }, { "internalType": "uint256", - "name": "", + "name": "greater", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getEpochSize", + "name": "upvote", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { @@ -13664,16 +15384,16 @@ func init() { "inputs": [ { "internalType": "uint256", - "name": "blockNumber", + "name": "proposalId", "type": "uint256" } ], - "name": "getParentSealBitmap", + "name": "getProposalStage", "outputs": [ { - "internalType": "bytes32", + "internalType": "enum Proposals.Stage", "name": "", - "type": "bytes32" + "type": "uint8" } ], "payable": false, @@ -13681,82 +15401,92 @@ func init() { "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "bytes", - "name": "header", - "type": "bytes" + "internalType": "uint256", + "name": "lesser", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "greater", + "type": "uint256" } ], - "name": "getVerifiedSealBitmapFromHeader", + "name": "revokeUpvote", "outputs": [ { - "internalType": "bytes32", + "internalType": "bool", "name": "", - "type": "bytes32" + "type": "bool" } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "bytes", - "name": "header", - "type": "bytes" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" } ], - "name": "hashHeader", + "name": "approve", "outputs": [ { - "internalType": "bytes32", + "internalType": "bool", "name": "", - "type": "bytes32" + "type": "bool" } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "bytes32", - "name": "", - "type": "bytes32" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }, + { + "internalType": "enum Proposals.VoteValue", + "name": "value", + "type": "uint8" } ], - "name": "hotfixes", + "name": "vote", "outputs": [ { "internalType": "bool", - "name": "executed", - "type": "bool" - }, - { - "internalType": "bool", - "name": "approved", + "name": "", "type": "bool" - }, - { - "internalType": "uint256", - "name": "preparedEpoch", - "type": "uint256" } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [], - "name": "initialized", + "name": "revokeVotes", "outputs": [ { "internalType": "bool", @@ -13765,13 +15495,24 @@ func init() { } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, - "inputs": [], - "name": "isOwner", + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "execute", "outputs": [ { "internalType": "bool", @@ -13780,33 +15521,44 @@ func init() { } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, - "inputs": [], - "name": "lastDequeue", - "outputs": [ + "constant": false, + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" } ], + "name": "approveHotfix", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": true, - "inputs": [], - "name": "minDeposit", + "inputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "whitelister", + "type": "address" + } + ], + "name": "isHotfixWhitelistedBy", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], "payable": false, @@ -13814,71 +15566,100 @@ func init() { "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" } ], - "name": "minQuorumSize", - "outputs": [ + "name": "whitelistHotfix", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" } ], + "name": "prepareHotfix", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, - "inputs": [], - "name": "minQuorumSizeInCurrentSet", - "outputs": [ + "constant": false, + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "destinations", + "type": "address[]" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256[]", + "name": "dataLengths", + "type": "uint256[]" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" } ], + "name": "executeHotfix", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [], - "name": "numberValidatorsInCurrentSet", + "name": "withdraw", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" + "internalType": "address", + "name": "account", + "type": "address" } ], - "name": "numberValidatorsInSet", + "name": "isVoting", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], "payable": false, @@ -13888,12 +15669,12 @@ func init() { { "constant": true, "inputs": [], - "name": "owner", + "name": "getApprovalStageDuration", "outputs": [ { - "internalType": "address", + "internalType": "uint256", "name": "", - "type": "address" + "type": "uint256" } ], "payable": false, @@ -13903,7 +15684,7 @@ func init() { { "constant": true, "inputs": [], - "name": "proposalCount", + "name": "getReferendumStageDuration", "outputs": [ { "internalType": "uint256", @@ -13918,7 +15699,7 @@ func init() { { "constant": true, "inputs": [], - "name": "queueExpiry", + "name": "getExecutionStageDuration", "outputs": [ { "internalType": "uint256", @@ -13932,15 +15713,24 @@ func init() { }, { "constant": true, - "inputs": [ + "inputs": [], + "name": "getParticipationParameters", + "outputs": [ { - "internalType": "address", + "internalType": "uint256", "name": "", - "type": "address" - } - ], - "name": "refundedDeposits", - "outputs": [ + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, { "internalType": "uint256", "name": "", @@ -13953,13 +15743,19 @@ func init() { }, { "constant": true, - "inputs": [], - "name": "registry", + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalExists", "outputs": [ { - "internalType": "contract IRegistry", + "internalType": "bool", "name": "", - "type": "address" + "type": "bool" } ], "payable": false, @@ -13967,84 +15763,76 @@ func init() { "type": "function" }, { - "constant": false, - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "registryAddress", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" } ], - "name": "setRegistry", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "stageDurations", + "name": "getProposal", "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, { "internalType": "uint256", - "name": "approval", + "name": "", "type": "uint256" }, { "internalType": "uint256", - "name": "referendum", + "name": "", "type": "uint256" }, { "internalType": "uint256", - "name": "execution", + "name": "", "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ + }, { - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "string", + "name": "", + "type": "string" } ], - "name": "transferOwnership", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, { "internalType": "uint256", "name": "index", "type": "uint256" } ], - "name": "validatorSignerAddressFromCurrentSet", + "name": "getProposalTransaction", "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, { "internalType": "address", "name": "", "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" } ], "payable": false, @@ -14056,21 +15844,16 @@ func init() { "inputs": [ { "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blockNumber", + "name": "proposalId", "type": "uint256" } ], - "name": "validatorSignerAddressFromSet", + "name": "isApproved", "outputs": [ { - "internalType": "address", + "internalType": "bool", "name": "", - "type": "address" + "type": "bool" } ], "payable": false, @@ -14079,14 +15862,15 @@ func init() { }, { "constant": true, - "inputs": [], - "name": "getVersionNumber", - "outputs": [ + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "proposalId", "type": "uint256" - }, + } + ], + "name": "getVoteTotals", + "outputs": [ { "internalType": "uint256", "name": "", @@ -14104,350 +15888,323 @@ func init() { } ], "payable": false, - "stateMutability": "pure", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { "internalType": "address", - "name": "registryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "_approver", + "name": "account", "type": "address" }, { "internalType": "uint256", - "name": "_concurrentProposals", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_minDeposit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_queueExpiry", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_dequeueFrequency", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "approvalStageDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "referendumStageDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionStageDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "participationBaseline", + "name": "index", "type": "uint256" - }, + } + ], + "name": "getVoteRecord", + "outputs": [ { "internalType": "uint256", - "name": "participationFloor", + "name": "", "type": "uint256" }, { "internalType": "uint256", - "name": "baselineUpdateFactor", + "name": "", "type": "uint256" }, { "internalType": "uint256", - "name": "baselineQuorumFactor", + "name": "", "type": "uint256" } ], - "name": "initialize", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "getQueueLength", + "outputs": [ { - "internalType": "address", - "name": "_approver", - "type": "address" + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "name": "setApprover", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { "internalType": "uint256", - "name": "_concurrentProposals", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "getUpvotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", "type": "uint256" } ], - "name": "setConcurrentProposals", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "getQueue", + "outputs": [ { - "internalType": "uint256", - "name": "_minDeposit", - "type": "uint256" + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" } ], - "name": "setMinDeposit", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, - "inputs": [ + "constant": true, + "inputs": [], + "name": "getDequeue", + "outputs": [ { - "internalType": "uint256", - "name": "_queueExpiry", - "type": "uint256" + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" } ], - "name": "setQueueExpiry", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "uint256", - "name": "_dequeueFrequency", - "type": "uint256" + "internalType": "address", + "name": "account", + "type": "address" } ], - "name": "setDequeueFrequency", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ + "name": "getUpvoteRecord", + "outputs": [ { "internalType": "uint256", - "name": "approvalStageDuration", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", "type": "uint256" } ], - "name": "setApprovalStageDuration", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getMostRecentReferendumProposal", + "outputs": [ { "internalType": "uint256", - "name": "referendumStageDuration", + "name": "", "type": "uint256" } ], - "name": "setReferendumStageDuration", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "name": "hotfixWhitelistValidatorTally", + "outputs": [ { "internalType": "uint256", - "name": "executionStageDuration", + "name": "", "type": "uint256" } ], - "name": "setExecutionStageDuration", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "uint256", - "name": "participationBaseline", - "type": "uint256" + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "name": "isHotfixPassing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "setParticipationBaseline", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ + { + "internalType": "bytes32", + "name": "hash", + "type": "bytes32" + } + ], + "name": "getHotfixRecord", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + }, { "internalType": "uint256", - "name": "participationFloor", + "name": "", "type": "uint256" } ], - "name": "setParticipationFloor", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "baselineUpdateFactor", - "type": "uint256" - } - ], - "name": "setBaselineUpdateFactor", + "inputs": [], + "name": "dequeueProposalsIfReady", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { "internalType": "uint256", - "name": "baselineQuorumFactor", + "name": "proposalId", "type": "uint256" } ], - "name": "setBaselineQuorumFactor", - "outputs": [], + "name": "isQueued", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "bytes4", - "name": "functionId", - "type": "bytes4" - }, { "internalType": "uint256", - "name": "threshold", + "name": "proposalId", "type": "uint256" } ], - "name": "setConstitution", - "outputs": [], + "name": "isProposalPassing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "destinations", - "type": "address[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "uint256[]", - "name": "dataLengths", - "type": "uint256[]" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" }, { - "internalType": "string", - "name": "descriptionUrl", - "type": "string" + "internalType": "uint256", + "name": "index", + "type": "uint256" } ], - "name": "propose", + "name": "isDequeuedProposal", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], - "payable": true, - "stateMutability": "payable", + "payable": false, + "stateMutability": "view", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { "internalType": "uint256", "name": "proposalId", "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lesser", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "greater", - "type": "uint256" } ], - "name": "upvote", + "name": "isDequeuedProposalExpired", "outputs": [ { "internalType": "bool", @@ -14456,7 +16213,7 @@ func init() { } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { @@ -14468,12 +16225,12 @@ func init() { "type": "uint256" } ], - "name": "getProposalStage", + "name": "isQueuedProposalExpired", "outputs": [ { - "internalType": "enum Proposals.Stage", + "internalType": "bool", "name": "", - "type": "uint8" + "type": "bool" } ], "payable": false, @@ -14481,180 +16238,246 @@ func init() { "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "uint256", - "name": "lesser", - "type": "uint256" + "internalType": "address", + "name": "destination", + "type": "address" }, + { + "internalType": "bytes4", + "name": "functionId", + "type": "bytes4" + } + ], + "name": "getConstitution", + "outputs": [ { "internalType": "uint256", - "name": "greater", + "name": "", "type": "uint256" } ], - "name": "revokeUpvote", - "outputs": [ + "payable": false, + "stateMutability": "view", + "type": "function" + } + ]`)// GovernanceApproverMultiSig ABI + abis["GovernanceApproverMultiSig"] = mustParseABI(`[ + { + "inputs": [ { "internalType": "bool", - "name": "", + "name": "test", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", - "type": "function" + "type": "constructor" }, { - "constant": false, + "anonymous": false, "inputs": [ { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" }, { + "indexed": true, "internalType": "uint256", - "name": "index", + "name": "transactionId", "type": "uint256" } ], - "name": "approve", - "outputs": [ + "name": "Confirmation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" } ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "Deposit", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "uint256", - "name": "proposalId", + "name": "transactionId", "type": "uint256" }, { + "indexed": false, + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "name": "Execution", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, "internalType": "uint256", - "name": "index", + "name": "internalRequired", "type": "uint256" - }, - { - "internalType": "enum Proposals.VoteValue", - "name": "value", - "type": "uint8" } ], - "name": "vote", - "outputs": [ + "name": "InternalRequirementChange", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" } ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "OwnerAddition", + "type": "event" }, { - "constant": false, - "inputs": [], - "name": "revokeVotes", - "outputs": [ + "anonymous": false, + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" } ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "OwnerRemoval", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "proposalId", + "name": "required", "type": "uint256" + } + ], + "name": "RequirementChange", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" }, { + "indexed": true, "internalType": "uint256", - "name": "index", + "name": "transactionId", "type": "uint256" } ], - "name": "execute", + "name": "Revocation", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" + } + ], + "name": "Submission", + "type": "event" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "constant": true, + "inputs": [], + "name": "MAX_OWNER_COUNT", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" + "internalType": "address", + "name": "owner", + "type": "address" } ], - "name": "approveHotfix", + "name": "addOwner", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "whitelister", - "type": "address" - } - ], - "name": "isHotfixWhitelistedBy", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "uint256", + "name": "_internalRequired", + "type": "uint256" } ], + "name": "changeInternalRequirement", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" + "internalType": "uint256", + "name": "_required", + "type": "uint256" } ], - "name": "whitelistHotfix", + "name": "changeRequirement", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -14664,63 +16487,54 @@ func init() { "constant": false, "inputs": [ { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" } ], - "name": "prepareHotfix", + "name": "confirmTransaction", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "destinations", - "type": "address[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" + "internalType": "uint256", + "name": "", + "type": "uint256" }, { - "internalType": "uint256[]", - "name": "dataLengths", - "type": "uint256[]" - }, + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "confirmations", + "outputs": [ { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" + "internalType": "bool", + "name": "", + "type": "bool" } ], - "name": "executeHotfix", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": false, - "inputs": [], - "name": "withdraw", - "outputs": [ + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" } ], + "name": "executeTransaction", + "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -14729,17 +16543,17 @@ func init() { "constant": true, "inputs": [ { - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "uint256", + "name": "transactionId", + "type": "uint256" } ], - "name": "isVoting", + "name": "getConfirmationCount", "outputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "uint256", + "name": "count", + "type": "uint256" } ], "payable": false, @@ -14748,15 +16562,21 @@ func init() { }, { "constant": true, - "inputs": [], - "name": "getApprovalStageDuration", - "outputs": [ + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "transactionId", "type": "uint256" } ], + "name": "getConfirmations", + "outputs": [ + { + "internalType": "address[]", + "name": "_confirmations", + "type": "address[]" + } + ], "payable": false, "stateMutability": "view", "type": "function" @@ -14764,12 +16584,12 @@ func init() { { "constant": true, "inputs": [], - "name": "getReferendumStageDuration", + "name": "getOwners", "outputs": [ { - "internalType": "uint256", + "internalType": "address[]", "name": "", - "type": "uint256" + "type": "address[]" } ], "payable": false, @@ -14778,12 +16598,23 @@ func init() { }, { "constant": true, - "inputs": [], - "name": "getExecutionStageDuration", + "inputs": [ + { + "internalType": "bool", + "name": "pending", + "type": "bool" + }, + { + "internalType": "bool", + "name": "executed", + "type": "bool" + } + ], + "name": "getTransactionCount", "outputs": [ { "internalType": "uint256", - "name": "", + "name": "count", "type": "uint256" } ], @@ -14793,28 +16624,34 @@ func init() { }, { "constant": true, - "inputs": [], - "name": "getParticipationParameters", - "outputs": [ + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "from", "type": "uint256" }, { "internalType": "uint256", - "name": "", + "name": "to", "type": "uint256" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "bool", + "name": "pending", + "type": "bool" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "bool", + "name": "executed", + "type": "bool" + } + ], + "name": "getTransactionIds", + "outputs": [ + { + "internalType": "uint256[]", + "name": "_transactionIds", + "type": "uint256[]" } ], "payable": false, @@ -14822,15 +16659,34 @@ func init() { "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ + { + "internalType": "address[]", + "name": "_owners", + "type": "address[]" + }, { "internalType": "uint256", - "name": "proposalId", + "name": "_required", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_internalRequired", "type": "uint256" } ], - "name": "proposalExists", + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "initialized", "outputs": [ { "internalType": "bool", @@ -14844,39 +16700,13 @@ func init() { }, { "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "getProposal", + "inputs": [], + "name": "internalRequired", "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, { "internalType": "uint256", "name": "", "type": "uint256" - }, - { - "internalType": "string", - "name": "", - "type": "string" } ], "payable": false, @@ -14888,31 +16718,37 @@ func init() { "inputs": [ { "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "index", + "name": "transactionId", "type": "uint256" } ], - "name": "getProposalTransaction", + "name": "isConfirmed", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" - }, + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ { "internalType": "address", "name": "", "type": "address" - }, + } + ], + "name": "isOwner", + "outputs": [ { - "internalType": "bytes", + "internalType": "bool", "name": "", - "type": "bytes" + "type": "bool" } ], "payable": false, @@ -14924,16 +16760,16 @@ func init() { "inputs": [ { "internalType": "uint256", - "name": "proposalId", + "name": "", "type": "uint256" } ], - "name": "isApproved", + "name": "owners", "outputs": [ { - "internalType": "bool", + "internalType": "address", "name": "", - "type": "bool" + "type": "address" } ], "payable": false, @@ -14941,26 +16777,45 @@ func init() { "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" + "internalType": "address", + "name": "owner", + "type": "address" } ], - "name": "getVoteTotals", - "outputs": [ + "name": "removeOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "address", + "name": "owner", + "type": "address" }, { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "replaceOwner", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "required", + "outputs": [ { "internalType": "uint256", "name": "", @@ -14972,45 +16827,55 @@ func init() { "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, { "internalType": "uint256", - "name": "index", + "name": "transactionId", "type": "uint256" } ], - "name": "getVoteRecord", - "outputs": [ + "name": "revokeConfirmation", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "internalType": "address", + "name": "destination", + "type": "address" }, { "internalType": "uint256", - "name": "", + "name": "value", "type": "uint256" }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "submitTransaction", + "outputs": [ { "internalType": "uint256", - "name": "", + "name": "transactionId", "type": "uint256" } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], - "name": "getQueueLength", + "name": "transactionCount", "outputs": [ { "internalType": "uint256", @@ -15027,135 +16892,125 @@ func init() { "inputs": [ { "internalType": "uint256", - "name": "proposalId", + "name": "", "type": "uint256" } ], - "name": "getUpvotes", + "name": "transactions", "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + }, { "internalType": "uint256", - "name": "", + "name": "value", "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "getQueue", - "outputs": [ + }, { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" + "internalType": "bytes", + "name": "data", + "type": "bytes" }, { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" + "internalType": "bool", + "name": "executed", + "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" - }, + } + ]`)// GovernanceSlasher ABI + abis["GovernanceSlasher"] = mustParseABI(`[ { - "constant": true, - "inputs": [], - "name": "getDequeue", - "outputs": [ + "inputs": [ { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" + "internalType": "bool", + "name": "test", + "type": "bool" } ], "payable": false, - "stateMutability": "view", - "type": "function" + "stateMutability": "nonpayable", + "type": "constructor" }, { - "constant": true, + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", "name": "account", "type": "address" - } - ], - "name": "getUpvoteRecord", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" }, { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "amount", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "GovernanceSlashPerformed", + "type": "event" }, { - "constant": true, + "anonymous": false, "inputs": [ { + "indexed": true, "internalType": "address", - "name": "account", + "name": "previousOwner", "type": "address" - } - ], - "name": "getMostRecentReferendumProposal", - "outputs": [ + }, { - "internalType": "uint256", - "name": "", - "type": "uint256" + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "OwnershipTransferred", + "type": "event" }, { - "constant": true, + "anonymous": false, "inputs": [ { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" + "indexed": true, + "internalType": "address", + "name": "registryAddress", + "type": "address" } ], - "name": "hotfixWhitelistValidatorTally", - "outputs": [ + "name": "RegistrySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, "internalType": "uint256", - "name": "", + "name": "amount", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "SlashingApproved", + "type": "event" }, { "constant": true, - "inputs": [ - { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - } - ], - "name": "isHotfixPassing", + "inputs": [], + "name": "initialized", "outputs": [ { "internalType": "bool", @@ -15169,29 +17024,13 @@ func init() { }, { "constant": true, - "inputs": [ - { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - } - ], - "name": "getHotfixRecord", + "inputs": [], + "name": "isOwner", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" - }, - { - "internalType": "bool", - "name": "", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" } ], "payable": false, @@ -15199,29 +17038,29 @@ func init() { "type": "function" }, { - "constant": false, + "constant": true, "inputs": [], - "name": "dequeueProposalsIfReady", - "outputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "isQueued", + "inputs": [], + "name": "registry", "outputs": [ { - "internalType": "bool", + "internalType": "contract IRegistry", "name": "", - "type": "bool" + "type": "address" } ], "payable": false, @@ -15229,88 +17068,94 @@ func init() { "type": "function" }, { - "constant": true, + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, "inputs": [ { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "isProposalPassing", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "address", + "name": "registryAddress", + "type": "address" } ], + "name": "setRegistry", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" + "internalType": "address", + "name": "newOwner", + "type": "address" } ], - "name": "isDequeuedProposal", - "outputs": [ + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "address", + "name": "registryAddress", + "type": "address" } ], + "name": "initialize", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, { "internalType": "uint256", - "name": "proposalId", + "name": "penalty", "type": "uint256" } ], - "name": "isDequeuedProposalExpired", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], + "name": "approveSlashing", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" + "internalType": "address", + "name": "account", + "type": "address" } ], - "name": "isQueuedProposalExpired", + "name": "getApprovedSlashing", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "payable": false, @@ -15318,33 +17163,43 @@ func init() { "type": "function" }, { - "constant": true, + "constant": false, "inputs": [ { "internalType": "address", - "name": "destination", + "name": "account", "type": "address" }, { - "internalType": "bytes4", - "name": "functionId", - "type": "bytes4" + "internalType": "address[]", + "name": "electionLessers", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "electionGreaters", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "electionIndices", + "type": "uint256[]" } ], - "name": "getConstitution", + "name": "slash", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" } - ]`)// GovernanceApproverMultiSig ABI - abis["GovernanceApproverMultiSig"] = mustParseABI(`[ + ]`)// GrandaMento ABI + abis["GrandaMento"] = mustParseABI(`[ { "inputs": [ { @@ -15361,19 +17216,13 @@ func init() { "anonymous": false, "inputs": [ { - "indexed": true, + "indexed": false, "internalType": "address", - "name": "sender", + "name": "approver", "type": "address" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "transactionId", - "type": "uint256" } ], - "name": "Confirmation", + "name": "ApproverSet", "type": "event" }, { @@ -15381,18 +17230,12 @@ func init() { "inputs": [ { "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, "internalType": "uint256", - "name": "value", + "name": "proposalId", "type": "uint256" } ], - "name": "Deposit", + "name": "ExchangeProposalApproved", "type": "event" }, { @@ -15401,88 +17244,54 @@ func init() { { "indexed": true, "internalType": "uint256", - "name": "transactionId", + "name": "proposalId", "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returnData", - "type": "bytes" } ], - "name": "Execution", + "name": "ExchangeProposalCancelled", "type": "event" }, { "anonymous": false, "inputs": [ { - "indexed": false, + "indexed": true, "internalType": "uint256", - "name": "internalRequired", + "name": "proposalId", "type": "uint256" - } - ], - "name": "InternalRequirementChange", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { "indexed": true, "internalType": "address", - "name": "owner", + "name": "exchanger", "type": "address" - } - ], - "name": "OwnerAddition", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + }, { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnerRemoval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ + "indexed": false, + "internalType": "string", + "name": "stableTokenRegistryId", + "type": "string" + }, { "indexed": false, "internalType": "uint256", - "name": "required", + "name": "sellAmount", "type": "uint256" - } - ], - "name": "RequirementChange", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" }, { - "indexed": true, + "indexed": false, "internalType": "uint256", - "name": "transactionId", + "name": "buyAmount", "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "sellCelo", + "type": "bool" } ], - "name": "Revocation", + "name": "ExchangeProposalCreated", "type": "event" }, { @@ -15491,170 +17300,124 @@ func init() { { "indexed": true, "internalType": "uint256", - "name": "transactionId", + "name": "proposalId", "type": "uint256" } ], - "name": "Submission", + "name": "ExchangeProposalExecuted", "type": "event" }, { - "payable": true, - "stateMutability": "payable", - "type": "fallback" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_OWNER_COUNT", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "addOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_internalRequired", - "type": "uint256" - } - ], - "name": "changeInternalRequirement", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_required", - "type": "uint256" - } - ], - "name": "changeRequirement", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "transactionId", + "name": "maxApprovalExchangeRateChange", "type": "uint256" } ], - "name": "confirmTransaction", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "MaxApprovalExchangeRateChangeSet", + "type": "event" }, { - "constant": true, + "anonymous": false, "inputs": [ { - "internalType": "uint256", - "name": "", - "type": "uint256" + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" }, { + "indexed": true, "internalType": "address", - "name": "", + "name": "newOwner", "type": "address" } ], - "name": "confirmations", - "outputs": [ + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "indexed": true, + "internalType": "address", + "name": "registryAddress", + "type": "address" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "RegistrySet", + "type": "event" }, { - "constant": false, + "anonymous": false, "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "transactionId", + "name": "spread", "type": "uint256" } ], - "name": "executeTransaction", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" + "name": "SpreadSet", + "type": "event" }, { - "constant": true, + "anonymous": false, "inputs": [ { + "indexed": false, + "internalType": "string", + "name": "stableTokenRegistryId", + "type": "string" + }, + { + "indexed": false, "internalType": "uint256", - "name": "transactionId", + "name": "minExchangeAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "maxExchangeAmount", "type": "uint256" } ], - "name": "getConfirmationCount", - "outputs": [ + "name": "StableTokenExchangeLimitsSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ { + "indexed": false, "internalType": "uint256", - "name": "count", + "name": "vetoPeriodSeconds", "type": "uint256" } ], - "payable": false, - "stateMutability": "view", - "type": "function" + "name": "VetoPeriodSecondsSet", + "type": "event" }, { "constant": true, "inputs": [ { "internalType": "uint256", - "name": "transactionId", + "name": "", "type": "uint256" } ], - "name": "getConfirmations", + "name": "activeProposalIdsSuperset", "outputs": [ { - "internalType": "address[]", - "name": "_confirmations", - "type": "address[]" + "internalType": "uint256", + "name": "", + "type": "uint256" } ], "payable": false, @@ -15664,12 +17427,12 @@ func init() { { "constant": true, "inputs": [], - "name": "getOwners", + "name": "approver", "outputs": [ { - "internalType": "address[]", + "internalType": "address", "name": "", - "type": "address[]" + "type": "address" } ], "payable": false, @@ -15678,23 +17441,12 @@ func init() { }, { "constant": true, - "inputs": [ - { - "internalType": "bool", - "name": "pending", - "type": "bool" - }, - { - "internalType": "bool", - "name": "executed", - "type": "bool" - } - ], - "name": "getTransactionCount", + "inputs": [], + "name": "exchangeProposalCount", "outputs": [ { "internalType": "uint256", - "name": "count", + "name": "", "type": "uint256" } ], @@ -15707,60 +17459,60 @@ func init() { "inputs": [ { "internalType": "uint256", - "name": "from", + "name": "", "type": "uint256" + } + ], + "name": "exchangeProposals", + "outputs": [ + { + "internalType": "address payable", + "name": "exchanger", + "type": "address" }, { - "internalType": "uint256", - "name": "to", - "type": "uint256" + "internalType": "address", + "name": "stableToken", + "type": "address" }, { - "internalType": "bool", - "name": "pending", - "type": "bool" + "internalType": "enum GrandaMento.ExchangeProposalState", + "name": "state", + "type": "uint8" }, { "internalType": "bool", - "name": "executed", + "name": "sellCelo", "type": "bool" - } - ], - "name": "getTransactionIds", - "outputs": [ + }, { - "internalType": "uint256[]", - "name": "_transactionIds", - "type": "uint256[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": false, - "inputs": [ + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, { - "internalType": "address[]", - "name": "_owners", - "type": "address[]" + "internalType": "uint256", + "name": "buyAmount", + "type": "uint256" }, { "internalType": "uint256", - "name": "_required", + "name": "celoStableTokenExchangeRate", "type": "uint256" }, { "internalType": "uint256", - "name": "_internalRequired", + "name": "vetoPeriodSeconds", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "approvalTimestamp", "type": "uint256" } ], - "name": "initialize", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { @@ -15781,12 +17533,12 @@ func init() { { "constant": true, "inputs": [], - "name": "internalRequired", + "name": "isOwner", "outputs": [ { - "internalType": "uint256", + "internalType": "bool", "name": "", - "type": "uint256" + "type": "bool" } ], "payable": false, @@ -15795,59 +17547,41 @@ func init() { }, { "constant": true, - "inputs": [ + "inputs": [], + "name": "maxApprovalExchangeRateChange", + "outputs": [ { "internalType": "uint256", - "name": "transactionId", + "name": "value", "type": "uint256" } ], - "name": "isConfirmed", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, - "inputs": [ + "inputs": [], + "name": "owner", + "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], - "name": "isOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "owners", + "inputs": [], + "name": "registry", "outputs": [ { - "internalType": "address", + "internalType": "contract IRegistry", "name": "", "type": "address" } @@ -15858,14 +17592,8 @@ func init() { }, { "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "removeOwner", + "inputs": [], + "name": "renounceOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -15876,16 +17604,11 @@ func init() { "inputs": [ { "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "newOwner", + "name": "registryAddress", "type": "address" } ], - "name": "replaceOwner", + "name": "setRegistry", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -15894,11 +17617,11 @@ func init() { { "constant": true, "inputs": [], - "name": "required", + "name": "spread", "outputs": [ { "internalType": "uint256", - "name": "", + "name": "value", "type": "uint256" } ], @@ -15907,47 +17630,42 @@ func init() { "type": "function" }, { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "uint256", - "name": "transactionId", - "type": "uint256" + "internalType": "string", + "name": "", + "type": "string" } ], - "name": "revokeConfirmation", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, + "name": "stableTokenExchangeLimits", + "outputs": [ { "internalType": "uint256", - "name": "value", + "name": "minExchangeAmount", "type": "uint256" }, { - "internalType": "bytes", - "name": "data", - "type": "bytes" + "internalType": "uint256", + "name": "maxExchangeAmount", + "type": "uint256" } ], - "name": "submitTransaction", - "outputs": [ + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ { - "internalType": "uint256", - "name": "transactionId", - "type": "uint256" + "internalType": "address", + "name": "newOwner", + "type": "address" } ], + "name": "transferOwnership", + "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -15955,7 +17673,7 @@ func init() { { "constant": true, "inputs": [], - "name": "transactionCount", + "name": "vetoPeriodSeconds", "outputs": [ { "internalType": "uint256", @@ -15969,148 +17687,170 @@ func init() { }, { "constant": true, - "inputs": [ + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, { "internalType": "uint256", "name": "", "type": "uint256" } ], - "name": "transactions", - "outputs": [ + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [ { "internalType": "address", - "name": "destination", + "name": "_registry", + "type": "address" + }, + { + "internalType": "address", + "name": "_approver", "type": "address" }, { "internalType": "uint256", - "name": "value", + "name": "_maxApprovalExchangeRateChange", "type": "uint256" }, { - "internalType": "bytes", - "name": "data", - "type": "bytes" + "internalType": "uint256", + "name": "_spread", + "type": "uint256" }, { - "internalType": "bool", - "name": "executed", - "type": "bool" + "internalType": "uint256", + "name": "_vetoPeriodSeconds", + "type": "uint256" } ], + "name": "initialize", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" - } - ]`)// GovernanceSlasher ABI - abis["GovernanceSlasher"] = mustParseABI(`[ + }, { + "constant": false, "inputs": [ + { + "internalType": "string", + "name": "stableTokenRegistryId", + "type": "string" + }, + { + "internalType": "uint256", + "name": "sellAmount", + "type": "uint256" + }, { "internalType": "bool", - "name": "test", + "name": "sellCelo", "type": "bool" } ], + "name": "createExchangeProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], "payable": false, "stateMutability": "nonpayable", - "type": "constructor" + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, "internalType": "uint256", - "name": "amount", + "name": "proposalId", "type": "uint256" } ], - "name": "GovernanceSlashPerformed", - "type": "event" + "name": "approveExchangeProposal", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" } ], - "name": "OwnershipTransferred", - "type": "event" + "name": "cancelExchangeProposal", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": false, "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "registryAddress", - "type": "address" + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" } ], - "name": "RegistrySet", - "type": "event" + "name": "executeExchangeProposal", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" }, { - "anonymous": false, + "constant": true, "inputs": [ { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" + "internalType": "uint256", + "name": "celoStableTokenExchangeRate", + "type": "uint256" }, { - "indexed": false, "internalType": "uint256", - "name": "amount", + "name": "sellAmount", "type": "uint256" - } - ], - "name": "SlashingApproved", - "type": "event" - }, - { - "constant": true, - "inputs": [], - "name": "initialized", - "outputs": [ + }, { "internalType": "bool", - "name": "", + "name": "sellCelo", "type": "bool" } ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, - { - "constant": true, - "inputs": [], - "name": "isOwner", + "name": "getBuyAmount", "outputs": [ { - "internalType": "bool", + "internalType": "uint256", "name": "", - "type": "bool" + "type": "uint256" } ], "payable": false, @@ -16118,29 +17858,29 @@ func init() { "type": "function" }, { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ + "constant": false, + "inputs": [ { - "internalType": "address", - "name": "", - "type": "address" + "internalType": "uint256", + "name": "index", + "type": "uint256" } ], + "name": "removeFromActiveProposalIdsSuperset", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], - "name": "registry", + "name": "getActiveProposalIds", "outputs": [ { - "internalType": "contract IRegistry", + "internalType": "uint256[]", "name": "", - "type": "address" + "type": "uint256[]" } ], "payable": false, @@ -16148,42 +17888,29 @@ func init() { "type": "function" }, { - "constant": false, - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, + "constant": true, "inputs": [ { - "internalType": "address", - "name": "registryAddress", - "type": "address" + "internalType": "string", + "name": "stableTokenRegistryId", + "type": "string" } ], - "name": "setRegistry", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": false, - "inputs": [ + "name": "getStableTokenExchangeLimits", + "outputs": [ { - "internalType": "address", - "name": "newOwner", - "type": "address" + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" } ], - "name": "transferOwnership", - "outputs": [], "payable": false, - "stateMutability": "nonpayable", + "stateMutability": "view", "type": "function" }, { @@ -16191,11 +17918,11 @@ func init() { "inputs": [ { "internalType": "address", - "name": "registryAddress", + "name": "newApprover", "type": "address" } ], - "name": "initialize", + "name": "setApprover", "outputs": [], "payable": false, "stateMutability": "nonpayable", @@ -16204,76 +17931,69 @@ func init() { { "constant": false, "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, { "internalType": "uint256", - "name": "penalty", + "name": "newMaxApprovalExchangeRateChange", "type": "uint256" } ], - "name": "approveSlashing", + "name": "setMaxApprovalExchangeRateChange", "outputs": [], "payable": false, "stateMutability": "nonpayable", - "type": "function" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getApprovedSlashing", - "outputs": [ + "type": "function" + }, + { + "constant": false, + "inputs": [ { "internalType": "uint256", - "name": "", + "name": "newSpread", "type": "uint256" } ], + "name": "setSpread", + "outputs": [], "payable": false, - "stateMutability": "view", + "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address[]", - "name": "electionLessers", - "type": "address[]" + "internalType": "string", + "name": "stableTokenRegistryId", + "type": "string" }, { - "internalType": "address[]", - "name": "electionGreaters", - "type": "address[]" + "internalType": "uint256", + "name": "minExchangeAmount", + "type": "uint256" }, { - "internalType": "uint256[]", - "name": "electionIndices", - "type": "uint256[]" + "internalType": "uint256", + "name": "maxExchangeAmount", + "type": "uint256" } ], - "name": "slash", - "outputs": [ + "name": "setStableTokenExchangeLimits", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ { - "internalType": "bool", - "name": "", - "type": "bool" + "internalType": "uint256", + "name": "newVetoPeriodSeconds", + "type": "uint256" } ], + "name": "setVetoPeriodSeconds", + "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" @@ -17056,6 +18776,222 @@ func init() { "stateMutability": "nonpayable", "type": "function" } + ]`)// OdisPayments ABI + abis["OdisPayments"] = mustParseABI(`[ + { + "inputs": [ + { + "internalType": "bool", + "name": "test", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "valueInCUSD", + "type": "uint256" + } + ], + "name": "PaymentMade", + "type": "event" + }, + { + "constant": true, + "inputs": [], + "name": "initialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "registryContract", + "outputs": [ + { + "internalType": "contract IRegistry", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "totalPaidCUSD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "initialize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "payInCUSD", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + } ]`)// Proxy ABI abis["Proxy"] = mustParseABI(`[ { diff --git a/mycelo/env/core_contracts.go b/mycelo/env/core_contracts.go index d3cfe14495..30475cd840 100644 --- a/mycelo/env/core_contracts.go +++ b/mycelo/env/core_contracts.go @@ -51,6 +51,9 @@ var genesisAddresses = map[string]common.Address{ "ExchangeEUR": addr("0xf025"), "StableTokenBRL": addr("0xf026"), "ExchangeBRL": addr("0xf027"), + "GrandaMento": addr("0xf028"), + "FederatedAttestations": addr("0xf029"), + "OdisPayments": addr("0xf030"), // Contract Proxies "RegistryProxy": addr("0xce10"), @@ -81,6 +84,9 @@ var genesisAddresses = map[string]common.Address{ "ExchangeEURProxy": addr("0xd025"), "StableTokenBRLProxy": addr("0xd026"), "ExchangeBRLProxy": addr("0xd027"), + "GrandaMentoProxy": addr("0xd028"), + "FederatedAttestationsProxy": addr("0xd029"), + "OdisPaymentsProxy": addr("0xd030"), } var libraries = []string{ diff --git a/mycelo/genesis/README.md b/mycelo/genesis/README.md new file mode 100644 index 0000000000..137ca15a24 --- /dev/null +++ b/mycelo/genesis/README.md @@ -0,0 +1,5 @@ +To generate the *_parameters_json files: + +``` +go generate mycelo/genesis/config.g +``` diff --git a/mycelo/genesis/base_config.go b/mycelo/genesis/base_config.go index 87848f7cfc..37d2a2bd1c 100644 --- a/mycelo/genesis/base_config.go +++ b/mycelo/genesis/base_config.go @@ -178,5 +178,27 @@ func BaseConfig() *Config { BaselineUpdateFactor: fixed("0.2"), BaselineQuorumFactor: fixed("1"), }, + GrandaMento: GrandaMentoParameters{ + MaxApprovalExchangeRateChange: fixed("0.3"), + Spread: fixed("0.005"), + VetoPeriodSeconds: 10, + StableTokenExchangeLimits: []StableTokenExchangeLimit{ + { + StableToken: "StableToken", + MinExchangeAmount: bigIntStr("50000000000000000000000"), + MaxExchangeAmount: bigIntStr("50000000000000000000000000"), + }, + { + StableToken: "StableTokenEUR", + MinExchangeAmount: bigIntStr("40000000000000000000000"), + MaxExchangeAmount: bigIntStr("40000000000000000000000000"), + }, + { + StableToken: "StableTokenBRL", + MinExchangeAmount: bigIntStr("40000000000000000000000"), + MaxExchangeAmount: bigIntStr("40000000000000000000000000"), + }, + }, + }, } } diff --git a/mycelo/genesis/config.go b/mycelo/genesis/config.go index 3980c4e997..2e7bb6f77d 100644 --- a/mycelo/genesis/config.go +++ b/mycelo/genesis/config.go @@ -51,6 +51,7 @@ type Config struct { DoubleSigningSlasher DoubleSigningSlasherParameters DowntimeSlasher DowntimeSlasherParameters Governance GovernanceParameters + GrandaMento GrandaMentoParameters } // Save will write config into a json file @@ -278,6 +279,32 @@ type GasPriceMinimumParametersMarshaling struct { MinimumFloor *bigintstr.BigIntStr `json:"minimumFloor"` } +// GrandaMentoParameters are the initial configuration parameters for GrandaMento +type GrandaMentoParameters struct { + Approver common.Address `json:"approver"` + MaxApprovalExchangeRateChange *fixed.Fixed `json:"maxApprovalExchangeRateChange"` + Spread *fixed.Fixed `json:"spread"` + VetoPeriodSeconds uint64 `json:"vetoPeriodSeconds"` + StableTokenExchangeLimits StableTokenExchangeLimitsList `json:"stableTokenExchangeLimits"` +} + +//go:generate gencodec -type StableTokenExchangeLimit -field-override StableTokenExchangeLimitsMarshaling -out gen_stable_token_exchange_limit_json.go + +// StableTokenExchangeLimit represents the granda mento's exchange limit for a specific stable +type StableTokenExchangeLimit struct { + StableToken string `json:"stableToken"` + MinExchangeAmount *big.Int `json:"minExchangeAmount"` + MaxExchangeAmount *big.Int `json:"maxExchangeAmount"` +} + +type StableTokenExchangeLimitsMarshaling struct { + MinExchangeAmount *bigintstr.BigIntStr `json:"minExchangeAmount"` + MaxExchangeAmount *bigintstr.BigIntStr `json:"maxExchangeAmount"` +} + +// BalanceList list of balances +type StableTokenExchangeLimitsList []StableTokenExchangeLimit + //go:generate gencodec -type ReserveParameters -field-override ReserveParametersMarshaling -out gen_reserve_parameters_json.go // ReserveParameters are the initial configuration parameters for Reserve diff --git a/mycelo/genesis/gen_governance_parameters_json.go b/mycelo/genesis/gen_governance_parameters_json.go index 8a6e35b724..9b753c8a74 100644 --- a/mycelo/genesis/gen_governance_parameters_json.go +++ b/mycelo/genesis/gen_governance_parameters_json.go @@ -17,16 +17,16 @@ func (g GovernanceParameters) MarshalJSON() ([]byte, error) { type GovernanceParameters struct { UseMultiSig bool `json:"useMultiSig"` ConcurrentProposals uint64 `json:"concurrentProposals"` - MinDeposit *bigintstr.BigIntStr `json:"MinDeposit"` - QueueExpiry uint64 `json:"QueueExpiry"` - DequeueFrequency uint64 `json:"DequeueFrequency"` - ApprovalStageDuration uint64 `json:"ApprovalStageDuration"` - ReferendumStageDuration uint64 `json:"ReferendumStageDuration"` - ExecutionStageDuration uint64 `json:"ExecutionStageDuration"` + MinDeposit *bigintstr.BigIntStr `json:"minDeposit"` + QueueExpiry uint64 `json:"queueExpiry"` + DequeueFrequency uint64 `json:"dequeueFrequency"` + ApprovalStageDuration uint64 `json:"approvalStageDuration"` + ReferendumStageDuration uint64 `json:"referendumStageDuration"` + ExecutionStageDuration uint64 `json:"executionStageDuration"` ParticipationBaseline *fixed.Fixed `json:"participationBaseline"` ParticipationFloor *fixed.Fixed `json:"participationFloor"` - BaselineUpdateFactor *fixed.Fixed `json:"BaselineUpdateFactor"` - BaselineQuorumFactor *fixed.Fixed `json:"BaselineQuorumFactor"` + BaselineUpdateFactor *fixed.Fixed `json:"baselineUpdateFactor"` + BaselineQuorumFactor *fixed.Fixed `json:"baselineQuorumFactor"` } var enc GovernanceParameters enc.UseMultiSig = g.UseMultiSig @@ -49,16 +49,16 @@ func (g *GovernanceParameters) UnmarshalJSON(input []byte) error { type GovernanceParameters struct { UseMultiSig *bool `json:"useMultiSig"` ConcurrentProposals *uint64 `json:"concurrentProposals"` - MinDeposit *bigintstr.BigIntStr `json:"MinDeposit"` - QueueExpiry *uint64 `json:"QueueExpiry"` - DequeueFrequency *uint64 `json:"DequeueFrequency"` - ApprovalStageDuration *uint64 `json:"ApprovalStageDuration"` - ReferendumStageDuration *uint64 `json:"ReferendumStageDuration"` - ExecutionStageDuration *uint64 `json:"ExecutionStageDuration"` + MinDeposit *bigintstr.BigIntStr `json:"minDeposit"` + QueueExpiry *uint64 `json:"queueExpiry"` + DequeueFrequency *uint64 `json:"dequeueFrequency"` + ApprovalStageDuration *uint64 `json:"approvalStageDuration"` + ReferendumStageDuration *uint64 `json:"referendumStageDuration"` + ExecutionStageDuration *uint64 `json:"executionStageDuration"` ParticipationBaseline *fixed.Fixed `json:"participationBaseline"` ParticipationFloor *fixed.Fixed `json:"participationFloor"` - BaselineUpdateFactor *fixed.Fixed `json:"BaselineUpdateFactor"` - BaselineQuorumFactor *fixed.Fixed `json:"BaselineQuorumFactor"` + BaselineUpdateFactor *fixed.Fixed `json:"baselineUpdateFactor"` + BaselineQuorumFactor *fixed.Fixed `json:"baselineQuorumFactor"` } var dec GovernanceParameters if err := json.Unmarshal(input, &dec); err != nil { diff --git a/mycelo/genesis/gen_stable_token_exchange_limit_json.go b/mycelo/genesis/gen_stable_token_exchange_limit_json.go new file mode 100644 index 0000000000..626e4607b8 --- /dev/null +++ b/mycelo/genesis/gen_stable_token_exchange_limit_json.go @@ -0,0 +1,49 @@ +// Code generated by github.com/fjl/gencodec. DO NOT EDIT. + +package genesis + +import ( + "encoding/json" + "math/big" + + "github.com/celo-org/celo-blockchain/common/decimal/bigintstr" +) + +var _ = (*StableTokenExchangeLimitsMarshaling)(nil) + +// MarshalJSON marshals as JSON. +func (s StableTokenExchangeLimit) MarshalJSON() ([]byte, error) { + type StableTokenExchangeLimit struct { + StableToken string `json:"stableToken"` + MinExchangeAmount *bigintstr.BigIntStr `json:"minExchangeAmount"` + MaxExchangeAmount *bigintstr.BigIntStr `json:"maxExchangeAmount"` + } + var enc StableTokenExchangeLimit + enc.StableToken = s.StableToken + enc.MinExchangeAmount = (*bigintstr.BigIntStr)(s.MinExchangeAmount) + enc.MaxExchangeAmount = (*bigintstr.BigIntStr)(s.MaxExchangeAmount) + return json.Marshal(&enc) +} + +// UnmarshalJSON unmarshals from JSON. +func (s *StableTokenExchangeLimit) UnmarshalJSON(input []byte) error { + type StableTokenExchangeLimit struct { + StableToken *string `json:"stableToken"` + MinExchangeAmount *bigintstr.BigIntStr `json:"minExchangeAmount"` + MaxExchangeAmount *bigintstr.BigIntStr `json:"maxExchangeAmount"` + } + var dec StableTokenExchangeLimit + if err := json.Unmarshal(input, &dec); err != nil { + return err + } + if dec.StableToken != nil { + s.StableToken = *dec.StableToken + } + if dec.MinExchangeAmount != nil { + s.MinExchangeAmount = (*big.Int)(dec.MinExchangeAmount) + } + if dec.MaxExchangeAmount != nil { + s.MaxExchangeAmount = (*big.Int)(dec.MaxExchangeAmount) + } + return nil +} diff --git a/mycelo/genesis/genesis_state.go b/mycelo/genesis/genesis_state.go index 2f31cabb05..b3cdbb8f94 100644 --- a/mycelo/genesis/genesis_state.go +++ b/mycelo/genesis/genesis_state.go @@ -80,82 +80,96 @@ func (ctx *deployContext) deploy() (core.GenesisAlloc, error) { ctx.fundAdminAccount() deploySteps := [](func() error){ + // X, Y => X is the number in this list, Y is the migration number in the protocol folder for the core contracts + + // i:00, migr:01 Libraries ctx.deployLibraries, - // 01 Registry + + // i:01, migr:02 Registry ctx.deployRegistry, - // 02 Freezer + + // i:02, migr:03 Freezer ctx.deployFreezer, - // 03 TransferWhitelist + // i:03, migr:03 TransferWhitelist ctx.deployTransferWhitelist, - // 03.bis FeeCurrencyWhitelist + // i:04, migr:03 FeeCurrencyWhitelist ctx.deployFeeCurrencyWhitelist, - // 04 GoldToken + // i:05, migr:04 GoldToken ctx.deployGoldToken, - // 05 SortedOracles + // i:06, migr:05 SortedOracles ctx.deploySortedOracles, - // 06 GasPriceMinimum + // i:07, migr:06 GasPriceMinimum ctx.deployGasPriceMinimum, - // 07 Reserve + // i:08, migr:07 Reserve ctx.deployReserve, - // 08 ReserveSpenderMultisig (requires reserve to work) + // i:09, migr:08 ReserveSpenderMultisig (requires reserve to work) ctx.deployReserveSpenderMultisig, - // 09 StableToken, StableTokenEUR and StableTokenBRL + // i:10, migr:09 StableToken, StableTokenEUR and StableTokenBRL ctx.deployStableTokens, - // 10 Exchange, ExchangeEUR and ExchangeBRL + // i:11, migr:10 Exchange, ExchangeEUR and ExchangeBRL ctx.deployExchanges, - // 11 Accounts + // i:12, migr:11 Accounts ctx.deployAccounts, - // 12 LockedGold + // i:13, migr:12 LockedGold ctx.deployLockedGold, - // 13 Validators + // i:14, migr:13 Validators ctx.deployValidators, - // 14 Election + // i:15, migr:14 Election ctx.deployElection, - // 15 EpochRewards + // i:16, migr:15 EpochRewards ctx.deployEpochRewards, - // 16 Random + // i:17, migr:16 Random ctx.deployRandom, - // 17 Attestations + // i:18, migr17 Attestations ctx.deployAttestations, - // 18 Escrow + // 1:19, migr:18 Escrow ctx.deployEscrow, - // 19 BlockchainParameters + // i:20, migr:19 BlockchainParameters ctx.deployBlockchainParameters, - // 20 GovernanceSlasher + // i:21, migr:20 GovernanceSlasher ctx.deployGovernanceSlasher, - // 21 DoubleSigningSlasher + // i:22, migr:21 DoubleSigningSlasher ctx.deployDoubleSigningSlasher, - // 22 DowntimeSlasher + // i:23, migr:22 DowntimeSlasher ctx.deployDowntimeSlasher, - // 23 GovernanceApproverMultiSig + // i:24, migr:23 GovernanceApproverMultiSig ctx.deployGovernanceApproverMultiSig, - // 24 Governance + // i:25, migr:24 GrandaMento + ctx.deployGrandaMento, + + // i:26, migr:25 FederatedAttestations + ctx.deployFederatedAttestations, + + // i:27, migr:26 OdisPayment + ctx.deployOdisPayments, + + // i:28, migr:27 Governance ctx.deployGovernance, - // 25 Elect Validators + // i:29, migr:28 Elect Validators ctx.electValidators, } @@ -461,7 +475,7 @@ func (ctx *deployContext) deployAttestations() error { func (ctx *deployContext) deployEscrow() error { return ctx.deployCoreContract("Escrow", func(contract *contract.EVMBackend) error { - return contract.SimpleCall("initialize", env.MustProxyAddressFor("Registry")) + return contract.SimpleCall("initialize") }) } @@ -471,6 +485,46 @@ func (ctx *deployContext) deployFeeCurrencyWhitelist() error { }) } +func (ctx *deployContext) deployGrandaMento() error { + approver := ctx.accounts.AdminAccount().Address + + err := ctx.deployCoreContract("GrandaMento", func(contract *contract.EVMBackend) error { + return contract.SimpleCall("initialize", + env.MustProxyAddressFor("Registry"), + approver, + ctx.genesisConfig.GrandaMento.MaxApprovalExchangeRateChange.BigInt(), + ctx.genesisConfig.GrandaMento.Spread.BigInt(), + newBigInt(ctx.genesisConfig.GrandaMento.VetoPeriodSeconds), + ) + }) + if err != nil { + return err + } + + ctx.logger.Info("Adding GrandaMento as a new exchange spender to the reserve", "GrandaMento", env.MustProxyAddressFor("GrandaMento")) + ctx.contract("Reserve").SimpleCall("addExchangeSpender", env.MustProxyAddressFor("GrandaMento")) + + for _, exchangeLimit := range ctx.genesisConfig.GrandaMento.StableTokenExchangeLimits { + err = ctx.contract("GrandaMento").SimpleCall("setStableTokenExchangeLimits", exchangeLimit.StableToken, exchangeLimit.MinExchangeAmount, exchangeLimit.MaxExchangeAmount) + if err != nil { + return err + } + } + return nil +} + +func (ctx *deployContext) deployFederatedAttestations() error { + return ctx.deployCoreContract("FederatedAttestations", func(contract *contract.EVMBackend) error { + return contract.SimpleCall("initialize") + }) +} + +func (ctx *deployContext) deployOdisPayments() error { + return ctx.deployCoreContract("OdisPayments", func(contract *contract.EVMBackend) error { + return contract.SimpleCall("initialize") + }) +} + func (ctx *deployContext) deployGoldToken() error { err := ctx.deployCoreContract("GoldToken", func(contract *contract.EVMBackend) error { return contract.SimpleCall("initialize", env.MustProxyAddressFor("Registry")) diff --git a/mycelo/internal/scripts/generate/main.go b/mycelo/internal/scripts/generate/main.go index cc9bbcc0b4..e2a7d98804 100644 --- a/mycelo/internal/scripts/generate/main.go +++ b/mycelo/internal/scripts/generate/main.go @@ -66,6 +66,9 @@ var contractNames = []string{ "DowntimeSlasher", "GovernanceApproverMultiSig", "Governance", + "GrandaMento", + "FederatedAttestations", + "OdisPayments", } var buildPath = flag.String("buildpath", "", "the folder where truffle contract build live (on monorepo ./packages/protocol/build/contracts )") diff --git a/params/version.go b/params/version.go index 3a7aed2190..24c8a81579 100644 --- a/params/version.go +++ b/params/version.go @@ -27,7 +27,7 @@ import ( const ( VersionMajor = 1 // Major version component of the current release VersionMinor = 7 // Minor version component of the current release - VersionPatch = 2 // Patch version component of the current release + VersionPatch = 3 // Patch version component of the current release VersionMeta = "stable" // Version metadata to append to the version string )