From 5801a9f231d3914fe6478a45d37f7ea24f6c2768 Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Tue, 10 Oct 2023 15:44:30 +0200 Subject: [PATCH 1/5] Add more contracts from monorepo --- contracts/celo/abigen/FeeCurrency.go | 822 +++++++ contracts/celo/abigen/FeeCurrencyWhitelist.go | 865 +++++++ contracts/celo/abigen/GoldToken.go | 51 +- contracts/celo/abigen/Registry.go | 33 +- contracts/celo/abigen/SortedOracles.go | 2056 +++++++++++++++++ contracts/celo/celo.go | 19 +- .../AddressSortedLinkedListWithMedian.abi | 40 + ...ressSortedLinkedListWithMedian.bin-runtime | 1 + .../{Registry.abi => CeloRegistry.abi} | 0 ...y.bin-runtime => CeloRegistry.bin-runtime} | 0 contracts/celo/compiled/FeeCurrency.abi | 354 +++ .../celo/compiled/FeeCurrency.bin-runtime | 1 + .../celo/compiled/FeeCurrencyWhitelist.abi | 202 ++ .../compiled/FeeCurrencyWhitelist.bin-runtime | 1 + contracts/celo/compiled/GoldToken.abi | 8 +- contracts/celo/compiled/Proxy.abi | 129 ++ contracts/celo/compiled/Proxy.bin-runtime | 2 +- contracts/celo/compiled/SortedOracles.abi | 657 ++++++ .../celo/compiled/SortedOracles.bin-runtime | 1 + contracts/celo/compiled/update.sh | 2 +- 20 files changed, 5163 insertions(+), 81 deletions(-) create mode 100644 contracts/celo/abigen/FeeCurrency.go create mode 100644 contracts/celo/abigen/FeeCurrencyWhitelist.go create mode 100644 contracts/celo/abigen/SortedOracles.go create mode 100644 contracts/celo/compiled/AddressSortedLinkedListWithMedian.abi create mode 100644 contracts/celo/compiled/AddressSortedLinkedListWithMedian.bin-runtime rename contracts/celo/compiled/{Registry.abi => CeloRegistry.abi} (100%) rename contracts/celo/compiled/{Registry.bin-runtime => CeloRegistry.bin-runtime} (100%) create mode 100644 contracts/celo/compiled/FeeCurrency.abi create mode 100644 contracts/celo/compiled/FeeCurrency.bin-runtime create mode 100644 contracts/celo/compiled/FeeCurrencyWhitelist.abi create mode 100644 contracts/celo/compiled/FeeCurrencyWhitelist.bin-runtime create mode 100644 contracts/celo/compiled/Proxy.abi create mode 100644 contracts/celo/compiled/SortedOracles.abi create mode 100644 contracts/celo/compiled/SortedOracles.bin-runtime diff --git a/contracts/celo/abigen/FeeCurrency.go b/contracts/celo/abigen/FeeCurrency.go new file mode 100644 index 0000000000..2b6496ffa0 --- /dev/null +++ b/contracts/celo/abigen/FeeCurrency.go @@ -0,0 +1,822 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abigen + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// FeeCurrencyMetaData contains all meta data concerning the FeeCurrency contract. +var FeeCurrencyMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name_\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"symbol_\",\"type\":\"string\"}],\"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\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"feeRecipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"communityFund\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"refund\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tipTxFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"baseTxFee\",\"type\":\"uint256\"}],\"name\":\"creditGasFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"debitGasFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// FeeCurrencyABI is the input ABI used to generate the binding from. +// Deprecated: Use FeeCurrencyMetaData.ABI instead. +var FeeCurrencyABI = FeeCurrencyMetaData.ABI + +// FeeCurrency is an auto generated Go binding around an Ethereum contract. +type FeeCurrency struct { + FeeCurrencyCaller // Read-only binding to the contract + FeeCurrencyTransactor // Write-only binding to the contract + FeeCurrencyFilterer // Log filterer for contract events +} + +// FeeCurrencyCaller is an auto generated read-only Go binding around an Ethereum contract. +type FeeCurrencyCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FeeCurrencyTransactor is an auto generated write-only Go binding around an Ethereum contract. +type FeeCurrencyTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FeeCurrencyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type FeeCurrencyFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FeeCurrencySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type FeeCurrencySession struct { + Contract *FeeCurrency // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// FeeCurrencyCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type FeeCurrencyCallerSession struct { + Contract *FeeCurrencyCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// FeeCurrencyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type FeeCurrencyTransactorSession struct { + Contract *FeeCurrencyTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// FeeCurrencyRaw is an auto generated low-level Go binding around an Ethereum contract. +type FeeCurrencyRaw struct { + Contract *FeeCurrency // Generic contract binding to access the raw methods on +} + +// FeeCurrencyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type FeeCurrencyCallerRaw struct { + Contract *FeeCurrencyCaller // Generic read-only contract binding to access the raw methods on +} + +// FeeCurrencyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type FeeCurrencyTransactorRaw struct { + Contract *FeeCurrencyTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewFeeCurrency creates a new instance of FeeCurrency, bound to a specific deployed contract. +func NewFeeCurrency(address common.Address, backend bind.ContractBackend) (*FeeCurrency, error) { + contract, err := bindFeeCurrency(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &FeeCurrency{FeeCurrencyCaller: FeeCurrencyCaller{contract: contract}, FeeCurrencyTransactor: FeeCurrencyTransactor{contract: contract}, FeeCurrencyFilterer: FeeCurrencyFilterer{contract: contract}}, nil +} + +// NewFeeCurrencyCaller creates a new read-only instance of FeeCurrency, bound to a specific deployed contract. +func NewFeeCurrencyCaller(address common.Address, caller bind.ContractCaller) (*FeeCurrencyCaller, error) { + contract, err := bindFeeCurrency(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &FeeCurrencyCaller{contract: contract}, nil +} + +// NewFeeCurrencyTransactor creates a new write-only instance of FeeCurrency, bound to a specific deployed contract. +func NewFeeCurrencyTransactor(address common.Address, transactor bind.ContractTransactor) (*FeeCurrencyTransactor, error) { + contract, err := bindFeeCurrency(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &FeeCurrencyTransactor{contract: contract}, nil +} + +// NewFeeCurrencyFilterer creates a new log filterer instance of FeeCurrency, bound to a specific deployed contract. +func NewFeeCurrencyFilterer(address common.Address, filterer bind.ContractFilterer) (*FeeCurrencyFilterer, error) { + contract, err := bindFeeCurrency(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &FeeCurrencyFilterer{contract: contract}, nil +} + +// bindFeeCurrency binds a generic wrapper to an already deployed contract. +func bindFeeCurrency(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := FeeCurrencyMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_FeeCurrency *FeeCurrencyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _FeeCurrency.Contract.FeeCurrencyCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_FeeCurrency *FeeCurrencyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeCurrency.Contract.FeeCurrencyTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_FeeCurrency *FeeCurrencyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _FeeCurrency.Contract.FeeCurrencyTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_FeeCurrency *FeeCurrencyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _FeeCurrency.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_FeeCurrency *FeeCurrencyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeCurrency.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_FeeCurrency *FeeCurrencyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _FeeCurrency.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_FeeCurrency *FeeCurrencyCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _FeeCurrency.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_FeeCurrency *FeeCurrencySession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _FeeCurrency.Contract.Allowance(&_FeeCurrency.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_FeeCurrency *FeeCurrencyCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _FeeCurrency.Contract.Allowance(&_FeeCurrency.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_FeeCurrency *FeeCurrencyCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _FeeCurrency.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_FeeCurrency *FeeCurrencySession) BalanceOf(account common.Address) (*big.Int, error) { + return _FeeCurrency.Contract.BalanceOf(&_FeeCurrency.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_FeeCurrency *FeeCurrencyCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _FeeCurrency.Contract.BalanceOf(&_FeeCurrency.CallOpts, account) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_FeeCurrency *FeeCurrencyCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _FeeCurrency.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_FeeCurrency *FeeCurrencySession) Decimals() (uint8, error) { + return _FeeCurrency.Contract.Decimals(&_FeeCurrency.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_FeeCurrency *FeeCurrencyCallerSession) Decimals() (uint8, error) { + return _FeeCurrency.Contract.Decimals(&_FeeCurrency.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_FeeCurrency *FeeCurrencyCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _FeeCurrency.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_FeeCurrency *FeeCurrencySession) Name() (string, error) { + return _FeeCurrency.Contract.Name(&_FeeCurrency.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_FeeCurrency *FeeCurrencyCallerSession) Name() (string, error) { + return _FeeCurrency.Contract.Name(&_FeeCurrency.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_FeeCurrency *FeeCurrencyCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _FeeCurrency.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_FeeCurrency *FeeCurrencySession) Symbol() (string, error) { + return _FeeCurrency.Contract.Symbol(&_FeeCurrency.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_FeeCurrency *FeeCurrencyCallerSession) Symbol() (string, error) { + return _FeeCurrency.Contract.Symbol(&_FeeCurrency.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_FeeCurrency *FeeCurrencyCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _FeeCurrency.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_FeeCurrency *FeeCurrencySession) TotalSupply() (*big.Int, error) { + return _FeeCurrency.Contract.TotalSupply(&_FeeCurrency.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_FeeCurrency *FeeCurrencyCallerSession) TotalSupply() (*big.Int, error) { + return _FeeCurrency.Contract.TotalSupply(&_FeeCurrency.CallOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencySession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.Approve(&_FeeCurrency.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.Approve(&_FeeCurrency.TransactOpts, spender, amount) +} + +// CreditGasFees is a paid mutator transaction binding the contract method 0x6a30b253. +// +// Solidity: function creditGasFees(address from, address feeRecipient, address , address communityFund, uint256 refund, uint256 tipTxFee, uint256 , uint256 baseTxFee) returns() +func (_FeeCurrency *FeeCurrencyTransactor) CreditGasFees(opts *bind.TransactOpts, from common.Address, feeRecipient common.Address, arg2 common.Address, communityFund common.Address, refund *big.Int, tipTxFee *big.Int, arg6 *big.Int, baseTxFee *big.Int) (*types.Transaction, error) { + return _FeeCurrency.contract.Transact(opts, "creditGasFees", from, feeRecipient, arg2, communityFund, refund, tipTxFee, arg6, baseTxFee) +} + +// CreditGasFees is a paid mutator transaction binding the contract method 0x6a30b253. +// +// Solidity: function creditGasFees(address from, address feeRecipient, address , address communityFund, uint256 refund, uint256 tipTxFee, uint256 , uint256 baseTxFee) returns() +func (_FeeCurrency *FeeCurrencySession) CreditGasFees(from common.Address, feeRecipient common.Address, arg2 common.Address, communityFund common.Address, refund *big.Int, tipTxFee *big.Int, arg6 *big.Int, baseTxFee *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.CreditGasFees(&_FeeCurrency.TransactOpts, from, feeRecipient, arg2, communityFund, refund, tipTxFee, arg6, baseTxFee) +} + +// CreditGasFees is a paid mutator transaction binding the contract method 0x6a30b253. +// +// Solidity: function creditGasFees(address from, address feeRecipient, address , address communityFund, uint256 refund, uint256 tipTxFee, uint256 , uint256 baseTxFee) returns() +func (_FeeCurrency *FeeCurrencyTransactorSession) CreditGasFees(from common.Address, feeRecipient common.Address, arg2 common.Address, communityFund common.Address, refund *big.Int, tipTxFee *big.Int, arg6 *big.Int, baseTxFee *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.CreditGasFees(&_FeeCurrency.TransactOpts, from, feeRecipient, arg2, communityFund, refund, tipTxFee, arg6, baseTxFee) +} + +// DebitGasFees is a paid mutator transaction binding the contract method 0x58cf9672. +// +// Solidity: function debitGasFees(address from, uint256 value) returns() +func (_FeeCurrency *FeeCurrencyTransactor) DebitGasFees(opts *bind.TransactOpts, from common.Address, value *big.Int) (*types.Transaction, error) { + return _FeeCurrency.contract.Transact(opts, "debitGasFees", from, value) +} + +// DebitGasFees is a paid mutator transaction binding the contract method 0x58cf9672. +// +// Solidity: function debitGasFees(address from, uint256 value) returns() +func (_FeeCurrency *FeeCurrencySession) DebitGasFees(from common.Address, value *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.DebitGasFees(&_FeeCurrency.TransactOpts, from, value) +} + +// DebitGasFees is a paid mutator transaction binding the contract method 0x58cf9672. +// +// Solidity: function debitGasFees(address from, uint256 value) returns() +func (_FeeCurrency *FeeCurrencyTransactorSession) DebitGasFees(from common.Address, value *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.DebitGasFees(&_FeeCurrency.TransactOpts, from, value) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _FeeCurrency.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_FeeCurrency *FeeCurrencySession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.DecreaseAllowance(&_FeeCurrency.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.DecreaseAllowance(&_FeeCurrency.TransactOpts, spender, subtractedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _FeeCurrency.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_FeeCurrency *FeeCurrencySession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.IncreaseAllowance(&_FeeCurrency.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.IncreaseAllowance(&_FeeCurrency.TransactOpts, spender, addedValue) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.contract.Transact(opts, "transfer", to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencySession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.Transfer(&_FeeCurrency.TransactOpts, to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.Transfer(&_FeeCurrency.TransactOpts, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.contract.Transact(opts, "transferFrom", from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencySession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.TransferFrom(&_FeeCurrency.TransactOpts, from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_FeeCurrency *FeeCurrencyTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _FeeCurrency.Contract.TransferFrom(&_FeeCurrency.TransactOpts, from, to, amount) +} + +// FeeCurrencyApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the FeeCurrency contract. +type FeeCurrencyApprovalIterator struct { + Event *FeeCurrencyApproval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *FeeCurrencyApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *FeeCurrencyApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *FeeCurrencyApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// FeeCurrencyApproval represents a Approval event raised by the FeeCurrency contract. +type FeeCurrencyApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_FeeCurrency *FeeCurrencyFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*FeeCurrencyApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _FeeCurrency.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &FeeCurrencyApprovalIterator{contract: _FeeCurrency.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_FeeCurrency *FeeCurrencyFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *FeeCurrencyApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _FeeCurrency.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(FeeCurrencyApproval) + if err := _FeeCurrency.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_FeeCurrency *FeeCurrencyFilterer) ParseApproval(log types.Log) (*FeeCurrencyApproval, error) { + event := new(FeeCurrencyApproval) + if err := _FeeCurrency.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// FeeCurrencyTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the FeeCurrency contract. +type FeeCurrencyTransferIterator struct { + Event *FeeCurrencyTransfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *FeeCurrencyTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *FeeCurrencyTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *FeeCurrencyTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// FeeCurrencyTransfer represents a Transfer event raised by the FeeCurrency contract. +type FeeCurrencyTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_FeeCurrency *FeeCurrencyFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*FeeCurrencyTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _FeeCurrency.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &FeeCurrencyTransferIterator{contract: _FeeCurrency.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_FeeCurrency *FeeCurrencyFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *FeeCurrencyTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _FeeCurrency.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(FeeCurrencyTransfer) + if err := _FeeCurrency.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_FeeCurrency *FeeCurrencyFilterer) ParseTransfer(log types.Log) (*FeeCurrencyTransfer, error) { + event := new(FeeCurrencyTransfer) + if err := _FeeCurrency.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/celo/abigen/FeeCurrencyWhitelist.go b/contracts/celo/abigen/FeeCurrencyWhitelist.go new file mode 100644 index 0000000000..53c9606ae4 --- /dev/null +++ b/contracts/celo/abigen/FeeCurrencyWhitelist.go @@ -0,0 +1,865 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abigen + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// FeeCurrencyWhitelistMetaData contains all meta data concerning the FeeCurrencyWhitelist contract. +var FeeCurrencyWhitelistMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"test\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"FeeCurrencyWhitelistRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"FeeCurrencyWhitelisted\",\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"addToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVersionNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWhitelist\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"removeToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"whitelist\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// FeeCurrencyWhitelistABI is the input ABI used to generate the binding from. +// Deprecated: Use FeeCurrencyWhitelistMetaData.ABI instead. +var FeeCurrencyWhitelistABI = FeeCurrencyWhitelistMetaData.ABI + +// FeeCurrencyWhitelist is an auto generated Go binding around an Ethereum contract. +type FeeCurrencyWhitelist struct { + FeeCurrencyWhitelistCaller // Read-only binding to the contract + FeeCurrencyWhitelistTransactor // Write-only binding to the contract + FeeCurrencyWhitelistFilterer // Log filterer for contract events +} + +// FeeCurrencyWhitelistCaller is an auto generated read-only Go binding around an Ethereum contract. +type FeeCurrencyWhitelistCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FeeCurrencyWhitelistTransactor is an auto generated write-only Go binding around an Ethereum contract. +type FeeCurrencyWhitelistTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FeeCurrencyWhitelistFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type FeeCurrencyWhitelistFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// FeeCurrencyWhitelistSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type FeeCurrencyWhitelistSession struct { + Contract *FeeCurrencyWhitelist // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// FeeCurrencyWhitelistCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type FeeCurrencyWhitelistCallerSession struct { + Contract *FeeCurrencyWhitelistCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// FeeCurrencyWhitelistTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type FeeCurrencyWhitelistTransactorSession struct { + Contract *FeeCurrencyWhitelistTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// FeeCurrencyWhitelistRaw is an auto generated low-level Go binding around an Ethereum contract. +type FeeCurrencyWhitelistRaw struct { + Contract *FeeCurrencyWhitelist // Generic contract binding to access the raw methods on +} + +// FeeCurrencyWhitelistCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type FeeCurrencyWhitelistCallerRaw struct { + Contract *FeeCurrencyWhitelistCaller // Generic read-only contract binding to access the raw methods on +} + +// FeeCurrencyWhitelistTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type FeeCurrencyWhitelistTransactorRaw struct { + Contract *FeeCurrencyWhitelistTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewFeeCurrencyWhitelist creates a new instance of FeeCurrencyWhitelist, bound to a specific deployed contract. +func NewFeeCurrencyWhitelist(address common.Address, backend bind.ContractBackend) (*FeeCurrencyWhitelist, error) { + contract, err := bindFeeCurrencyWhitelist(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &FeeCurrencyWhitelist{FeeCurrencyWhitelistCaller: FeeCurrencyWhitelistCaller{contract: contract}, FeeCurrencyWhitelistTransactor: FeeCurrencyWhitelistTransactor{contract: contract}, FeeCurrencyWhitelistFilterer: FeeCurrencyWhitelistFilterer{contract: contract}}, nil +} + +// NewFeeCurrencyWhitelistCaller creates a new read-only instance of FeeCurrencyWhitelist, bound to a specific deployed contract. +func NewFeeCurrencyWhitelistCaller(address common.Address, caller bind.ContractCaller) (*FeeCurrencyWhitelistCaller, error) { + contract, err := bindFeeCurrencyWhitelist(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &FeeCurrencyWhitelistCaller{contract: contract}, nil +} + +// NewFeeCurrencyWhitelistTransactor creates a new write-only instance of FeeCurrencyWhitelist, bound to a specific deployed contract. +func NewFeeCurrencyWhitelistTransactor(address common.Address, transactor bind.ContractTransactor) (*FeeCurrencyWhitelistTransactor, error) { + contract, err := bindFeeCurrencyWhitelist(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &FeeCurrencyWhitelistTransactor{contract: contract}, nil +} + +// NewFeeCurrencyWhitelistFilterer creates a new log filterer instance of FeeCurrencyWhitelist, bound to a specific deployed contract. +func NewFeeCurrencyWhitelistFilterer(address common.Address, filterer bind.ContractFilterer) (*FeeCurrencyWhitelistFilterer, error) { + contract, err := bindFeeCurrencyWhitelist(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &FeeCurrencyWhitelistFilterer{contract: contract}, nil +} + +// bindFeeCurrencyWhitelist binds a generic wrapper to an already deployed contract. +func bindFeeCurrencyWhitelist(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := FeeCurrencyWhitelistMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _FeeCurrencyWhitelist.Contract.FeeCurrencyWhitelistCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.FeeCurrencyWhitelistTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.FeeCurrencyWhitelistTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _FeeCurrencyWhitelist.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.contract.Transact(opts, method, params...) +} + +// GetVersionNumber is a free data retrieval call binding the contract method 0x54255be0. +// +// Solidity: function getVersionNumber() pure returns(uint256, uint256, uint256, uint256) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCaller) GetVersionNumber(opts *bind.CallOpts) (*big.Int, *big.Int, *big.Int, *big.Int, error) { + var out []interface{} + err := _FeeCurrencyWhitelist.contract.Call(opts, &out, "getVersionNumber") + + if err != nil { + return *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + out3 := *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + + return out0, out1, out2, out3, err + +} + +// GetVersionNumber is a free data retrieval call binding the contract method 0x54255be0. +// +// Solidity: function getVersionNumber() pure returns(uint256, uint256, uint256, uint256) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) GetVersionNumber() (*big.Int, *big.Int, *big.Int, *big.Int, error) { + return _FeeCurrencyWhitelist.Contract.GetVersionNumber(&_FeeCurrencyWhitelist.CallOpts) +} + +// GetVersionNumber is a free data retrieval call binding the contract method 0x54255be0. +// +// Solidity: function getVersionNumber() pure returns(uint256, uint256, uint256, uint256) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCallerSession) GetVersionNumber() (*big.Int, *big.Int, *big.Int, *big.Int, error) { + return _FeeCurrencyWhitelist.Contract.GetVersionNumber(&_FeeCurrencyWhitelist.CallOpts) +} + +// GetWhitelist is a free data retrieval call binding the contract method 0xd01f63f5. +// +// Solidity: function getWhitelist() view returns(address[]) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCaller) GetWhitelist(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _FeeCurrencyWhitelist.contract.Call(opts, &out, "getWhitelist") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetWhitelist is a free data retrieval call binding the contract method 0xd01f63f5. +// +// Solidity: function getWhitelist() view returns(address[]) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) GetWhitelist() ([]common.Address, error) { + return _FeeCurrencyWhitelist.Contract.GetWhitelist(&_FeeCurrencyWhitelist.CallOpts) +} + +// GetWhitelist is a free data retrieval call binding the contract method 0xd01f63f5. +// +// Solidity: function getWhitelist() view returns(address[]) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCallerSession) GetWhitelist() ([]common.Address, error) { + return _FeeCurrencyWhitelist.Contract.GetWhitelist(&_FeeCurrencyWhitelist.CallOpts) +} + +// Initialized is a free data retrieval call binding the contract method 0x158ef93e. +// +// Solidity: function initialized() view returns(bool) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCaller) Initialized(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _FeeCurrencyWhitelist.contract.Call(opts, &out, "initialized") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Initialized is a free data retrieval call binding the contract method 0x158ef93e. +// +// Solidity: function initialized() view returns(bool) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) Initialized() (bool, error) { + return _FeeCurrencyWhitelist.Contract.Initialized(&_FeeCurrencyWhitelist.CallOpts) +} + +// Initialized is a free data retrieval call binding the contract method 0x158ef93e. +// +// Solidity: function initialized() view returns(bool) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCallerSession) Initialized() (bool, error) { + return _FeeCurrencyWhitelist.Contract.Initialized(&_FeeCurrencyWhitelist.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _FeeCurrencyWhitelist.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) Owner() (common.Address, error) { + return _FeeCurrencyWhitelist.Contract.Owner(&_FeeCurrencyWhitelist.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCallerSession) Owner() (common.Address, error) { + return _FeeCurrencyWhitelist.Contract.Owner(&_FeeCurrencyWhitelist.CallOpts) +} + +// Whitelist is a free data retrieval call binding the contract method 0x7ebd1b30. +// +// Solidity: function whitelist(uint256 ) view returns(address) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCaller) Whitelist(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) { + var out []interface{} + err := _FeeCurrencyWhitelist.contract.Call(opts, &out, "whitelist", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Whitelist is a free data retrieval call binding the contract method 0x7ebd1b30. +// +// Solidity: function whitelist(uint256 ) view returns(address) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) Whitelist(arg0 *big.Int) (common.Address, error) { + return _FeeCurrencyWhitelist.Contract.Whitelist(&_FeeCurrencyWhitelist.CallOpts, arg0) +} + +// Whitelist is a free data retrieval call binding the contract method 0x7ebd1b30. +// +// Solidity: function whitelist(uint256 ) view returns(address) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistCallerSession) Whitelist(arg0 *big.Int) (common.Address, error) { + return _FeeCurrencyWhitelist.Contract.Whitelist(&_FeeCurrencyWhitelist.CallOpts, arg0) +} + +// AddToken is a paid mutator transaction binding the contract method 0xd48bfca7. +// +// Solidity: function addToken(address tokenAddress) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactor) AddToken(opts *bind.TransactOpts, tokenAddress common.Address) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.contract.Transact(opts, "addToken", tokenAddress) +} + +// AddToken is a paid mutator transaction binding the contract method 0xd48bfca7. +// +// Solidity: function addToken(address tokenAddress) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) AddToken(tokenAddress common.Address) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.AddToken(&_FeeCurrencyWhitelist.TransactOpts, tokenAddress) +} + +// AddToken is a paid mutator transaction binding the contract method 0xd48bfca7. +// +// Solidity: function addToken(address tokenAddress) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactorSession) AddToken(tokenAddress common.Address) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.AddToken(&_FeeCurrencyWhitelist.TransactOpts, tokenAddress) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactor) Initialize(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.contract.Transact(opts, "initialize") +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) Initialize() (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.Initialize(&_FeeCurrencyWhitelist.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x8129fc1c. +// +// Solidity: function initialize() returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactorSession) Initialize() (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.Initialize(&_FeeCurrencyWhitelist.TransactOpts) +} + +// RemoveToken is a paid mutator transaction binding the contract method 0x13baf1e6. +// +// Solidity: function removeToken(address tokenAddress, uint256 index) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactor) RemoveToken(opts *bind.TransactOpts, tokenAddress common.Address, index *big.Int) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.contract.Transact(opts, "removeToken", tokenAddress, index) +} + +// RemoveToken is a paid mutator transaction binding the contract method 0x13baf1e6. +// +// Solidity: function removeToken(address tokenAddress, uint256 index) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) RemoveToken(tokenAddress common.Address, index *big.Int) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.RemoveToken(&_FeeCurrencyWhitelist.TransactOpts, tokenAddress, index) +} + +// RemoveToken is a paid mutator transaction binding the contract method 0x13baf1e6. +// +// Solidity: function removeToken(address tokenAddress, uint256 index) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactorSession) RemoveToken(tokenAddress common.Address, index *big.Int) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.RemoveToken(&_FeeCurrencyWhitelist.TransactOpts, tokenAddress, index) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) RenounceOwnership() (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.RenounceOwnership(&_FeeCurrencyWhitelist.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.RenounceOwnership(&_FeeCurrencyWhitelist.TransactOpts) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.TransferOwnership(&_FeeCurrencyWhitelist.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _FeeCurrencyWhitelist.Contract.TransferOwnership(&_FeeCurrencyWhitelist.TransactOpts, newOwner) +} + +// FeeCurrencyWhitelistFeeCurrencyWhitelistRemovedIterator is returned from FilterFeeCurrencyWhitelistRemoved and is used to iterate over the raw logs and unpacked data for FeeCurrencyWhitelistRemoved events raised by the FeeCurrencyWhitelist contract. +type FeeCurrencyWhitelistFeeCurrencyWhitelistRemovedIterator struct { + Event *FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *FeeCurrencyWhitelistFeeCurrencyWhitelistRemovedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *FeeCurrencyWhitelistFeeCurrencyWhitelistRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *FeeCurrencyWhitelistFeeCurrencyWhitelistRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved represents a FeeCurrencyWhitelistRemoved event raised by the FeeCurrencyWhitelist contract. +type FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved struct { + Token common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeCurrencyWhitelistRemoved is a free log retrieval operation binding the contract event 0xc1f06ffbe5c19d22daa982fd4b3886ced05d83e2bfe7de3b67222728f5234e28. +// +// Solidity: event FeeCurrencyWhitelistRemoved(address token) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) FilterFeeCurrencyWhitelistRemoved(opts *bind.FilterOpts) (*FeeCurrencyWhitelistFeeCurrencyWhitelistRemovedIterator, error) { + + logs, sub, err := _FeeCurrencyWhitelist.contract.FilterLogs(opts, "FeeCurrencyWhitelistRemoved") + if err != nil { + return nil, err + } + return &FeeCurrencyWhitelistFeeCurrencyWhitelistRemovedIterator{contract: _FeeCurrencyWhitelist.contract, event: "FeeCurrencyWhitelistRemoved", logs: logs, sub: sub}, nil +} + +// WatchFeeCurrencyWhitelistRemoved is a free log subscription operation binding the contract event 0xc1f06ffbe5c19d22daa982fd4b3886ced05d83e2bfe7de3b67222728f5234e28. +// +// Solidity: event FeeCurrencyWhitelistRemoved(address token) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) WatchFeeCurrencyWhitelistRemoved(opts *bind.WatchOpts, sink chan<- *FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved) (event.Subscription, error) { + + logs, sub, err := _FeeCurrencyWhitelist.contract.WatchLogs(opts, "FeeCurrencyWhitelistRemoved") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved) + if err := _FeeCurrencyWhitelist.contract.UnpackLog(event, "FeeCurrencyWhitelistRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFeeCurrencyWhitelistRemoved is a log parse operation binding the contract event 0xc1f06ffbe5c19d22daa982fd4b3886ced05d83e2bfe7de3b67222728f5234e28. +// +// Solidity: event FeeCurrencyWhitelistRemoved(address token) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) ParseFeeCurrencyWhitelistRemoved(log types.Log) (*FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved, error) { + event := new(FeeCurrencyWhitelistFeeCurrencyWhitelistRemoved) + if err := _FeeCurrencyWhitelist.contract.UnpackLog(event, "FeeCurrencyWhitelistRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// FeeCurrencyWhitelistFeeCurrencyWhitelistedIterator is returned from FilterFeeCurrencyWhitelisted and is used to iterate over the raw logs and unpacked data for FeeCurrencyWhitelisted events raised by the FeeCurrencyWhitelist contract. +type FeeCurrencyWhitelistFeeCurrencyWhitelistedIterator struct { + Event *FeeCurrencyWhitelistFeeCurrencyWhitelisted // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *FeeCurrencyWhitelistFeeCurrencyWhitelistedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyWhitelistFeeCurrencyWhitelisted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyWhitelistFeeCurrencyWhitelisted) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *FeeCurrencyWhitelistFeeCurrencyWhitelistedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *FeeCurrencyWhitelistFeeCurrencyWhitelistedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// FeeCurrencyWhitelistFeeCurrencyWhitelisted represents a FeeCurrencyWhitelisted event raised by the FeeCurrencyWhitelist contract. +type FeeCurrencyWhitelistFeeCurrencyWhitelisted struct { + Token common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFeeCurrencyWhitelisted is a free log retrieval operation binding the contract event 0xcf4fe1d1989a39011040b0c33ba1165fdeeca971a1ab2b0340b23550f93727e0. +// +// Solidity: event FeeCurrencyWhitelisted(address token) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) FilterFeeCurrencyWhitelisted(opts *bind.FilterOpts) (*FeeCurrencyWhitelistFeeCurrencyWhitelistedIterator, error) { + + logs, sub, err := _FeeCurrencyWhitelist.contract.FilterLogs(opts, "FeeCurrencyWhitelisted") + if err != nil { + return nil, err + } + return &FeeCurrencyWhitelistFeeCurrencyWhitelistedIterator{contract: _FeeCurrencyWhitelist.contract, event: "FeeCurrencyWhitelisted", logs: logs, sub: sub}, nil +} + +// WatchFeeCurrencyWhitelisted is a free log subscription operation binding the contract event 0xcf4fe1d1989a39011040b0c33ba1165fdeeca971a1ab2b0340b23550f93727e0. +// +// Solidity: event FeeCurrencyWhitelisted(address token) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) WatchFeeCurrencyWhitelisted(opts *bind.WatchOpts, sink chan<- *FeeCurrencyWhitelistFeeCurrencyWhitelisted) (event.Subscription, error) { + + logs, sub, err := _FeeCurrencyWhitelist.contract.WatchLogs(opts, "FeeCurrencyWhitelisted") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(FeeCurrencyWhitelistFeeCurrencyWhitelisted) + if err := _FeeCurrencyWhitelist.contract.UnpackLog(event, "FeeCurrencyWhitelisted", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseFeeCurrencyWhitelisted is a log parse operation binding the contract event 0xcf4fe1d1989a39011040b0c33ba1165fdeeca971a1ab2b0340b23550f93727e0. +// +// Solidity: event FeeCurrencyWhitelisted(address token) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) ParseFeeCurrencyWhitelisted(log types.Log) (*FeeCurrencyWhitelistFeeCurrencyWhitelisted, error) { + event := new(FeeCurrencyWhitelistFeeCurrencyWhitelisted) + if err := _FeeCurrencyWhitelist.contract.UnpackLog(event, "FeeCurrencyWhitelisted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// FeeCurrencyWhitelistOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the FeeCurrencyWhitelist contract. +type FeeCurrencyWhitelistOwnershipTransferredIterator struct { + Event *FeeCurrencyWhitelistOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *FeeCurrencyWhitelistOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyWhitelistOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(FeeCurrencyWhitelistOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *FeeCurrencyWhitelistOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *FeeCurrencyWhitelistOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// FeeCurrencyWhitelistOwnershipTransferred represents a OwnershipTransferred event raised by the FeeCurrencyWhitelist contract. +type FeeCurrencyWhitelistOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*FeeCurrencyWhitelistOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _FeeCurrencyWhitelist.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &FeeCurrencyWhitelistOwnershipTransferredIterator{contract: _FeeCurrencyWhitelist.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *FeeCurrencyWhitelistOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _FeeCurrencyWhitelist.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(FeeCurrencyWhitelistOwnershipTransferred) + if err := _FeeCurrencyWhitelist.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_FeeCurrencyWhitelist *FeeCurrencyWhitelistFilterer) ParseOwnershipTransferred(log types.Log) (*FeeCurrencyWhitelistOwnershipTransferred, error) { + event := new(FeeCurrencyWhitelistOwnershipTransferred) + if err := _FeeCurrencyWhitelist.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/celo/abigen/GoldToken.go b/contracts/celo/abigen/GoldToken.go index 43d7fb251c..d9ddcb8321 100644 --- a/contracts/celo/abigen/GoldToken.go +++ b/contracts/celo/abigen/GoldToken.go @@ -31,7 +31,7 @@ var ( // GoldTokenMetaData contains all meta data concerning the GoldToken contract. var GoldTokenMetaData = &bind.MetaData{ - ABI: "[{\"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\":\"contractIRegistry\",\"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\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"burn\",\"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\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"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\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"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\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"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\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"circulatingSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"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\":[],\"name\":\"getBurnedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"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\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"test\",\"type\":\"bool\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"circulatingSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBurnedAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVersionNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"increaseSupply\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"registryAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"registry\",\"outputs\":[{\"internalType\":\"contractICeloRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"registryAddress\",\"type\":\"address\"}],\"name\":\"setRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"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\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // GoldTokenABI is the input ABI used to generate the binding from. @@ -275,7 +275,7 @@ func (_GoldToken *GoldTokenCallerSession) CirculatingSupply() (*big.Int, error) // Decimals is a free data retrieval call binding the contract method 0x313ce567. // -// Solidity: function decimals() view returns(uint8) +// Solidity: function decimals() pure returns(uint8) func (_GoldToken *GoldTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { var out []interface{} err := _GoldToken.contract.Call(opts, &out, "decimals") @@ -292,14 +292,14 @@ func (_GoldToken *GoldTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) // Decimals is a free data retrieval call binding the contract method 0x313ce567. // -// Solidity: function decimals() view returns(uint8) +// Solidity: function decimals() pure returns(uint8) func (_GoldToken *GoldTokenSession) Decimals() (uint8, error) { return _GoldToken.Contract.Decimals(&_GoldToken.CallOpts) } // Decimals is a free data retrieval call binding the contract method 0x313ce567. // -// Solidity: function decimals() view returns(uint8) +// Solidity: function decimals() pure returns(uint8) func (_GoldToken *GoldTokenCallerSession) Decimals() (uint8, error) { return _GoldToken.Contract.Decimals(&_GoldToken.CallOpts) } @@ -400,40 +400,9 @@ func (_GoldToken *GoldTokenCallerSession) Initialized() (bool, error) { return _GoldToken.Contract.Initialized(&_GoldToken.CallOpts) } -// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. -// -// Solidity: function isOwner() view returns(bool) -func (_GoldToken *GoldTokenCaller) IsOwner(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _GoldToken.contract.Call(opts, &out, "isOwner") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. -// -// Solidity: function isOwner() view returns(bool) -func (_GoldToken *GoldTokenSession) IsOwner() (bool, error) { - return _GoldToken.Contract.IsOwner(&_GoldToken.CallOpts) -} - -// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. -// -// Solidity: function isOwner() view returns(bool) -func (_GoldToken *GoldTokenCallerSession) IsOwner() (bool, error) { - return _GoldToken.Contract.IsOwner(&_GoldToken.CallOpts) -} - // Name is a free data retrieval call binding the contract method 0x06fdde03. // -// Solidity: function name() view returns(string) +// Solidity: function name() pure returns(string) func (_GoldToken *GoldTokenCaller) Name(opts *bind.CallOpts) (string, error) { var out []interface{} err := _GoldToken.contract.Call(opts, &out, "name") @@ -450,14 +419,14 @@ func (_GoldToken *GoldTokenCaller) Name(opts *bind.CallOpts) (string, error) { // Name is a free data retrieval call binding the contract method 0x06fdde03. // -// Solidity: function name() view returns(string) +// Solidity: function name() pure returns(string) func (_GoldToken *GoldTokenSession) Name() (string, error) { return _GoldToken.Contract.Name(&_GoldToken.CallOpts) } // Name is a free data retrieval call binding the contract method 0x06fdde03. // -// Solidity: function name() view returns(string) +// Solidity: function name() pure returns(string) func (_GoldToken *GoldTokenCallerSession) Name() (string, error) { return _GoldToken.Contract.Name(&_GoldToken.CallOpts) } @@ -526,7 +495,7 @@ func (_GoldToken *GoldTokenCallerSession) Registry() (common.Address, error) { // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // -// Solidity: function symbol() view returns(string) +// Solidity: function symbol() pure returns(string) func (_GoldToken *GoldTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { var out []interface{} err := _GoldToken.contract.Call(opts, &out, "symbol") @@ -543,14 +512,14 @@ func (_GoldToken *GoldTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // -// Solidity: function symbol() view returns(string) +// Solidity: function symbol() pure returns(string) func (_GoldToken *GoldTokenSession) Symbol() (string, error) { return _GoldToken.Contract.Symbol(&_GoldToken.CallOpts) } // Symbol is a free data retrieval call binding the contract method 0x95d89b41. // -// Solidity: function symbol() view returns(string) +// Solidity: function symbol() pure returns(string) func (_GoldToken *GoldTokenCallerSession) Symbol() (string, error) { return _GoldToken.Contract.Symbol(&_GoldToken.CallOpts) } diff --git a/contracts/celo/abigen/Registry.go b/contracts/celo/abigen/Registry.go index 57eb7d2617..374a7428a1 100644 --- a/contracts/celo/abigen/Registry.go +++ b/contracts/celo/abigen/Registry.go @@ -31,7 +31,7 @@ var ( // RegistryMetaData contains all meta data concerning the Registry contract. var RegistryMetaData = &bind.MetaData{ - ABI: "[{\"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\":false,\"internalType\":\"string\",\"name\":\"identifier\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"identifierHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"RegistryUpdated\",\"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\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"registry\",\"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\":\"string\",\"name\":\"identifier\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAddressFor\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"identifierHash\",\"type\":\"bytes32\"}],\"name\":\"getAddressForOrDie\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"identifierHash\",\"type\":\"bytes32\"}],\"name\":\"getAddressFor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"string\",\"name\":\"identifier\",\"type\":\"string\"}],\"name\":\"getAddressForStringOrDie\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"string\",\"name\":\"identifier\",\"type\":\"string\"}],\"name\":\"getAddressForString\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"identifierHashes\",\"type\":\"bytes32[]\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"isOneOf\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"test\",\"type\":\"bool\"}],\"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\":false,\"internalType\":\"string\",\"name\":\"identifier\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"identifierHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"RegistryUpdated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"identifierHash\",\"type\":\"bytes32\"}],\"name\":\"getAddressFor\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"identifierHash\",\"type\":\"bytes32\"}],\"name\":\"getAddressForOrDie\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"identifier\",\"type\":\"string\"}],\"name\":\"getAddressForString\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"identifier\",\"type\":\"string\"}],\"name\":\"getAddressForStringOrDie\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"identifierHashes\",\"type\":\"bytes32[]\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"isOneOf\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"registry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"identifier\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"setAddressFor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // RegistryABI is the input ABI used to generate the binding from. @@ -366,37 +366,6 @@ func (_Registry *RegistryCallerSession) IsOneOf(identifierHashes [][32]byte, sen return _Registry.Contract.IsOneOf(&_Registry.CallOpts, identifierHashes, sender) } -// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. -// -// Solidity: function isOwner() view returns(bool) -func (_Registry *RegistryCaller) IsOwner(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Registry.contract.Call(opts, &out, "isOwner") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. -// -// Solidity: function isOwner() view returns(bool) -func (_Registry *RegistrySession) IsOwner() (bool, error) { - return _Registry.Contract.IsOwner(&_Registry.CallOpts) -} - -// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. -// -// Solidity: function isOwner() view returns(bool) -func (_Registry *RegistryCallerSession) IsOwner() (bool, error) { - return _Registry.Contract.IsOwner(&_Registry.CallOpts) -} - // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) diff --git a/contracts/celo/abigen/SortedOracles.go b/contracts/celo/abigen/SortedOracles.go new file mode 100644 index 0000000000..1476190497 --- /dev/null +++ b/contracts/celo/abigen/SortedOracles.go @@ -0,0 +1,2056 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abigen + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// SortedOraclesMetaData contains all meta data concerning the SortedOracles contract. +var SortedOraclesMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"test\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"MedianUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracleAddress\",\"type\":\"address\"}],\"name\":\"OracleAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracleAddress\",\"type\":\"address\"}],\"name\":\"OracleRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"}],\"name\":\"OracleReportRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"oracle\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"timestamp\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"OracleReported\",\"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\":false,\"internalType\":\"uint256\",\"name\":\"reportExpiry\",\"type\":\"uint256\"}],\"name\":\"ReportExpirySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reportExpiry\",\"type\":\"uint256\"}],\"name\":\"TokenReportExpirySet\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oracleAddress\",\"type\":\"address\"}],\"name\":\"addOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getOracles\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getRates\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"enumSortedLinkedListWithMedian.MedianRelation[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTimestamps\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"enumSortedLinkedListWithMedian.MedianRelation[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"getTokenReportExpirySeconds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVersionNumber\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_reportExpirySeconds\",\"type\":\"uint256\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"isOldestReportExpired\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isOracle\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"medianRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"medianTimestamp\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"numRates\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"numTimestamps\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"oracles\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"n\",\"type\":\"uint256\"}],\"name\":\"removeExpiredReports\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"oracleAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"removeOracle\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"lesserKey\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"greaterKey\",\"type\":\"address\"}],\"name\":\"report\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"reportExpirySeconds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_reportExpirySeconds\",\"type\":\"uint256\"}],\"name\":\"setReportExpiry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_reportExpirySeconds\",\"type\":\"uint256\"}],\"name\":\"setTokenReportExpiry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"tokenReportExpirySeconds\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// SortedOraclesABI is the input ABI used to generate the binding from. +// Deprecated: Use SortedOraclesMetaData.ABI instead. +var SortedOraclesABI = SortedOraclesMetaData.ABI + +// SortedOracles is an auto generated Go binding around an Ethereum contract. +type SortedOracles struct { + SortedOraclesCaller // Read-only binding to the contract + SortedOraclesTransactor // Write-only binding to the contract + SortedOraclesFilterer // Log filterer for contract events +} + +// SortedOraclesCaller is an auto generated read-only Go binding around an Ethereum contract. +type SortedOraclesCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SortedOraclesTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SortedOraclesTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SortedOraclesFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SortedOraclesFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SortedOraclesSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SortedOraclesSession struct { + Contract *SortedOracles // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SortedOraclesCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SortedOraclesCallerSession struct { + Contract *SortedOraclesCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SortedOraclesTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SortedOraclesTransactorSession struct { + Contract *SortedOraclesTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SortedOraclesRaw is an auto generated low-level Go binding around an Ethereum contract. +type SortedOraclesRaw struct { + Contract *SortedOracles // Generic contract binding to access the raw methods on +} + +// SortedOraclesCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SortedOraclesCallerRaw struct { + Contract *SortedOraclesCaller // Generic read-only contract binding to access the raw methods on +} + +// SortedOraclesTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SortedOraclesTransactorRaw struct { + Contract *SortedOraclesTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSortedOracles creates a new instance of SortedOracles, bound to a specific deployed contract. +func NewSortedOracles(address common.Address, backend bind.ContractBackend) (*SortedOracles, error) { + contract, err := bindSortedOracles(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SortedOracles{SortedOraclesCaller: SortedOraclesCaller{contract: contract}, SortedOraclesTransactor: SortedOraclesTransactor{contract: contract}, SortedOraclesFilterer: SortedOraclesFilterer{contract: contract}}, nil +} + +// NewSortedOraclesCaller creates a new read-only instance of SortedOracles, bound to a specific deployed contract. +func NewSortedOraclesCaller(address common.Address, caller bind.ContractCaller) (*SortedOraclesCaller, error) { + contract, err := bindSortedOracles(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SortedOraclesCaller{contract: contract}, nil +} + +// NewSortedOraclesTransactor creates a new write-only instance of SortedOracles, bound to a specific deployed contract. +func NewSortedOraclesTransactor(address common.Address, transactor bind.ContractTransactor) (*SortedOraclesTransactor, error) { + contract, err := bindSortedOracles(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SortedOraclesTransactor{contract: contract}, nil +} + +// NewSortedOraclesFilterer creates a new log filterer instance of SortedOracles, bound to a specific deployed contract. +func NewSortedOraclesFilterer(address common.Address, filterer bind.ContractFilterer) (*SortedOraclesFilterer, error) { + contract, err := bindSortedOracles(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SortedOraclesFilterer{contract: contract}, nil +} + +// bindSortedOracles binds a generic wrapper to an already deployed contract. +func bindSortedOracles(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := SortedOraclesMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SortedOracles *SortedOraclesRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SortedOracles.Contract.SortedOraclesCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SortedOracles *SortedOraclesRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SortedOracles.Contract.SortedOraclesTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SortedOracles *SortedOraclesRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SortedOracles.Contract.SortedOraclesTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_SortedOracles *SortedOraclesCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SortedOracles.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_SortedOracles *SortedOraclesTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SortedOracles.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SortedOracles *SortedOraclesTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SortedOracles.Contract.contract.Transact(opts, method, params...) +} + +// GetOracles is a free data retrieval call binding the contract method 0x8e749281. +// +// Solidity: function getOracles(address token) view returns(address[]) +func (_SortedOracles *SortedOraclesCaller) GetOracles(opts *bind.CallOpts, token common.Address) ([]common.Address, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "getOracles", token) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetOracles is a free data retrieval call binding the contract method 0x8e749281. +// +// Solidity: function getOracles(address token) view returns(address[]) +func (_SortedOracles *SortedOraclesSession) GetOracles(token common.Address) ([]common.Address, error) { + return _SortedOracles.Contract.GetOracles(&_SortedOracles.CallOpts, token) +} + +// GetOracles is a free data retrieval call binding the contract method 0x8e749281. +// +// Solidity: function getOracles(address token) view returns(address[]) +func (_SortedOracles *SortedOraclesCallerSession) GetOracles(token common.Address) ([]common.Address, error) { + return _SortedOracles.Contract.GetOracles(&_SortedOracles.CallOpts, token) +} + +// GetRates is a free data retrieval call binding the contract method 0x02f55b61. +// +// Solidity: function getRates(address token) view returns(address[], uint256[], uint8[]) +func (_SortedOracles *SortedOraclesCaller) GetRates(opts *bind.CallOpts, token common.Address) ([]common.Address, []*big.Int, []uint8, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "getRates", token) + + if err != nil { + return *new([]common.Address), *new([]*big.Int), *new([]uint8), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + out1 := *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int) + out2 := *abi.ConvertType(out[2], new([]uint8)).(*[]uint8) + + return out0, out1, out2, err + +} + +// GetRates is a free data retrieval call binding the contract method 0x02f55b61. +// +// Solidity: function getRates(address token) view returns(address[], uint256[], uint8[]) +func (_SortedOracles *SortedOraclesSession) GetRates(token common.Address) ([]common.Address, []*big.Int, []uint8, error) { + return _SortedOracles.Contract.GetRates(&_SortedOracles.CallOpts, token) +} + +// GetRates is a free data retrieval call binding the contract method 0x02f55b61. +// +// Solidity: function getRates(address token) view returns(address[], uint256[], uint8[]) +func (_SortedOracles *SortedOraclesCallerSession) GetRates(token common.Address) ([]common.Address, []*big.Int, []uint8, error) { + return _SortedOracles.Contract.GetRates(&_SortedOracles.CallOpts, token) +} + +// GetTimestamps is a free data retrieval call binding the contract method 0xb9292158. +// +// Solidity: function getTimestamps(address token) view returns(address[], uint256[], uint8[]) +func (_SortedOracles *SortedOraclesCaller) GetTimestamps(opts *bind.CallOpts, token common.Address) ([]common.Address, []*big.Int, []uint8, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "getTimestamps", token) + + if err != nil { + return *new([]common.Address), *new([]*big.Int), *new([]uint8), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + out1 := *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int) + out2 := *abi.ConvertType(out[2], new([]uint8)).(*[]uint8) + + return out0, out1, out2, err + +} + +// GetTimestamps is a free data retrieval call binding the contract method 0xb9292158. +// +// Solidity: function getTimestamps(address token) view returns(address[], uint256[], uint8[]) +func (_SortedOracles *SortedOraclesSession) GetTimestamps(token common.Address) ([]common.Address, []*big.Int, []uint8, error) { + return _SortedOracles.Contract.GetTimestamps(&_SortedOracles.CallOpts, token) +} + +// GetTimestamps is a free data retrieval call binding the contract method 0xb9292158. +// +// Solidity: function getTimestamps(address token) view returns(address[], uint256[], uint8[]) +func (_SortedOracles *SortedOraclesCallerSession) GetTimestamps(token common.Address) ([]common.Address, []*big.Int, []uint8, error) { + return _SortedOracles.Contract.GetTimestamps(&_SortedOracles.CallOpts, token) +} + +// GetTokenReportExpirySeconds is a free data retrieval call binding the contract method 0x6deb6799. +// +// Solidity: function getTokenReportExpirySeconds(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesCaller) GetTokenReportExpirySeconds(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "getTokenReportExpirySeconds", token) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetTokenReportExpirySeconds is a free data retrieval call binding the contract method 0x6deb6799. +// +// Solidity: function getTokenReportExpirySeconds(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesSession) GetTokenReportExpirySeconds(token common.Address) (*big.Int, error) { + return _SortedOracles.Contract.GetTokenReportExpirySeconds(&_SortedOracles.CallOpts, token) +} + +// GetTokenReportExpirySeconds is a free data retrieval call binding the contract method 0x6deb6799. +// +// Solidity: function getTokenReportExpirySeconds(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesCallerSession) GetTokenReportExpirySeconds(token common.Address) (*big.Int, error) { + return _SortedOracles.Contract.GetTokenReportExpirySeconds(&_SortedOracles.CallOpts, token) +} + +// GetVersionNumber is a free data retrieval call binding the contract method 0x54255be0. +// +// Solidity: function getVersionNumber() pure returns(uint256, uint256, uint256, uint256) +func (_SortedOracles *SortedOraclesCaller) GetVersionNumber(opts *bind.CallOpts) (*big.Int, *big.Int, *big.Int, *big.Int, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "getVersionNumber") + + if err != nil { + return *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + out3 := *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + + return out0, out1, out2, out3, err + +} + +// GetVersionNumber is a free data retrieval call binding the contract method 0x54255be0. +// +// Solidity: function getVersionNumber() pure returns(uint256, uint256, uint256, uint256) +func (_SortedOracles *SortedOraclesSession) GetVersionNumber() (*big.Int, *big.Int, *big.Int, *big.Int, error) { + return _SortedOracles.Contract.GetVersionNumber(&_SortedOracles.CallOpts) +} + +// GetVersionNumber is a free data retrieval call binding the contract method 0x54255be0. +// +// Solidity: function getVersionNumber() pure returns(uint256, uint256, uint256, uint256) +func (_SortedOracles *SortedOraclesCallerSession) GetVersionNumber() (*big.Int, *big.Int, *big.Int, *big.Int, error) { + return _SortedOracles.Contract.GetVersionNumber(&_SortedOracles.CallOpts) +} + +// Initialized is a free data retrieval call binding the contract method 0x158ef93e. +// +// Solidity: function initialized() view returns(bool) +func (_SortedOracles *SortedOraclesCaller) Initialized(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "initialized") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Initialized is a free data retrieval call binding the contract method 0x158ef93e. +// +// Solidity: function initialized() view returns(bool) +func (_SortedOracles *SortedOraclesSession) Initialized() (bool, error) { + return _SortedOracles.Contract.Initialized(&_SortedOracles.CallOpts) +} + +// Initialized is a free data retrieval call binding the contract method 0x158ef93e. +// +// Solidity: function initialized() view returns(bool) +func (_SortedOracles *SortedOraclesCallerSession) Initialized() (bool, error) { + return _SortedOracles.Contract.Initialized(&_SortedOracles.CallOpts) +} + +// IsOldestReportExpired is a free data retrieval call binding the contract method 0xffe736bf. +// +// Solidity: function isOldestReportExpired(address token) view returns(bool, address) +func (_SortedOracles *SortedOraclesCaller) IsOldestReportExpired(opts *bind.CallOpts, token common.Address) (bool, common.Address, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "isOldestReportExpired", token) + + if err != nil { + return *new(bool), *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + out1 := *abi.ConvertType(out[1], new(common.Address)).(*common.Address) + + return out0, out1, err + +} + +// IsOldestReportExpired is a free data retrieval call binding the contract method 0xffe736bf. +// +// Solidity: function isOldestReportExpired(address token) view returns(bool, address) +func (_SortedOracles *SortedOraclesSession) IsOldestReportExpired(token common.Address) (bool, common.Address, error) { + return _SortedOracles.Contract.IsOldestReportExpired(&_SortedOracles.CallOpts, token) +} + +// IsOldestReportExpired is a free data retrieval call binding the contract method 0xffe736bf. +// +// Solidity: function isOldestReportExpired(address token) view returns(bool, address) +func (_SortedOracles *SortedOraclesCallerSession) IsOldestReportExpired(token common.Address) (bool, common.Address, error) { + return _SortedOracles.Contract.IsOldestReportExpired(&_SortedOracles.CallOpts, token) +} + +// IsOracle is a free data retrieval call binding the contract method 0x370c998e. +// +// Solidity: function isOracle(address , address ) view returns(bool) +func (_SortedOracles *SortedOraclesCaller) IsOracle(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (bool, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "isOracle", arg0, arg1) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsOracle is a free data retrieval call binding the contract method 0x370c998e. +// +// Solidity: function isOracle(address , address ) view returns(bool) +func (_SortedOracles *SortedOraclesSession) IsOracle(arg0 common.Address, arg1 common.Address) (bool, error) { + return _SortedOracles.Contract.IsOracle(&_SortedOracles.CallOpts, arg0, arg1) +} + +// IsOracle is a free data retrieval call binding the contract method 0x370c998e. +// +// Solidity: function isOracle(address , address ) view returns(bool) +func (_SortedOracles *SortedOraclesCallerSession) IsOracle(arg0 common.Address, arg1 common.Address) (bool, error) { + return _SortedOracles.Contract.IsOracle(&_SortedOracles.CallOpts, arg0, arg1) +} + +// MedianRate is a free data retrieval call binding the contract method 0xef90e1b0. +// +// Solidity: function medianRate(address token) view returns(uint256, uint256) +func (_SortedOracles *SortedOraclesCaller) MedianRate(opts *bind.CallOpts, token common.Address) (*big.Int, *big.Int, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "medianRate", token) + + if err != nil { + return *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return out0, out1, err + +} + +// MedianRate is a free data retrieval call binding the contract method 0xef90e1b0. +// +// Solidity: function medianRate(address token) view returns(uint256, uint256) +func (_SortedOracles *SortedOraclesSession) MedianRate(token common.Address) (*big.Int, *big.Int, error) { + return _SortedOracles.Contract.MedianRate(&_SortedOracles.CallOpts, token) +} + +// MedianRate is a free data retrieval call binding the contract method 0xef90e1b0. +// +// Solidity: function medianRate(address token) view returns(uint256, uint256) +func (_SortedOracles *SortedOraclesCallerSession) MedianRate(token common.Address) (*big.Int, *big.Int, error) { + return _SortedOracles.Contract.MedianRate(&_SortedOracles.CallOpts, token) +} + +// MedianTimestamp is a free data retrieval call binding the contract method 0x071b48fc. +// +// Solidity: function medianTimestamp(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesCaller) MedianTimestamp(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "medianTimestamp", token) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MedianTimestamp is a free data retrieval call binding the contract method 0x071b48fc. +// +// Solidity: function medianTimestamp(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesSession) MedianTimestamp(token common.Address) (*big.Int, error) { + return _SortedOracles.Contract.MedianTimestamp(&_SortedOracles.CallOpts, token) +} + +// MedianTimestamp is a free data retrieval call binding the contract method 0x071b48fc. +// +// Solidity: function medianTimestamp(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesCallerSession) MedianTimestamp(token common.Address) (*big.Int, error) { + return _SortedOracles.Contract.MedianTimestamp(&_SortedOracles.CallOpts, token) +} + +// NumRates is a free data retrieval call binding the contract method 0xbbc66a94. +// +// Solidity: function numRates(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesCaller) NumRates(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "numRates", token) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NumRates is a free data retrieval call binding the contract method 0xbbc66a94. +// +// Solidity: function numRates(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesSession) NumRates(token common.Address) (*big.Int, error) { + return _SortedOracles.Contract.NumRates(&_SortedOracles.CallOpts, token) +} + +// NumRates is a free data retrieval call binding the contract method 0xbbc66a94. +// +// Solidity: function numRates(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesCallerSession) NumRates(token common.Address) (*big.Int, error) { + return _SortedOracles.Contract.NumRates(&_SortedOracles.CallOpts, token) +} + +// NumTimestamps is a free data retrieval call binding the contract method 0x6dd6ef0c. +// +// Solidity: function numTimestamps(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesCaller) NumTimestamps(opts *bind.CallOpts, token common.Address) (*big.Int, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "numTimestamps", token) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NumTimestamps is a free data retrieval call binding the contract method 0x6dd6ef0c. +// +// Solidity: function numTimestamps(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesSession) NumTimestamps(token common.Address) (*big.Int, error) { + return _SortedOracles.Contract.NumTimestamps(&_SortedOracles.CallOpts, token) +} + +// NumTimestamps is a free data retrieval call binding the contract method 0x6dd6ef0c. +// +// Solidity: function numTimestamps(address token) view returns(uint256) +func (_SortedOracles *SortedOraclesCallerSession) NumTimestamps(token common.Address) (*big.Int, error) { + return _SortedOracles.Contract.NumTimestamps(&_SortedOracles.CallOpts, token) +} + +// Oracles is a free data retrieval call binding the contract method 0xa00a8b2c. +// +// Solidity: function oracles(address , uint256 ) view returns(address) +func (_SortedOracles *SortedOraclesCaller) Oracles(opts *bind.CallOpts, arg0 common.Address, arg1 *big.Int) (common.Address, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "oracles", arg0, arg1) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Oracles is a free data retrieval call binding the contract method 0xa00a8b2c. +// +// Solidity: function oracles(address , uint256 ) view returns(address) +func (_SortedOracles *SortedOraclesSession) Oracles(arg0 common.Address, arg1 *big.Int) (common.Address, error) { + return _SortedOracles.Contract.Oracles(&_SortedOracles.CallOpts, arg0, arg1) +} + +// Oracles is a free data retrieval call binding the contract method 0xa00a8b2c. +// +// Solidity: function oracles(address , uint256 ) view returns(address) +func (_SortedOracles *SortedOraclesCallerSession) Oracles(arg0 common.Address, arg1 *big.Int) (common.Address, error) { + return _SortedOracles.Contract.Oracles(&_SortedOracles.CallOpts, arg0, arg1) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SortedOracles *SortedOraclesCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SortedOracles *SortedOraclesSession) Owner() (common.Address, error) { + return _SortedOracles.Contract.Owner(&_SortedOracles.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_SortedOracles *SortedOraclesCallerSession) Owner() (common.Address, error) { + return _SortedOracles.Contract.Owner(&_SortedOracles.CallOpts) +} + +// ReportExpirySeconds is a free data retrieval call binding the contract method 0x493a353c. +// +// Solidity: function reportExpirySeconds() view returns(uint256) +func (_SortedOracles *SortedOraclesCaller) ReportExpirySeconds(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "reportExpirySeconds") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ReportExpirySeconds is a free data retrieval call binding the contract method 0x493a353c. +// +// Solidity: function reportExpirySeconds() view returns(uint256) +func (_SortedOracles *SortedOraclesSession) ReportExpirySeconds() (*big.Int, error) { + return _SortedOracles.Contract.ReportExpirySeconds(&_SortedOracles.CallOpts) +} + +// ReportExpirySeconds is a free data retrieval call binding the contract method 0x493a353c. +// +// Solidity: function reportExpirySeconds() view returns(uint256) +func (_SortedOracles *SortedOraclesCallerSession) ReportExpirySeconds() (*big.Int, error) { + return _SortedOracles.Contract.ReportExpirySeconds(&_SortedOracles.CallOpts) +} + +// TokenReportExpirySeconds is a free data retrieval call binding the contract method 0x2e86bc01. +// +// Solidity: function tokenReportExpirySeconds(address ) view returns(uint256) +func (_SortedOracles *SortedOraclesCaller) TokenReportExpirySeconds(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _SortedOracles.contract.Call(opts, &out, "tokenReportExpirySeconds", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TokenReportExpirySeconds is a free data retrieval call binding the contract method 0x2e86bc01. +// +// Solidity: function tokenReportExpirySeconds(address ) view returns(uint256) +func (_SortedOracles *SortedOraclesSession) TokenReportExpirySeconds(arg0 common.Address) (*big.Int, error) { + return _SortedOracles.Contract.TokenReportExpirySeconds(&_SortedOracles.CallOpts, arg0) +} + +// TokenReportExpirySeconds is a free data retrieval call binding the contract method 0x2e86bc01. +// +// Solidity: function tokenReportExpirySeconds(address ) view returns(uint256) +func (_SortedOracles *SortedOraclesCallerSession) TokenReportExpirySeconds(arg0 common.Address) (*big.Int, error) { + return _SortedOracles.Contract.TokenReportExpirySeconds(&_SortedOracles.CallOpts, arg0) +} + +// AddOracle is a paid mutator transaction binding the contract method 0xf0ca4adb. +// +// Solidity: function addOracle(address token, address oracleAddress) returns() +func (_SortedOracles *SortedOraclesTransactor) AddOracle(opts *bind.TransactOpts, token common.Address, oracleAddress common.Address) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "addOracle", token, oracleAddress) +} + +// AddOracle is a paid mutator transaction binding the contract method 0xf0ca4adb. +// +// Solidity: function addOracle(address token, address oracleAddress) returns() +func (_SortedOracles *SortedOraclesSession) AddOracle(token common.Address, oracleAddress common.Address) (*types.Transaction, error) { + return _SortedOracles.Contract.AddOracle(&_SortedOracles.TransactOpts, token, oracleAddress) +} + +// AddOracle is a paid mutator transaction binding the contract method 0xf0ca4adb. +// +// Solidity: function addOracle(address token, address oracleAddress) returns() +func (_SortedOracles *SortedOraclesTransactorSession) AddOracle(token common.Address, oracleAddress common.Address) (*types.Transaction, error) { + return _SortedOracles.Contract.AddOracle(&_SortedOracles.TransactOpts, token, oracleAddress) +} + +// Initialize is a paid mutator transaction binding the contract method 0xfe4b84df. +// +// Solidity: function initialize(uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesTransactor) Initialize(opts *bind.TransactOpts, _reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "initialize", _reportExpirySeconds) +} + +// Initialize is a paid mutator transaction binding the contract method 0xfe4b84df. +// +// Solidity: function initialize(uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesSession) Initialize(_reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.Initialize(&_SortedOracles.TransactOpts, _reportExpirySeconds) +} + +// Initialize is a paid mutator transaction binding the contract method 0xfe4b84df. +// +// Solidity: function initialize(uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesTransactorSession) Initialize(_reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.Initialize(&_SortedOracles.TransactOpts, _reportExpirySeconds) +} + +// RemoveExpiredReports is a paid mutator transaction binding the contract method 0xdd34ca3b. +// +// Solidity: function removeExpiredReports(address token, uint256 n) returns() +func (_SortedOracles *SortedOraclesTransactor) RemoveExpiredReports(opts *bind.TransactOpts, token common.Address, n *big.Int) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "removeExpiredReports", token, n) +} + +// RemoveExpiredReports is a paid mutator transaction binding the contract method 0xdd34ca3b. +// +// Solidity: function removeExpiredReports(address token, uint256 n) returns() +func (_SortedOracles *SortedOraclesSession) RemoveExpiredReports(token common.Address, n *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.RemoveExpiredReports(&_SortedOracles.TransactOpts, token, n) +} + +// RemoveExpiredReports is a paid mutator transaction binding the contract method 0xdd34ca3b. +// +// Solidity: function removeExpiredReports(address token, uint256 n) returns() +func (_SortedOracles *SortedOraclesTransactorSession) RemoveExpiredReports(token common.Address, n *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.RemoveExpiredReports(&_SortedOracles.TransactOpts, token, n) +} + +// RemoveOracle is a paid mutator transaction binding the contract method 0x53a57297. +// +// Solidity: function removeOracle(address token, address oracleAddress, uint256 index) returns() +func (_SortedOracles *SortedOraclesTransactor) RemoveOracle(opts *bind.TransactOpts, token common.Address, oracleAddress common.Address, index *big.Int) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "removeOracle", token, oracleAddress, index) +} + +// RemoveOracle is a paid mutator transaction binding the contract method 0x53a57297. +// +// Solidity: function removeOracle(address token, address oracleAddress, uint256 index) returns() +func (_SortedOracles *SortedOraclesSession) RemoveOracle(token common.Address, oracleAddress common.Address, index *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.RemoveOracle(&_SortedOracles.TransactOpts, token, oracleAddress, index) +} + +// RemoveOracle is a paid mutator transaction binding the contract method 0x53a57297. +// +// Solidity: function removeOracle(address token, address oracleAddress, uint256 index) returns() +func (_SortedOracles *SortedOraclesTransactorSession) RemoveOracle(token common.Address, oracleAddress common.Address, index *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.RemoveOracle(&_SortedOracles.TransactOpts, token, oracleAddress, index) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SortedOracles *SortedOraclesTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SortedOracles *SortedOraclesSession) RenounceOwnership() (*types.Transaction, error) { + return _SortedOracles.Contract.RenounceOwnership(&_SortedOracles.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_SortedOracles *SortedOraclesTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _SortedOracles.Contract.RenounceOwnership(&_SortedOracles.TransactOpts) +} + +// Report is a paid mutator transaction binding the contract method 0x80e50744. +// +// Solidity: function report(address token, uint256 value, address lesserKey, address greaterKey) returns() +func (_SortedOracles *SortedOraclesTransactor) Report(opts *bind.TransactOpts, token common.Address, value *big.Int, lesserKey common.Address, greaterKey common.Address) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "report", token, value, lesserKey, greaterKey) +} + +// Report is a paid mutator transaction binding the contract method 0x80e50744. +// +// Solidity: function report(address token, uint256 value, address lesserKey, address greaterKey) returns() +func (_SortedOracles *SortedOraclesSession) Report(token common.Address, value *big.Int, lesserKey common.Address, greaterKey common.Address) (*types.Transaction, error) { + return _SortedOracles.Contract.Report(&_SortedOracles.TransactOpts, token, value, lesserKey, greaterKey) +} + +// Report is a paid mutator transaction binding the contract method 0x80e50744. +// +// Solidity: function report(address token, uint256 value, address lesserKey, address greaterKey) returns() +func (_SortedOracles *SortedOraclesTransactorSession) Report(token common.Address, value *big.Int, lesserKey common.Address, greaterKey common.Address) (*types.Transaction, error) { + return _SortedOracles.Contract.Report(&_SortedOracles.TransactOpts, token, value, lesserKey, greaterKey) +} + +// SetReportExpiry is a paid mutator transaction binding the contract method 0xebc1d6bb. +// +// Solidity: function setReportExpiry(uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesTransactor) SetReportExpiry(opts *bind.TransactOpts, _reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "setReportExpiry", _reportExpirySeconds) +} + +// SetReportExpiry is a paid mutator transaction binding the contract method 0xebc1d6bb. +// +// Solidity: function setReportExpiry(uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesSession) SetReportExpiry(_reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.SetReportExpiry(&_SortedOracles.TransactOpts, _reportExpirySeconds) +} + +// SetReportExpiry is a paid mutator transaction binding the contract method 0xebc1d6bb. +// +// Solidity: function setReportExpiry(uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesTransactorSession) SetReportExpiry(_reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.SetReportExpiry(&_SortedOracles.TransactOpts, _reportExpirySeconds) +} + +// SetTokenReportExpiry is a paid mutator transaction binding the contract method 0xfc20935d. +// +// Solidity: function setTokenReportExpiry(address _token, uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesTransactor) SetTokenReportExpiry(opts *bind.TransactOpts, _token common.Address, _reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "setTokenReportExpiry", _token, _reportExpirySeconds) +} + +// SetTokenReportExpiry is a paid mutator transaction binding the contract method 0xfc20935d. +// +// Solidity: function setTokenReportExpiry(address _token, uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesSession) SetTokenReportExpiry(_token common.Address, _reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.SetTokenReportExpiry(&_SortedOracles.TransactOpts, _token, _reportExpirySeconds) +} + +// SetTokenReportExpiry is a paid mutator transaction binding the contract method 0xfc20935d. +// +// Solidity: function setTokenReportExpiry(address _token, uint256 _reportExpirySeconds) returns() +func (_SortedOracles *SortedOraclesTransactorSession) SetTokenReportExpiry(_token common.Address, _reportExpirySeconds *big.Int) (*types.Transaction, error) { + return _SortedOracles.Contract.SetTokenReportExpiry(&_SortedOracles.TransactOpts, _token, _reportExpirySeconds) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SortedOracles *SortedOraclesTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _SortedOracles.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SortedOracles *SortedOraclesSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _SortedOracles.Contract.TransferOwnership(&_SortedOracles.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_SortedOracles *SortedOraclesTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _SortedOracles.Contract.TransferOwnership(&_SortedOracles.TransactOpts, newOwner) +} + +// SortedOraclesMedianUpdatedIterator is returned from FilterMedianUpdated and is used to iterate over the raw logs and unpacked data for MedianUpdated events raised by the SortedOracles contract. +type SortedOraclesMedianUpdatedIterator struct { + Event *SortedOraclesMedianUpdated // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SortedOraclesMedianUpdatedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SortedOraclesMedianUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SortedOraclesMedianUpdated) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SortedOraclesMedianUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SortedOraclesMedianUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SortedOraclesMedianUpdated represents a MedianUpdated event raised by the SortedOracles contract. +type SortedOraclesMedianUpdated struct { + Token common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMedianUpdated is a free log retrieval operation binding the contract event 0xa9981ebfc3b766a742486e898f54959b050a66006dbce1a4155c1f84a08bcf41. +// +// Solidity: event MedianUpdated(address indexed token, uint256 value) +func (_SortedOracles *SortedOraclesFilterer) FilterMedianUpdated(opts *bind.FilterOpts, token []common.Address) (*SortedOraclesMedianUpdatedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _SortedOracles.contract.FilterLogs(opts, "MedianUpdated", tokenRule) + if err != nil { + return nil, err + } + return &SortedOraclesMedianUpdatedIterator{contract: _SortedOracles.contract, event: "MedianUpdated", logs: logs, sub: sub}, nil +} + +// WatchMedianUpdated is a free log subscription operation binding the contract event 0xa9981ebfc3b766a742486e898f54959b050a66006dbce1a4155c1f84a08bcf41. +// +// Solidity: event MedianUpdated(address indexed token, uint256 value) +func (_SortedOracles *SortedOraclesFilterer) WatchMedianUpdated(opts *bind.WatchOpts, sink chan<- *SortedOraclesMedianUpdated, token []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + + logs, sub, err := _SortedOracles.contract.WatchLogs(opts, "MedianUpdated", tokenRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SortedOraclesMedianUpdated) + if err := _SortedOracles.contract.UnpackLog(event, "MedianUpdated", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseMedianUpdated is a log parse operation binding the contract event 0xa9981ebfc3b766a742486e898f54959b050a66006dbce1a4155c1f84a08bcf41. +// +// Solidity: event MedianUpdated(address indexed token, uint256 value) +func (_SortedOracles *SortedOraclesFilterer) ParseMedianUpdated(log types.Log) (*SortedOraclesMedianUpdated, error) { + event := new(SortedOraclesMedianUpdated) + if err := _SortedOracles.contract.UnpackLog(event, "MedianUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SortedOraclesOracleAddedIterator is returned from FilterOracleAdded and is used to iterate over the raw logs and unpacked data for OracleAdded events raised by the SortedOracles contract. +type SortedOraclesOracleAddedIterator struct { + Event *SortedOraclesOracleAdded // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SortedOraclesOracleAddedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOracleAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOracleAdded) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SortedOraclesOracleAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SortedOraclesOracleAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SortedOraclesOracleAdded represents a OracleAdded event raised by the SortedOracles contract. +type SortedOraclesOracleAdded struct { + Token common.Address + OracleAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOracleAdded is a free log retrieval operation binding the contract event 0x828d2be040dede7698182e08dfa8bfbd663c879aee772509c4a2bd961d0ed43f. +// +// Solidity: event OracleAdded(address indexed token, address indexed oracleAddress) +func (_SortedOracles *SortedOraclesFilterer) FilterOracleAdded(opts *bind.FilterOpts, token []common.Address, oracleAddress []common.Address) (*SortedOraclesOracleAddedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var oracleAddressRule []interface{} + for _, oracleAddressItem := range oracleAddress { + oracleAddressRule = append(oracleAddressRule, oracleAddressItem) + } + + logs, sub, err := _SortedOracles.contract.FilterLogs(opts, "OracleAdded", tokenRule, oracleAddressRule) + if err != nil { + return nil, err + } + return &SortedOraclesOracleAddedIterator{contract: _SortedOracles.contract, event: "OracleAdded", logs: logs, sub: sub}, nil +} + +// WatchOracleAdded is a free log subscription operation binding the contract event 0x828d2be040dede7698182e08dfa8bfbd663c879aee772509c4a2bd961d0ed43f. +// +// Solidity: event OracleAdded(address indexed token, address indexed oracleAddress) +func (_SortedOracles *SortedOraclesFilterer) WatchOracleAdded(opts *bind.WatchOpts, sink chan<- *SortedOraclesOracleAdded, token []common.Address, oracleAddress []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var oracleAddressRule []interface{} + for _, oracleAddressItem := range oracleAddress { + oracleAddressRule = append(oracleAddressRule, oracleAddressItem) + } + + logs, sub, err := _SortedOracles.contract.WatchLogs(opts, "OracleAdded", tokenRule, oracleAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SortedOraclesOracleAdded) + if err := _SortedOracles.contract.UnpackLog(event, "OracleAdded", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOracleAdded is a log parse operation binding the contract event 0x828d2be040dede7698182e08dfa8bfbd663c879aee772509c4a2bd961d0ed43f. +// +// Solidity: event OracleAdded(address indexed token, address indexed oracleAddress) +func (_SortedOracles *SortedOraclesFilterer) ParseOracleAdded(log types.Log) (*SortedOraclesOracleAdded, error) { + event := new(SortedOraclesOracleAdded) + if err := _SortedOracles.contract.UnpackLog(event, "OracleAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SortedOraclesOracleRemovedIterator is returned from FilterOracleRemoved and is used to iterate over the raw logs and unpacked data for OracleRemoved events raised by the SortedOracles contract. +type SortedOraclesOracleRemovedIterator struct { + Event *SortedOraclesOracleRemoved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SortedOraclesOracleRemovedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOracleRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOracleRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SortedOraclesOracleRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SortedOraclesOracleRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SortedOraclesOracleRemoved represents a OracleRemoved event raised by the SortedOracles contract. +type SortedOraclesOracleRemoved struct { + Token common.Address + OracleAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOracleRemoved is a free log retrieval operation binding the contract event 0x6dc84b66cc948d847632b9d829f7cb1cb904fbf2c084554a9bc22ad9d8453340. +// +// Solidity: event OracleRemoved(address indexed token, address indexed oracleAddress) +func (_SortedOracles *SortedOraclesFilterer) FilterOracleRemoved(opts *bind.FilterOpts, token []common.Address, oracleAddress []common.Address) (*SortedOraclesOracleRemovedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var oracleAddressRule []interface{} + for _, oracleAddressItem := range oracleAddress { + oracleAddressRule = append(oracleAddressRule, oracleAddressItem) + } + + logs, sub, err := _SortedOracles.contract.FilterLogs(opts, "OracleRemoved", tokenRule, oracleAddressRule) + if err != nil { + return nil, err + } + return &SortedOraclesOracleRemovedIterator{contract: _SortedOracles.contract, event: "OracleRemoved", logs: logs, sub: sub}, nil +} + +// WatchOracleRemoved is a free log subscription operation binding the contract event 0x6dc84b66cc948d847632b9d829f7cb1cb904fbf2c084554a9bc22ad9d8453340. +// +// Solidity: event OracleRemoved(address indexed token, address indexed oracleAddress) +func (_SortedOracles *SortedOraclesFilterer) WatchOracleRemoved(opts *bind.WatchOpts, sink chan<- *SortedOraclesOracleRemoved, token []common.Address, oracleAddress []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var oracleAddressRule []interface{} + for _, oracleAddressItem := range oracleAddress { + oracleAddressRule = append(oracleAddressRule, oracleAddressItem) + } + + logs, sub, err := _SortedOracles.contract.WatchLogs(opts, "OracleRemoved", tokenRule, oracleAddressRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SortedOraclesOracleRemoved) + if err := _SortedOracles.contract.UnpackLog(event, "OracleRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOracleRemoved is a log parse operation binding the contract event 0x6dc84b66cc948d847632b9d829f7cb1cb904fbf2c084554a9bc22ad9d8453340. +// +// Solidity: event OracleRemoved(address indexed token, address indexed oracleAddress) +func (_SortedOracles *SortedOraclesFilterer) ParseOracleRemoved(log types.Log) (*SortedOraclesOracleRemoved, error) { + event := new(SortedOraclesOracleRemoved) + if err := _SortedOracles.contract.UnpackLog(event, "OracleRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SortedOraclesOracleReportRemovedIterator is returned from FilterOracleReportRemoved and is used to iterate over the raw logs and unpacked data for OracleReportRemoved events raised by the SortedOracles contract. +type SortedOraclesOracleReportRemovedIterator struct { + Event *SortedOraclesOracleReportRemoved // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SortedOraclesOracleReportRemovedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOracleReportRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOracleReportRemoved) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SortedOraclesOracleReportRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SortedOraclesOracleReportRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SortedOraclesOracleReportRemoved represents a OracleReportRemoved event raised by the SortedOracles contract. +type SortedOraclesOracleReportRemoved struct { + Token common.Address + Oracle common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOracleReportRemoved is a free log retrieval operation binding the contract event 0xe21a44017b6fa1658d84e937d56ff408501facdb4ff7427c479ac460d76f7893. +// +// Solidity: event OracleReportRemoved(address indexed token, address indexed oracle) +func (_SortedOracles *SortedOraclesFilterer) FilterOracleReportRemoved(opts *bind.FilterOpts, token []common.Address, oracle []common.Address) (*SortedOraclesOracleReportRemovedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var oracleRule []interface{} + for _, oracleItem := range oracle { + oracleRule = append(oracleRule, oracleItem) + } + + logs, sub, err := _SortedOracles.contract.FilterLogs(opts, "OracleReportRemoved", tokenRule, oracleRule) + if err != nil { + return nil, err + } + return &SortedOraclesOracleReportRemovedIterator{contract: _SortedOracles.contract, event: "OracleReportRemoved", logs: logs, sub: sub}, nil +} + +// WatchOracleReportRemoved is a free log subscription operation binding the contract event 0xe21a44017b6fa1658d84e937d56ff408501facdb4ff7427c479ac460d76f7893. +// +// Solidity: event OracleReportRemoved(address indexed token, address indexed oracle) +func (_SortedOracles *SortedOraclesFilterer) WatchOracleReportRemoved(opts *bind.WatchOpts, sink chan<- *SortedOraclesOracleReportRemoved, token []common.Address, oracle []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var oracleRule []interface{} + for _, oracleItem := range oracle { + oracleRule = append(oracleRule, oracleItem) + } + + logs, sub, err := _SortedOracles.contract.WatchLogs(opts, "OracleReportRemoved", tokenRule, oracleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SortedOraclesOracleReportRemoved) + if err := _SortedOracles.contract.UnpackLog(event, "OracleReportRemoved", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOracleReportRemoved is a log parse operation binding the contract event 0xe21a44017b6fa1658d84e937d56ff408501facdb4ff7427c479ac460d76f7893. +// +// Solidity: event OracleReportRemoved(address indexed token, address indexed oracle) +func (_SortedOracles *SortedOraclesFilterer) ParseOracleReportRemoved(log types.Log) (*SortedOraclesOracleReportRemoved, error) { + event := new(SortedOraclesOracleReportRemoved) + if err := _SortedOracles.contract.UnpackLog(event, "OracleReportRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SortedOraclesOracleReportedIterator is returned from FilterOracleReported and is used to iterate over the raw logs and unpacked data for OracleReported events raised by the SortedOracles contract. +type SortedOraclesOracleReportedIterator struct { + Event *SortedOraclesOracleReported // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SortedOraclesOracleReportedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOracleReported) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOracleReported) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SortedOraclesOracleReportedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SortedOraclesOracleReportedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SortedOraclesOracleReported represents a OracleReported event raised by the SortedOracles contract. +type SortedOraclesOracleReported struct { + Token common.Address + Oracle common.Address + Timestamp *big.Int + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOracleReported is a free log retrieval operation binding the contract event 0x7cebb17173a9ed273d2b7538f64395c0ebf352ff743f1cf8ce66b437a6144213. +// +// Solidity: event OracleReported(address indexed token, address indexed oracle, uint256 timestamp, uint256 value) +func (_SortedOracles *SortedOraclesFilterer) FilterOracleReported(opts *bind.FilterOpts, token []common.Address, oracle []common.Address) (*SortedOraclesOracleReportedIterator, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var oracleRule []interface{} + for _, oracleItem := range oracle { + oracleRule = append(oracleRule, oracleItem) + } + + logs, sub, err := _SortedOracles.contract.FilterLogs(opts, "OracleReported", tokenRule, oracleRule) + if err != nil { + return nil, err + } + return &SortedOraclesOracleReportedIterator{contract: _SortedOracles.contract, event: "OracleReported", logs: logs, sub: sub}, nil +} + +// WatchOracleReported is a free log subscription operation binding the contract event 0x7cebb17173a9ed273d2b7538f64395c0ebf352ff743f1cf8ce66b437a6144213. +// +// Solidity: event OracleReported(address indexed token, address indexed oracle, uint256 timestamp, uint256 value) +func (_SortedOracles *SortedOraclesFilterer) WatchOracleReported(opts *bind.WatchOpts, sink chan<- *SortedOraclesOracleReported, token []common.Address, oracle []common.Address) (event.Subscription, error) { + + var tokenRule []interface{} + for _, tokenItem := range token { + tokenRule = append(tokenRule, tokenItem) + } + var oracleRule []interface{} + for _, oracleItem := range oracle { + oracleRule = append(oracleRule, oracleItem) + } + + logs, sub, err := _SortedOracles.contract.WatchLogs(opts, "OracleReported", tokenRule, oracleRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SortedOraclesOracleReported) + if err := _SortedOracles.contract.UnpackLog(event, "OracleReported", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOracleReported is a log parse operation binding the contract event 0x7cebb17173a9ed273d2b7538f64395c0ebf352ff743f1cf8ce66b437a6144213. +// +// Solidity: event OracleReported(address indexed token, address indexed oracle, uint256 timestamp, uint256 value) +func (_SortedOracles *SortedOraclesFilterer) ParseOracleReported(log types.Log) (*SortedOraclesOracleReported, error) { + event := new(SortedOraclesOracleReported) + if err := _SortedOracles.contract.UnpackLog(event, "OracleReported", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SortedOraclesOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the SortedOracles contract. +type SortedOraclesOwnershipTransferredIterator struct { + Event *SortedOraclesOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SortedOraclesOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SortedOraclesOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SortedOraclesOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SortedOraclesOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SortedOraclesOwnershipTransferred represents a OwnershipTransferred event raised by the SortedOracles contract. +type SortedOraclesOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SortedOracles *SortedOraclesFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*SortedOraclesOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _SortedOracles.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &SortedOraclesOwnershipTransferredIterator{contract: _SortedOracles.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SortedOracles *SortedOraclesFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *SortedOraclesOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _SortedOracles.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SortedOraclesOwnershipTransferred) + if err := _SortedOracles.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_SortedOracles *SortedOraclesFilterer) ParseOwnershipTransferred(log types.Log) (*SortedOraclesOwnershipTransferred, error) { + event := new(SortedOraclesOwnershipTransferred) + if err := _SortedOracles.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SortedOraclesReportExpirySetIterator is returned from FilterReportExpirySet and is used to iterate over the raw logs and unpacked data for ReportExpirySet events raised by the SortedOracles contract. +type SortedOraclesReportExpirySetIterator struct { + Event *SortedOraclesReportExpirySet // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SortedOraclesReportExpirySetIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SortedOraclesReportExpirySet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SortedOraclesReportExpirySet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SortedOraclesReportExpirySetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SortedOraclesReportExpirySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SortedOraclesReportExpirySet represents a ReportExpirySet event raised by the SortedOracles contract. +type SortedOraclesReportExpirySet struct { + ReportExpiry *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterReportExpirySet is a free log retrieval operation binding the contract event 0xc68a9b88effd8a11611ff410efbc83569f0031b7bc70dd455b61344c7f0a042f. +// +// Solidity: event ReportExpirySet(uint256 reportExpiry) +func (_SortedOracles *SortedOraclesFilterer) FilterReportExpirySet(opts *bind.FilterOpts) (*SortedOraclesReportExpirySetIterator, error) { + + logs, sub, err := _SortedOracles.contract.FilterLogs(opts, "ReportExpirySet") + if err != nil { + return nil, err + } + return &SortedOraclesReportExpirySetIterator{contract: _SortedOracles.contract, event: "ReportExpirySet", logs: logs, sub: sub}, nil +} + +// WatchReportExpirySet is a free log subscription operation binding the contract event 0xc68a9b88effd8a11611ff410efbc83569f0031b7bc70dd455b61344c7f0a042f. +// +// Solidity: event ReportExpirySet(uint256 reportExpiry) +func (_SortedOracles *SortedOraclesFilterer) WatchReportExpirySet(opts *bind.WatchOpts, sink chan<- *SortedOraclesReportExpirySet) (event.Subscription, error) { + + logs, sub, err := _SortedOracles.contract.WatchLogs(opts, "ReportExpirySet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SortedOraclesReportExpirySet) + if err := _SortedOracles.contract.UnpackLog(event, "ReportExpirySet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseReportExpirySet is a log parse operation binding the contract event 0xc68a9b88effd8a11611ff410efbc83569f0031b7bc70dd455b61344c7f0a042f. +// +// Solidity: event ReportExpirySet(uint256 reportExpiry) +func (_SortedOracles *SortedOraclesFilterer) ParseReportExpirySet(log types.Log) (*SortedOraclesReportExpirySet, error) { + event := new(SortedOraclesReportExpirySet) + if err := _SortedOracles.contract.UnpackLog(event, "ReportExpirySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// SortedOraclesTokenReportExpirySetIterator is returned from FilterTokenReportExpirySet and is used to iterate over the raw logs and unpacked data for TokenReportExpirySet events raised by the SortedOracles contract. +type SortedOraclesTokenReportExpirySetIterator struct { + Event *SortedOraclesTokenReportExpirySet // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *SortedOraclesTokenReportExpirySetIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(SortedOraclesTokenReportExpirySet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(SortedOraclesTokenReportExpirySet) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *SortedOraclesTokenReportExpirySetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *SortedOraclesTokenReportExpirySetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// SortedOraclesTokenReportExpirySet represents a TokenReportExpirySet event raised by the SortedOracles contract. +type SortedOraclesTokenReportExpirySet struct { + Token common.Address + ReportExpiry *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTokenReportExpirySet is a free log retrieval operation binding the contract event 0xf8324c8592dfd9991ee3e717351afe0a964605257959e3d99b0eb3d45bff9422. +// +// Solidity: event TokenReportExpirySet(address token, uint256 reportExpiry) +func (_SortedOracles *SortedOraclesFilterer) FilterTokenReportExpirySet(opts *bind.FilterOpts) (*SortedOraclesTokenReportExpirySetIterator, error) { + + logs, sub, err := _SortedOracles.contract.FilterLogs(opts, "TokenReportExpirySet") + if err != nil { + return nil, err + } + return &SortedOraclesTokenReportExpirySetIterator{contract: _SortedOracles.contract, event: "TokenReportExpirySet", logs: logs, sub: sub}, nil +} + +// WatchTokenReportExpirySet is a free log subscription operation binding the contract event 0xf8324c8592dfd9991ee3e717351afe0a964605257959e3d99b0eb3d45bff9422. +// +// Solidity: event TokenReportExpirySet(address token, uint256 reportExpiry) +func (_SortedOracles *SortedOraclesFilterer) WatchTokenReportExpirySet(opts *bind.WatchOpts, sink chan<- *SortedOraclesTokenReportExpirySet) (event.Subscription, error) { + + logs, sub, err := _SortedOracles.contract.WatchLogs(opts, "TokenReportExpirySet") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(SortedOraclesTokenReportExpirySet) + if err := _SortedOracles.contract.UnpackLog(event, "TokenReportExpirySet", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTokenReportExpirySet is a log parse operation binding the contract event 0xf8324c8592dfd9991ee3e717351afe0a964605257959e3d99b0eb3d45bff9422. +// +// Solidity: event TokenReportExpirySet(address token, uint256 reportExpiry) +func (_SortedOracles *SortedOraclesFilterer) ParseTokenReportExpirySet(log types.Log) (*SortedOraclesTokenReportExpirySet, error) { + event := new(SortedOraclesTokenReportExpirySet) + if err := _SortedOracles.contract.UnpackLog(event, "TokenReportExpirySet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/celo/celo.go b/contracts/celo/celo.go index e7484c61c7..39b572822d 100644 --- a/contracts/celo/celo.go +++ b/contracts/celo/celo.go @@ -3,9 +3,12 @@ package contracts import _ "embed" //go:generate go run ../../cmd/abigen --pkg abigen --out abigen/GoldToken.go --abi compiled/GoldToken.abi --type GoldToken -//go:generate go run ../../cmd/abigen --pkg abigen --out abigen/Registry.go --abi compiled/Registry.abi --type Registry +//go:generate go run ../../cmd/abigen --pkg abigen --out abigen/Registry.go --abi compiled/CeloRegistry.abi --type Registry +//go:generate go run ../../cmd/abigen --pkg abigen --out abigen/SortedOracles.go --abi compiled/SortedOracles.abi --type SortedOracles +//go:generate go run ../../cmd/abigen --pkg abigen --out abigen/FeeCurrencyWhitelist.go --abi compiled/FeeCurrencyWhitelist.abi --type FeeCurrencyWhitelist +//go:generate go run ../../cmd/abigen --pkg abigen --out abigen/FeeCurrency.go --abi compiled/FeeCurrency.abi --type FeeCurrency -//go:embed compiled/Registry.bin-runtime +//go:embed compiled/CeloRegistry.bin-runtime var RegistryBytecodeRaw []byte //go:embed compiled/GoldToken.bin-runtime @@ -13,3 +16,15 @@ var GoldTokenBytecodeRaw []byte //go:embed compiled/Proxy.bin-runtime var ProxyBytecodeRaw []byte + +//go:embed compiled/SortedOracles.bin-runtime +var SortedOraclesBytecodeRaw []byte + +//go:embed compiled/FeeCurrencyWhitelist.bin-runtime +var FeeCurrencyWhitelistBytecodeRaw []byte + +//go:embed compiled/FeeCurrency.bin-runtime +var FeeCurrencyBytecodeRaw []byte + +//go:embed compiled/AddressSortedLinkedListWithMedian.bin-runtime +var AddressSortedLinkedListWithMedianBytecodeRaw []byte diff --git a/contracts/celo/compiled/AddressSortedLinkedListWithMedian.abi b/contracts/celo/compiled/AddressSortedLinkedListWithMedian.abi new file mode 100644 index 0000000000..36e17ad3d7 --- /dev/null +++ b/contracts/celo/compiled/AddressSortedLinkedListWithMedian.abi @@ -0,0 +1,40 @@ +[ + { + "inputs": [ + { + "internalType": "bytes32", + "name": "b", + "type": "bytes32" + } + ], + "name": "toAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "a", + "type": "address" + } + ], + "name": "toBytes", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "pure", + "type": "function" + } +] diff --git a/contracts/celo/compiled/AddressSortedLinkedListWithMedian.bin-runtime b/contracts/celo/compiled/AddressSortedLinkedListWithMedian.bin-runtime new file mode 100644 index 0000000000..9dced150d6 --- /dev/null +++ b/contracts/celo/compiled/AddressSortedLinkedListWithMedian.bin-runtime @@ -0,0 +1 @@ +0x73000000000000000000000000000000000000000030146080604052600436106100e95760003560e01c80636eafa6c31161009657806395073a791161007057806395073a7914610213578063c1e728e914610236578063d4a0927214610256578063d938ec7b1461027657600080fd5b80636eafa6c3146101cb5780637c6bb862146101de578063832a2147146101f157600080fd5b8063593b79fe116100c7578063593b79fe1461015257806359d556a8146101965780636cfa3873146101a957600080fd5b80630944c594146100ee5780633118159e1461012b578063341f66231461013e575b600080fd5b6101016100fc3660046116e0565b610289565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b6101016101393660046116e0565b61029c565b61010161014c3660046116e0565b60601c90565b610188610160366004611722565b60601b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001690565b604051908152602001610122565b6101886101a43660046116e0565b6102ac565b6101bc6101b73660046116e0565b6102c5565b604051610122939291906117df565b6101886101d93660046116e0565b610512565b6101886101ec366004611883565b61051f565b8180156101fd57600080fd5b5061021161020c3660046118af565b61055f565b005b610226610221366004611883565b6105a5565b6040519015158152602001610122565b81801561024257600080fd5b50610211610251366004611883565b6105d7565b81801561026257600080fd5b506102116102713660046118af565b61060b565b6101016102843660046116e0565b61064a565b600061029661014c835490565b92915050565b600061029661014c836005015490565b600061029682600501548361065a90919063ffffffff16565b606080606060006102d585610670565b90506000815167ffffffffffffffff8111156102f3576102f3611906565b60405190808252806020026020018201604052801561031c578160200160208202803683370190505b5090506000825167ffffffffffffffff81111561033b5761033b611906565b604051908082528060200260200182016040528015610364578160200160208202803683370190505b5090506000825167ffffffffffffffff81111561038357610383611906565b6040519080825280602002602001820160405280156103ac578160200160208202803683370190505b50905060005b8451811015610503576103de8582815181106103d0576103d0611935565b602002602001015160601c90565b8482815181106103f0576103f0611935565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061045685828151811061043f5761043f611935565b60200260200101518a61065a90919063ffffffff16565b83828151811061046857610468611935565b60200260200101818152505088600601600086838151811061048c5761048c611935565b6020026020010151815260200190815260200160002060009054906101000a900460ff168282815181106104c2576104c2611935565b602002602001019060038111156104db576104db61173d565b908160038111156104ee576104ee61173d565b905250806104fb81611993565b9150506103b2565b50919790965090945092505050565b6000610296826002015490565b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606082901b1660009081526004830160205260408120545b9392505050565b61059e857fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087811b821691879187811b8216919087901b1661067b565b5050505050565b6000610558837fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606085901b16610692565b610607827fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606084901b1661069e565b5050565b61059e857fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087811b821691879187811b8216919087901b166107ad565b600061029661014c836001015490565b6000908152600491909101602052604090205490565b6060610296826109c5565b610685858561069e565b61059e85858585856107ad565b600061055883836109d0565b600282015460009081036106b85760006005840155610794565b6002838101546106c891906119cb565b600003610734576002600083815260068501602052604090205460ff1660038111156106f6576106f661173d565b148061072657506003600083815260068501602052604090205460ff1660038111156107245761072461173d565b145b1561072f575060015b610794565b6001600083815260068501602052604090205460ff16600381111561075b5761075b61173d565b148061078b57506003600083815260068501602052604090205460ff1660038111156107895761078961173d565b145b15610794575060025b61079e83826109ec565b6107a88383610b06565b505050565b6107ba8585858585610b24565b6000848152600386016020526040812060028701549091906001036108265760058701869055600086815260068801602052604090208054600391907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001835b02179055506109b2565b60028781015461083691906119cb565b6001036108f75781541580610871575060018254600090815260068901602052604090205460ff16600381111561086f5761086f61173d565b145b156108b7575060008581526006870160205260409020805460019182917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016828061081c565b600086815260068801602052604090208054600291907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018361081c565b60018201541580610931575060026001830154600090815260068901602052604090205460ff16600381111561092f5761092f61173d565b145b15610978575060008581526006870160205260409020805460029182917fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018361081c565b6000868152600688016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b6109bc87826109ec565b50505050505050565b606061029682610d62565b600081815260038301602052604081206002015460ff16610558565b6005820154600090815260038301602052604090206001826002811115610a1557610a1561173d565b03610a62576005830180546000908152600685016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600217905581549055610ac3565b6002826002811115610a7657610a7661173d565b03610ac3576005830180546000908152600685016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915582015490555b50506005810154600090815260069091016020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166003179055565b610b108282610d72565b600090815260049091016020526040812055565b8315801590610b335750818414155b8015610b3f5750808414155b8015610b525750610b5085856109d0565b155b610bbd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f696e76616c6964206b657900000000000000000000000000000000000000000060448201526064015b60405180910390fd5b81151580610bca57508015155b80610bd757506002850154155b610c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f6772656174657220616e64206c6573736572206b6579207a65726f00000000006044820152606401610bb4565b610c4785836109d0565b80610c50575081155b610cb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f696e76616c6964206c6573736572206b657900000000000000000000000000006044820152606401610bb4565b610cc085826109d0565b80610cc9575080155b610d2f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f696e76616c69642067726561746572206b6579000000000000000000000000006044820152606401610bb4565b610d3b85848484610eca565b9092509050610d4c85858484611025565b5050600091825260049092016020526040902055565b6060610296828360020154611573565b600081815260038301602052604090208115801590610da45750600082815260038401602052604090206002015460ff165b610e0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6b6579206e6f7420696e206c69737400000000000000000000000000000000006044820152606401610bb4565b805415610e3157805460009081526003840160205260409020600180830154910155610e3c565b600180820154908401555b600181015415610e645760018101546000908152600384016020526040902081549055610e69565b805483555b60008281526003840160205260408120818155600180820192909255600290810180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055840154610ebd9190611a06565b8360020181905550505050565b60008083158015610ee95750610ee98686868960000160010154611688565b15610efc5750506001840154829061101c565b82158015610f1557508554610f15908790879086611688565b15610f2457505083548161101c565b8315801590610f5157506000848152600387016020526040902060010154610f5190879087908790611688565b15610f735750506000828152600385016020526040902060010154829061101c565b8215801590610f9c57506000838152600387016020526040902054610f9c908790879086611688565b15610fba57505060008181526003850160205260409020548161101c565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f676574206c657373657220616e642067726561746572206661696c75726500006044820152606401610bb4565b94509492505050565b8261108c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4b6579206d75737420626520646566696e6564000000000000000000000000006044820152606401610bb4565b600083815260038501602052604090206002015460ff161561110a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f43616e277420696e7365727420616e206578697374696e6720656c656d656e746044820152606401610bb4565b82821415801561111a5750828114155b6111a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4b65792063616e6e6f74206265207468652073616d652061732070726576696f60448201527f75734b6579206f72206e6578744b6579000000000000000000000000000000006064820152608401610bb4565b60008381526003850160205260408120600280820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558601549091036111fd5760018501849055838555611554565b8215158061120a57508115155b611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4569746865722070726576696f75734b6579206f72206e6578744b6579206d7560448201527f737420626520646566696e6564000000000000000000000000000000000000006064820152608401610bb4565b8281556001810182905582156113f757600083815260038601602052604090206002015460ff16611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f49662070726576696f75734b657920697320646566696e65642c206974206d7560448201527f737420657869737420696e20746865206c6973740000000000000000000000006064820152608401610bb4565b60008381526003860160205260409020600181015483146113ec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f70726576696f75734b6579206d7573742062652061646a6163656e7420746f2060448201527f6e6578744b6579000000000000000000000000000000000000000000000000006064820152608401610bb4565b6001018490556113ff565b600185018490555b811561155057600082815260038601602052604090206002015460ff166114a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4966206e6578744b657920697320646566696e65642c206974206d757374206560448201527f7869737420696e20746865206c697374000000000000000000000000000000006064820152608401610bb4565b6000828152600386016020526040902080548414611548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f70726576696f75734b6579206d7573742062652061646a6163656e7420746f2060448201527f6e6578744b6579000000000000000000000000000000000000000000000000006064820152608401610bb4565b849055611554565b8385555b6002850154611564906001611a19565b85600201819055505050505050565b606082600201548211156115e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f6e6f7420656e6f75676820656c656d656e7473000000000000000000000000006044820152606401610bb4565b60008267ffffffffffffffff8111156115fe576115fe611906565b604051908082528060200260200182016040528015611627578160200160208202803683370190505b50845490915060005b8481101561167e578183828151811061164b5761164b611935565b602090810291909101810191909152600092835260038701905260409091205490611677816001611a19565b9050611630565b5090949350505050565b6000808315806116a8575060008481526004870160205260409020548510155b905060008315806116c9575060008481526004880160205260409020548611155b90508180156116d55750805b979650505050505050565b6000602082840312156116f257600080fd5b5035919050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461171d57600080fd5b919050565b60006020828403121561173457600080fd5b610558826116f9565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60008151808452602080850194508084016000805b848110156117d357825160048082106117c0577f4e487b7100000000000000000000000000000000000000000000000000000000845260218152602484fd5b5088529683019691830191600101611781565b50959695505050505050565b606080825284519082018190526000906020906080840190828801845b8281101561182e57815173ffffffffffffffffffffffffffffffffffffffff16845292840192908401906001016117fc565b5050508381038285015285518082528683019183019060005b8181101561186357835183529284019291840191600101611847565b50508481036040860152611877818761176c565b98975050505050505050565b6000806040838503121561189657600080fd5b823591506118a6602084016116f9565b90509250929050565b600080600080600060a086880312156118c757600080fd5b853594506118d7602087016116f9565b9350604086013592506118ec606087016116f9565b91506118fa608087016116f9565b90509295509295909350565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036119c4576119c4611964565b5060010190565b600082611a01577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500690565b8181038181111561029657610296611964565b808201808211156102965761029661196456fea164736f6c6343000814000a diff --git a/contracts/celo/compiled/Registry.abi b/contracts/celo/compiled/CeloRegistry.abi similarity index 100% rename from contracts/celo/compiled/Registry.abi rename to contracts/celo/compiled/CeloRegistry.abi diff --git a/contracts/celo/compiled/Registry.bin-runtime b/contracts/celo/compiled/CeloRegistry.bin-runtime similarity index 100% rename from contracts/celo/compiled/Registry.bin-runtime rename to contracts/celo/compiled/CeloRegistry.bin-runtime diff --git a/contracts/celo/compiled/FeeCurrency.abi b/contracts/celo/compiled/FeeCurrency.abi new file mode 100644 index 0000000000..d96832d5ae --- /dev/null +++ b/contracts/celo/compiled/FeeCurrency.abi @@ -0,0 +1,354 @@ +[ + { + "inputs": [ + { + "internalType": "string", + "name": "name_", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol_", + "type": "string" + } + ], + "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": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "feeRecipient", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "communityFund", + "type": "address" + }, + { + "internalType": "uint256", + "name": "refund", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tipTxFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseTxFee", + "type": "uint256" + } + ], + "name": "creditGasFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "debitGasFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/contracts/celo/compiled/FeeCurrency.bin-runtime b/contracts/celo/compiled/FeeCurrency.bin-runtime new file mode 100644 index 0000000000..2dfc4f9de4 --- /dev/null +++ b/contracts/celo/compiled/FeeCurrency.bin-runtime @@ -0,0 +1 @@ +0x608060405234801561001057600080fd5b50600436106100df5760003560e01c806358cf96721161008c57806395d89b411161006657806395d89b41146101ca578063a457c2d7146101d2578063a9059cbb146101e5578063dd62ed3e146101f857600080fd5b806358cf96721461016c5780636a30b2531461018157806370a082311461019457600080fd5b806323b872dd116100bd57806323b872dd14610137578063313ce5671461014a578063395093511461015957600080fd5b806306fdde03146100e4578063095ea7b31461010257806318160ddd14610125575b600080fd5b6100ec61023e565b6040516100f99190610c17565b60405180910390f35b610115610110366004610cac565b6102d0565b60405190151581526020016100f9565b6002545b6040519081526020016100f9565b610115610145366004610cd6565b6102ea565b604051601281526020016100f9565b610115610167366004610cac565b610310565b61017f61017a366004610cac565b61035c565b005b61017f61018f366004610d12565b610420565b6101296101a2366004610d8a565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6100ec610512565b6101156101e0366004610cac565b610521565b6101156101f3366004610cac565b6105fd565b610129610206366004610da5565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b60606003805461024d90610dd8565b80601f016020809104026020016040519081016040528092919081815260200182805461027990610dd8565b80156102c65780601f1061029b576101008083540402835291602001916102c6565b820191906000526020600020905b8154815290600101906020018083116102a957829003601f168201915b5050505050905090565b6000336102de81858561060b565b60019150505b92915050565b6000336102f88582856107be565b610303858585610895565b60019150505b9392505050565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906102de9082908690610357908790610e5a565b61060b565b33156103c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4f6e6c7920564d2063616e2063616c6c0000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260208190526040812080548392906103fe908490610e6d565b9250508190555080600260008282546104179190610e6d565b90915550505050565b3315610488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f4f6e6c7920564d2063616e2063616c6c0000000000000000000000000000000060448201526064016103c0565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260208190526040812080548692906104bd908490610e5a565b909155506104ce9050888683610b48565b6104d89085610e5a565b93506104e5888885610b48565b6104ef9085610e5a565b935083600260008282546105039190610e5a565b90915550505050505050505050565b60606004805461024d90610dd8565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168452909152812054909190838110156105e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016103c0565b6105f2828686840361060b565b506001949350505050565b6000336102de818585610895565b73ffffffffffffffffffffffffffffffffffffffff83166106ad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103c0565b73ffffffffffffffffffffffffffffffffffffffff8216610750576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103c0565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461088f5781811015610882576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e636500000060448201526064016103c0565b61088f848484840361060b565b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316610938576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103c0565b73ffffffffffffffffffffffffffffffffffffffff82166109db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103c0565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604090205481811015610a91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103c0565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220858503905591851681529081208054849290610ad5908490610e5a565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b3b91815260200190565b60405180910390a361088f565b600073ffffffffffffffffffffffffffffffffffffffff8316610b6d57506000610309565b73ffffffffffffffffffffffffffffffffffffffff831660009081526020819052604081208054849290610ba2908490610e5a565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c0891815260200190565b60405180910390a35092915050565b600060208083528351808285015260005b81811015610c4457858101830151858201604001528201610c28565b5060006040828601015260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8301168501019250505092915050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610ca757600080fd5b919050565b60008060408385031215610cbf57600080fd5b610cc883610c83565b946020939093013593505050565b600080600060608486031215610ceb57600080fd5b610cf484610c83565b9250610d0260208501610c83565b9150604084013590509250925092565b600080600080600080600080610100898b031215610d2f57600080fd5b610d3889610c83565b9750610d4660208a01610c83565b9650610d5460408a01610c83565b9550610d6260608a01610c83565b979a969950949760808101359660a0820135965060c0820135955060e0909101359350915050565b600060208284031215610d9c57600080fd5b61030982610c83565b60008060408385031215610db857600080fd5b610dc183610c83565b9150610dcf60208401610c83565b90509250929050565b600181811c90821680610dec57607f821691505b602082108103610e25577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156102e4576102e4610e2b565b818103818111156102e4576102e4610e2b56fea164736f6c6343000814000a diff --git a/contracts/celo/compiled/FeeCurrencyWhitelist.abi b/contracts/celo/compiled/FeeCurrencyWhitelist.abi new file mode 100644 index 0000000000..fd17f0b485 --- /dev/null +++ b/contracts/celo/compiled/FeeCurrencyWhitelist.abi @@ -0,0 +1,202 @@ +[ + { + "inputs": [ + { + "internalType": "bool", + "name": "test", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "FeeCurrencyWhitelistRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "FeeCurrencyWhitelisted", + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "addToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "getWhitelist", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "removeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "whitelist", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/contracts/celo/compiled/FeeCurrencyWhitelist.bin-runtime b/contracts/celo/compiled/FeeCurrencyWhitelist.bin-runtime new file mode 100644 index 0000000000..c3648a29fb --- /dev/null +++ b/contracts/celo/compiled/FeeCurrencyWhitelist.bin-runtime @@ -0,0 +1 @@ +0x608060405234801561001057600080fd5b50600436106100be5760003560e01c80638129fc1c11610076578063d01f63f51161005b578063d01f63f51461019e578063d48bfca7146101b3578063f2fde38b146101c657600080fd5b80638129fc1c146101785780638da5cb5b1461018057600080fd5b806354255be0116100a757806354255be014610112578063715018a6146101385780637ebd1b301461014057600080fd5b806313baf1e6146100c3578063158ef93e146100d8575b600080fd5b6100d66100d1366004610800565b6101d9565b005b6000546100fd9074010000000000000000000000000000000000000000900460ff1681565b60405190151581526020015b60405180910390f35b600180806000604080519485526020850193909352918301526060820152608001610109565b6100d66103f3565b61015361014e36600461082a565b610407565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610109565b6100d661043e565b60005473ffffffffffffffffffffffffffffffffffffffff16610153565b6101a661050b565b6040516101099190610843565b6100d66101c136600461089d565b61057a565b6100d66101d436600461089d565b61062a565b6101e16106e1565b8173ffffffffffffffffffffffffffffffffffffffff166001828154811061020b5761020b6108bf565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614610299576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f496e64657820646f6573206e6f74206d6174636800000000000000000000000060448201526064015b60405180910390fd5b60018054906102a881836108ee565b815481106102b8576102b86108bf565b6000918252602090912001546001805473ffffffffffffffffffffffffffffffffffffffff90921691849081106102f1576102f16108bf565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600180548061034a5761034a61092e565b60008281526020908190207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908301810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff851681527fc1f06ffbe5c19d22daa982fd4b3886ced05d83e2bfe7de3b67222728f5234e28910160405180910390a1505050565b6103fb6106e1565b6104056000610762565b565b6001818154811061041757600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60005474010000000000000000000000000000000000000000900460ff16156104c3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f636f6e747261637420616c726561647920696e697469616c697a6564000000006044820152606401610290565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905561040533610762565b6060600180548060200260200160405190810160405280929190818152602001828054801561057057602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610545575b5050505050905090565b6105826106e1565b6001805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040519081527fcf4fe1d1989a39011040b0c33ba1165fdeeca971a1ab2b0340b23550f93727e09060200160405180910390a150565b6106326106e1565b73ffffffffffffffffffffffffffffffffffffffff81166106d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610290565b6106de81610762565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610405576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610290565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b803573ffffffffffffffffffffffffffffffffffffffff811681146107fb57600080fd5b919050565b6000806040838503121561081357600080fd5b61081c836107d7565b946020939093013593505050565b60006020828403121561083c57600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b8181101561089157835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161085f565b50909695505050505050565b6000602082840312156108af57600080fd5b6108b8826107d7565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610928577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000814000a diff --git a/contracts/celo/compiled/GoldToken.abi b/contracts/celo/compiled/GoldToken.abi index 517d5f80c8..531a699954 100644 --- a/contracts/celo/compiled/GoldToken.abi +++ b/contracts/celo/compiled/GoldToken.abi @@ -214,7 +214,7 @@ "type": "uint8" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -379,7 +379,7 @@ "type": "string" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { @@ -400,7 +400,7 @@ "name": "registry", "outputs": [ { - "internalType": "contract IRegistry", + "internalType": "contract ICeloRegistry", "name": "", "type": "address" } @@ -438,7 +438,7 @@ "type": "string" } ], - "stateMutability": "view", + "stateMutability": "pure", "type": "function" }, { diff --git a/contracts/celo/compiled/Proxy.abi b/contracts/celo/compiled/Proxy.abi new file mode 100644 index 0000000000..3a97b00da1 --- /dev/null +++ b/contracts/celo/compiled/Proxy.abi @@ -0,0 +1,129 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_admin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_implementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] diff --git a/contracts/celo/compiled/Proxy.bin-runtime b/contracts/celo/compiled/Proxy.bin-runtime index fb7d002cc1..caed116bfd 100644 --- a/contracts/celo/compiled/Proxy.bin-runtime +++ b/contracts/celo/compiled/Proxy.bin-runtime @@ -1 +1 @@ -0x60806040526004361061004a5760003560e01c806303386ba3146101e757806342404e0714610280578063bb913f41146102d7578063d29d44ee14610328578063f7e6af8014610379575b6000600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050600081549050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610136576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4e6f20496d706c656d656e746174696f6e20736574000000000000000000000081525060200191505060405180910390fd5b61013f816103d0565b6101b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c696420636f6e74726163742061646472657373000000000000000081525060200191505060405180910390fd5b60405136810160405236600082376000803683855af43d604051818101604052816000823e82600081146101e3578282f35b8282fd5b61027e600480360360408110156101fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561023a57600080fd5b82018360208201111561024c57600080fd5b8035906020019184600183028401116401000000008311171561026e57600080fd5b909192939192939050505061041b565b005b34801561028c57600080fd5b506102956105c1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e357600080fd5b50610326600480360360208110156102fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061060d565b005b34801561033457600080fd5b506103776004803603602081101561034b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107bd565b005b34801561038557600080fd5b5061038e610871565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f915080821415801561041257506000801b8214155b92505050919050565b610423610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b6104cc8361060d565b600060608473ffffffffffffffffffffffffffffffffffffffff168484604051808383808284378083019250505092505050600060405180830381855af49150503d8060008114610539576040519150601f19603f3d011682016040523d82523d6000602084013e61053e565b606091505b508092508193505050816105ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f696e697469616c697a6174696f6e2063616c6c6261636b206661696c6564000081525060200191505060405180910390fd5b5050505050565b600080600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050805491505090565b610615610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146106b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b6000600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b9050610701826103d0565b610773576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f496e76616c696420636f6e74726163742061646472657373000000000000000081525060200191505060405180910390fd5b8181558173ffffffffffffffffffffffffffffffffffffffff167fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1360405160405180910390a25050565b6107c5610871565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610865576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f73656e64657220776173206e6f74206f776e657200000000000000000000000081525060200191505060405180910390fd5b61086e816108bd565b50565b600080600160405180807f656970313936372e70726f78792e61646d696e000000000000000000000000008152506013019050604051809103902060001c0360001b9050805491505090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610960576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f6f776e65722063616e6e6f74206265203000000000000000000000000000000081525060200191505060405180910390fd5b6000600160405180807f656970313936372e70726f78792e61646d696e000000000000000000000000008152506013019050604051809103902060001c0360001b90508181558173ffffffffffffffffffffffffffffffffffffffff167f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe260405160405180910390a2505056fea265627a7a72315820a64b1c9d3d7a24f1e995bc91922ac7efac9545b0383bfbe9894fc0973c6e560464736f6c634300050d0032 +0x60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100be5780638f283970146100f8578063f851a440146101185761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61012d565b005b61006b61012d565b34801561008157600080fd5b5061006b6100903660046106dd565b610224565b6100a86100a33660046106f8565b610296565b6040516100b5919061077b565b60405180910390f35b3480156100ca57600080fd5b506100d3610419565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b5565b34801561010457600080fd5b5061006b6101133660046106dd565b6104b0565b34801561012457600080fd5b506100d3610517565b60006101577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b905073ffffffffffffffffffffffffffffffffffffffff8116610201576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50726f78793a20696d706c656d656e746174696f6e206e6f7420696e6974696160448201527f6c697a656400000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b3660008037600080366000845af43d6000803e8061021e573d6000fd5b503d6000f35b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061027d575033155b1561028e5761028b816105a3565b50565b61028b61012d565b60606102c07fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806102f7575033155b1561040a57610305846105a3565b6000808573ffffffffffffffffffffffffffffffffffffffff16858560405161032f9291906107ee565b600060405180830381855af49150503d806000811461036a576040519150601f19603f3d011682016040523d82523d6000602084013e61036f565b606091505b509150915081610401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f50726f78793a2064656c656761746563616c6c20746f206e657720696d706c6560448201527f6d656e746174696f6e20636f6e7472616374206661696c65640000000000000060648201526084016101f8565b91506104129050565b61041261012d565b9392505050565b60006104437fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061047a575033155b156104a557507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6104ad61012d565b90565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610509575033155b1561028e5761028b8161060c565b60006105417fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610578575033155b156104a557507fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81815560405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a25050565b60006106367fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038381556040805173ffffffffffffffffffffffffffffffffffffffff80851682528616602082015292935090917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a1505050565b803573ffffffffffffffffffffffffffffffffffffffff811681146106d857600080fd5b919050565b6000602082840312156106ef57600080fd5b610412826106b4565b60008060006040848603121561070d57600080fd5b610716846106b4565b9250602084013567ffffffffffffffff8082111561073357600080fd5b818601915086601f83011261074757600080fd5b81358181111561075657600080fd5b87602082850101111561076857600080fd5b6020830194508093505050509250925092565b600060208083528351808285015260005b818110156107a85785810183015185820160400152820161078c565b818111156107ba576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b818382376000910190815291905056fea164736f6c634300080f000a diff --git a/contracts/celo/compiled/SortedOracles.abi b/contracts/celo/compiled/SortedOracles.abi new file mode 100644 index 0000000000..b8b5d8e93f --- /dev/null +++ b/contracts/celo/compiled/SortedOracles.abi @@ -0,0 +1,657 @@ +[ + { + "inputs": [ + { + "internalType": "bool", + "name": "test", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "MedianUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oracleAddress", + "type": "address" + } + ], + "name": "OracleAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oracleAddress", + "type": "address" + } + ], + "name": "OracleRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oracle", + "type": "address" + } + ], + "name": "OracleReportRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "oracle", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "OracleReported", + "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": false, + "internalType": "uint256", + "name": "reportExpiry", + "type": "uint256" + } + ], + "name": "ReportExpirySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "reportExpiry", + "type": "uint256" + } + ], + "name": "TokenReportExpirySet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "oracleAddress", + "type": "address" + } + ], + "name": "addOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getOracles", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getRates", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "enum SortedLinkedListWithMedian.MedianRelation[]", + "name": "", + "type": "uint8[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getTimestamps", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "enum SortedLinkedListWithMedian.MedianRelation[]", + "name": "", + "type": "uint8[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getTokenReportExpirySeconds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVersionNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_reportExpirySeconds", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "isOldestReportExpired", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isOracle", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "medianRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "medianTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "numRates", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "numTimestamps", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "oracles", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "n", + "type": "uint256" + } + ], + "name": "removeExpiredReports", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "oracleAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "removeOracle", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "address", + "name": "lesserKey", + "type": "address" + }, + { + "internalType": "address", + "name": "greaterKey", + "type": "address" + } + ], + "name": "report", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "reportExpirySeconds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_reportExpirySeconds", + "type": "uint256" + } + ], + "name": "setReportExpiry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_reportExpirySeconds", + "type": "uint256" + } + ], + "name": "setTokenReportExpiry", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenReportExpirySeconds", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/contracts/celo/compiled/SortedOracles.bin-runtime b/contracts/celo/compiled/SortedOracles.bin-runtime new file mode 100644 index 0000000000..d60982c4fc --- /dev/null +++ b/contracts/celo/compiled/SortedOracles.bin-runtime @@ -0,0 +1 @@ +0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80638da5cb5b116100ee578063ebc1d6bb11610097578063f2fde38b11610071578063f2fde38b146103f5578063fc20935d14610408578063fe4b84df1461041b578063ffe736bf1461042e57600080fd5b8063ebc1d6bb146103a7578063ef90e1b0146103ba578063f0ca4adb146103e257600080fd5b8063b9292158116100c8578063b92921581461036e578063bbc66a9414610381578063dd34ca3b1461039457600080fd5b80638da5cb5b146102fc5780638e7492811461033b578063a00a8b2c1461035b57600080fd5b806353a57297116101505780636deb67991161012a5780636deb6799146102ce578063715018a6146102e157806380e50744146102e957600080fd5b806353a572971461028057806354255be0146102955780636dd6ef0c146102bb57600080fd5b80632e86bc01116101815780632e86bc0114610229578063370c998e14610249578063493a353c1461027757600080fd5b806302f55b61146101a8578063071b48fc146101d3578063158ef93e146101f4575b600080fd5b6101bb6101b636600461255a565b61046d565b6040516101ca939291906125c8565b60405180910390f35b6101e66101e136600461255a565b61055c565b6040519081526020016101ca565b6000546102199074010000000000000000000000000000000000000000900460ff1681565b60405190151581526020016101ca565b6101e661023736600461255a565b60066020526000908152604090205481565b61021961025736600461268f565b600360209081526000928352604080842090915290825290205460ff1681565b6101e660055481565b61029361028e3660046126c8565b610616565b005b6001806002806040805194855260208501939093529183015260608201526080016101ca565b6101e66102c936600461255a565b6109ab565b6101e66102dc36600461255a565b610a22565b610293610a7f565b6102936102f7366004612709565b610a93565b60005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101ca565b61034e61034936600461255a565b6111bc565b6040516101ca919061275c565b61031661036936600461276f565b61124c565b6101bb61037c36600461255a565b611291565b6101e661038f36600461255a565b611310565b6102936103a236600461276f565b611387565b6102936103b536600461279b565b61153b565b6103cd6103c836600461255a565b61169f565b604080519283526020830191909152016101ca565b6102936103f036600461268f565b611783565b61029361040336600461255a565b611981565b61029361041636600461276f565b611a38565b61029361042936600461279b565b611be9565b61044161043c36600461255a565b611cbf565b60408051921515835273ffffffffffffffffffffffffffffffffffffffff9091166020830152016101ca565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600160205260409081902090517f6cfa38730000000000000000000000000000000000000000000000000000000081526060918291829173__$c0b499b413513d0c67e2a6a17d90846cb3$__91636cfa3873916104ec9160040190815260200190565b600060405180830381865af4158015610509573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261054f919081019061292a565b9250925092509193909250565b73ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604080822090517f59d556a8000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__906359d556a8906024015b602060405180830381865af41580156105ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106109190612a13565b92915050565b61061e611ee3565b73ffffffffffffffffffffffffffffffffffffffff831615801590610658575073ffffffffffffffffffffffffffffffffffffffff821615155b8015610688575073ffffffffffffffffffffffffffffffffffffffff831660009081526004602052604090205481105b80156106ef575073ffffffffffffffffffffffffffffffffffffffff8381166000908152600460205260409020805491841691839081106106cb576106cb612a2c565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16145b6107a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605660248201527f746f6b656e2061646472206e756c6c206f72206f7261636c652061646472206e60448201527f756c6c206f7220696e646578206f6620746f6b656e206f7261636c65206e6f7460648201527f206d617070656420746f206f7261636c65206164647200000000000000000000608482015260a4015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8084166000818152600360209081526040808320948716835293815283822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055918152600490915220805461081790600190612a8a565b8154811061082757610827612a2c565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff86811684526004909252604090922080549190921691908390811061087157610871612a2c565b600091825260208083209190910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff94851617905591851681526004909152604090208054806108db576108db612a9d565b60008281526020902081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905501905561093d8383611f64565b1561094c5761094c8383612105565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f6dc84b66cc948d847632b9d829f7cb1cb904fbf2c084554a9bc22ad9d845334060405160405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526002602052604080822090517f6eafa6c3000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__90636eafa6c3906024016105cf565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600660205260408120548103610a5657505060055490565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526006602052604090205490565b610a87611ee3565b610a9160006124c3565b565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600360209081526040808320338452909152902054849060ff16610b55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f73656e64657220776173206e6f7420616e206f7261636c6520666f7220746f6b60448201527f656e206164647200000000000000000000000000000000000000000000000000606482015260840161079d565b73ffffffffffffffffffffffffffffffffffffffff851660009081526001602052604080822090517f59d556a8000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__906359d556a890602401602060405180830381865af4158015610be4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c089190612a13565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600160205260409081902090517f95073a79000000000000000000000000000000000000000000000000000000008152600481019190915233602482015290915073__$c0b499b413513d0c67e2a6a17d90846cb3$__906395073a7990604401602060405180830381865af4158015610ca1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc59190612acc565b15610e395773ffffffffffffffffffffffffffffffffffffffff8681166000908152600160205260409081902090517f832a21470000000000000000000000000000000000000000000000000000000081526004810191909152336024820152604481018790528582166064820152908416608482015273__$c0b499b413513d0c67e2a6a17d90846cb3$__9063832a21479060a40160006040518083038186803b158015610d7357600080fd5b505af4158015610d87573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff86166000908152600260205260409081902090517fc1e728e9000000000000000000000000000000000000000000000000000000008152600481019190915233602482015273__$c0b499b413513d0c67e2a6a17d90846cb3$__9063c1e728e99060440160006040518083038186803b158015610e1c57600080fd5b505af4158015610e30573d6000803e3d6000fd5b50505050610efb565b73ffffffffffffffffffffffffffffffffffffffff8681166000908152600160205260409081902090517fd4a092720000000000000000000000000000000000000000000000000000000081526004810191909152336024820152604481018790528582166064820152908416608482015273__$c0b499b413513d0c67e2a6a17d90846cb3$__9063d4a092729060a40160006040518083038186803b158015610ee257600080fd5b505af4158015610ef6573d6000803e3d6000fd5b505050505b73ffffffffffffffffffffffffffffffffffffffff86166000908152600260205260409081902090517f0944c5940000000000000000000000000000000000000000000000000000000081526004810182905273__$c0b499b413513d0c67e2a6a17d90846cb3$__9163d4a0927291339042908590630944c59490602401602060405180830381865af4158015610f96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fba9190612aee565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b168152600481019490945273ffffffffffffffffffffffffffffffffffffffff928316602485015260448401919091521660648201526000608482015260a40160006040518083038186803b15801561103b57600080fd5b505af415801561104f573d6000803e3d6000fd5b5050604080514281526020810189905233935073ffffffffffffffffffffffffffffffffffffffff8a1692507f7cebb17173a9ed273d2b7538f64395c0ebf352ff743f1cf8ce66b437a6144213910160405180910390a373ffffffffffffffffffffffffffffffffffffffff861660009081526001602052604080822090517f59d556a8000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__906359d556a890602401602060405180830381865af4158015611135573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111599190612a13565b90508181146111b3578673ffffffffffffffffffffffffffffffffffffffff167fa9981ebfc3b766a742486e898f54959b050a66006dbce1a4155c1f84a08bcf41826040516111aa91815260200190565b60405180910390a25b50505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602090815260409182902080548351818402810184019094528084526060939283018282801561124057602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611215575b50505050509050919050565b6004602052816000526040600020818154811061126857600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff169150829050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600260205260409081902090517f6cfa38730000000000000000000000000000000000000000000000000000000081526060918291829173__$c0b499b413513d0c67e2a6a17d90846cb3$__91636cfa3873916104ec9160040190815260200190565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604080822090517f6eafa6c3000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__90636eafa6c3906024016105cf565b73ffffffffffffffffffffffffffffffffffffffff82161580159061145e575073ffffffffffffffffffffffffffffffffffffffff82166000908152600260205260409081902090517f6eafa6c3000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__90636eafa6c390602401602060405180830381865af4158015611437573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145b9190612a13565b81105b6114ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603460248201527f746f6b656e2061646472206e756c6c206f7220747279696e6720746f2072656d60448201527f6f766520746f6f206d616e79207265706f727473000000000000000000000000606482015260840161079d565b60005b818110156115365760008061150185611cbf565b91509150811561151a576115158582612105565b611521565b5050505050565b5050808061152e90612b0b565b9150506114ed565b505050565b611543611ee3565b600081116115d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f7265706f727420657870697279207365636f6e6473206d757374206265203e2060448201527f3000000000000000000000000000000000000000000000000000000000000000606482015260840161079d565b6005548103611664576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f7265706f72744578706972795365636f6e6473206861736e2774206368616e6760448201527f6564000000000000000000000000000000000000000000000000000000000000606482015260840161079d565b60058190556040518181527fc68a9b88effd8a11611ff410efbc83569f0031b7bc70dd455b61344c7f0a042f9060200160405180910390a150565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001602052604080822090517f59d556a8000000000000000000000000000000000000000000000000000000008152829173__$c0b499b413513d0c67e2a6a17d90846cb3$__916359d556a8916117189160040190815260200190565b602060405180830381865af4158015611735573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117599190612a13565b61176284611310565b156117775769d3c21bcecceda100000061177a565b60005b91509150915091565b61178b611ee3565b73ffffffffffffffffffffffffffffffffffffffff8216158015906117c5575073ffffffffffffffffffffffffffffffffffffffff811615155b8015611804575073ffffffffffffffffffffffffffffffffffffffff80831660009081526003602090815260408083209385168352929052205460ff16155b6118b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152605a60248201527f746f6b656e206164647220776173206e756c6c206f72206f7261636c6520616460448201527f647220776173206e756c6c206f72206f7261636c652061646472206973206e6f60648201527f7420616e206f7261636c6520666f7220746f6b656e2061646472000000000000608482015260a40161079d565b73ffffffffffffffffffffffffffffffffffffffff808316600081815260036020908152604080832094861680845294825280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660019081179091558484526004835281842080549182018155845291832090910180547fffffffffffffffffffffffff00000000000000000000000000000000000000001685179055517f828d2be040dede7698182e08dfa8bfbd663c879aee772509c4a2bd961d0ed43f9190a35050565b611989611ee3565b73ffffffffffffffffffffffffffffffffffffffff8116611a2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161079d565b611a35816124c3565b50565b611a40611ee3565b60008111611ad0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f7265706f727420657870697279207365636f6e6473206d757374206265203e2060448201527f3000000000000000000000000000000000000000000000000000000000000000606482015260840161079d565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600660205260409020548103611b84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f746f6b656e207265706f72744578706972795365636f6e6473206861736e277460448201527f206368616e676564000000000000000000000000000000000000000000000000606482015260840161079d565b73ffffffffffffffffffffffffffffffffffffffff8216600081815260066020908152604091829020849055815192835282018390527ff8324c8592dfd9991ee3e717351afe0a964605257959e3d99b0eb3d45bff9422910160405180910390a15050565b60005474010000000000000000000000000000000000000000900460ff1615611c6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f636f6e747261637420616c726561647920696e697469616c697a656400000000604482015260640161079d565b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055611cb6336124c3565b611a358161153b565b60008073ffffffffffffffffffffffffffffffffffffffff8316611d3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f746f6b656e20616464726573732063616e6e6f74206265206e756c6c00000000604482015260640161079d565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604080822090517fd938ec7b000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__9063d938ec7b90602401602060405180830381865af4158015611dce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df29190612aee565b73ffffffffffffffffffffffffffffffffffffffff85811660009081526002602052604080822090517f7c6bb8620000000000000000000000000000000000000000000000000000000081526004810191909152918316602483015291925073__$c0b499b413513d0c67e2a6a17d90846cb3$__90637c6bb86290604401602060405180830381865af4158015611e8d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eb19190612a13565b9050611ebc85610a22565b611ec68242612a8a565b10611ed75750600194909350915050565b50600094909350915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610a91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079d565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604080822090517f95073a7900000000000000000000000000000000000000000000000000000000815273__$c0b499b413513d0c67e2a6a17d90846cb3$__916395073a7991611ff99190869060040191825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b602060405180830381865af4158015612016573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203a9190612acc565b80156120fe575073ffffffffffffffffffffffffffffffffffffffff8381166000908152600260205260409081902090517f95073a790000000000000000000000000000000000000000000000000000000081526004810191909152908316602482015273__$c0b499b413513d0c67e2a6a17d90846cb3$__906395073a7990604401602060405180830381865af41580156120da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120fe9190612acc565b9392505050565b61210e826109ab565b600114801561212257506121228282611f64565b1561212b575050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526001602052604080822090517f59d556a8000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__906359d556a890602401602060405180830381865af41580156121ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121de9190612a13565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600160205260409081902090517fc1e728e900000000000000000000000000000000000000000000000000000000815291925073__$c0b499b413513d0c67e2a6a17d90846cb3$__9163c1e728e99161227691869060040191825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60006040518083038186803b15801561228e57600080fd5b505af41580156122a2573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff84166000908152600260205260409081902090517fc1e728e900000000000000000000000000000000000000000000000000000000815273__$c0b499b413513d0c67e2a6a17d90846cb3$__925063c1e728e99161233b91869060040191825273ffffffffffffffffffffffffffffffffffffffff16602082015260400190565b60006040518083038186803b15801561235357600080fd5b505af4158015612367573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff8086169350861691507fe21a44017b6fa1658d84e937d56ff408501facdb4ff7427c479ac460d76f789390600090a373ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604080822090517f59d556a8000000000000000000000000000000000000000000000000000000008152600481019190915273__$c0b499b413513d0c67e2a6a17d90846cb3$__906359d556a890602401602060405180830381865af415801561243f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124639190612a13565b90508181146124bd578373ffffffffffffffffffffffffffffffffffffffff167fa9981ebfc3b766a742486e898f54959b050a66006dbce1a4155c1f84a08bcf41826040516124b491815260200190565b60405180910390a25b50505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff81168114611a3557600080fd5b60006020828403121561256c57600080fd5b81356120fe81612538565b600081518084526020808501945080840160005b838110156125bd57815173ffffffffffffffffffffffffffffffffffffffff168752958201959082019060010161258b565b509495945050505050565b6060815260006125db6060830186612577565b82810360208481019190915285518083528682019282019060005b81811015612612578451835293830193918301916001016125f6565b50508481036040860152855180825290820192508186019060005b81811015612681578251600480821061266e577f4e487b71000000000000000000000000000000000000000000000000000000006000526021815260246000fd5b508552938301939183019160010161262d565b509298975050505050505050565b600080604083850312156126a257600080fd5b82356126ad81612538565b915060208301356126bd81612538565b809150509250929050565b6000806000606084860312156126dd57600080fd5b83356126e881612538565b925060208401356126f881612538565b929592945050506040919091013590565b6000806000806080858703121561271f57600080fd5b843561272a81612538565b935060208501359250604085013561274181612538565b9150606085013561275181612538565b939692955090935050565b6020815260006120fe6020830184612577565b6000806040838503121561278257600080fd5b823561278d81612538565b946020939093013593505050565b6000602082840312156127ad57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561282a5761282a6127b4565b604052919050565b600067ffffffffffffffff82111561284c5761284c6127b4565b5060051b60200190565b600082601f83011261286757600080fd5b8151602061287c61287783612832565b6127e3565b82815260059290921b8401810191818101908684111561289b57600080fd5b8286015b848110156128b6578051835291830191830161289f565b509695505050505050565b600082601f8301126128d257600080fd5b815160206128e261287783612832565b82815260059290921b8401810191818101908684111561290157600080fd5b8286015b848110156128b65780516004811061291d5760008081fd5b8352918301918301612905565b60008060006060848603121561293f57600080fd5b835167ffffffffffffffff8082111561295757600080fd5b818601915086601f83011261296b57600080fd5b8151602061297b61287783612832565b82815260059290921b8401810191818101908a84111561299a57600080fd5b948201945b838610156129c15785516129b281612538565b8252948201949082019061299f565b918901519197509093505050808211156129da57600080fd5b6129e687838801612856565b935060408601519150808211156129fc57600080fd5b50612a09868287016128c1565b9150509250925092565b600060208284031215612a2557600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561061057610610612a5b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600060208284031215612ade57600080fd5b815180151581146120fe57600080fd5b600060208284031215612b0057600080fd5b81516120fe81612538565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612b3c57612b3c612a5b565b506001019056fea164736f6c6343000814000a diff --git a/contracts/celo/compiled/update.sh b/contracts/celo/compiled/update.sh index dbc303e1df..4a468d0d72 100755 --- a/contracts/celo/compiled/update.sh +++ b/contracts/celo/compiled/update.sh @@ -5,7 +5,7 @@ CONTRACTS_DIR=${CELO_OPTIMISM_REPO:-~/optimism}/packages/contracts-bedrock (cd "$CONTRACTS_DIR" && forge build) -for contract in GoldToken Registry +for contract in GoldToken CeloRegistry SortedOracles FeeCurrencyWhitelist FeeCurrency Proxy AddressSortedLinkedListWithMedian do contract_json="$CONTRACTS_DIR/forge-artifacts/$contract.sol/$contract.json" jq .abi "$contract_json" > "$SCRIPT_DIR/$contract.abi" From 33887b9749387821df45991f2462db623ae4a400 Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Wed, 27 Sep 2023 18:06:21 +0200 Subject: [PATCH 2/5] Move block context modification to separate file Celo specific changes should be in separate files from the upstream code wherever possible. Also check for Cel2 flag. --- core/celo_evm.go | 31 +++++++++++++++++++++++++++++++ core/evm.go | 23 +++++------------------ 2 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 core/celo_evm.go diff --git a/core/celo_evm.go b/core/celo_evm.go new file mode 100644 index 0000000000..797c86cabf --- /dev/null +++ b/core/celo_evm.go @@ -0,0 +1,31 @@ +package core + +import ( + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/contracts/celo/abigen" + contracts_config "github.com/ethereum/go-ethereum/contracts/config" + "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" +) + +func setCeloFieldsInBlockContext(blockContext *vm.BlockContext, header *types.Header, config *params.ChainConfig, statedb *state.StateDB) { + if !config.IsCel2(header.Time) { + return + } + + stateCopy := statedb.Copy() + caller := &CeloBackend{config, stateCopy} + + // Set goldTokenAddress + registry, err := abigen.NewRegistryCaller(contracts_config.RegistrySmartContractAddress, caller) + if err != nil { + log.Error("Failed to access registry!", "err", err) + } + blockContext.GoldTokenAddress, err = registry.GetAddressForOrDie(&bind.CallOpts{}, contracts_config.GoldTokenRegistryId) + if err != nil { + log.Error("Failed to get address for GoldToken!", "err", err) + } +} diff --git a/core/evm.go b/core/evm.go index 7ab66724a7..8e0128ab04 100644 --- a/core/evm.go +++ b/core/evm.go @@ -19,15 +19,11 @@ package core import ( "math/big" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" - "github.com/ethereum/go-ethereum/contracts/celo/abigen" - contracts_config "github.com/ethereum/go-ethereum/contracts/config" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" ) @@ -62,18 +58,7 @@ func NewEVMBlockContext(header *types.Header, chain ChainContext, author *common random = &header.MixDigest } - // Set goldTokenAddress - caller := &CeloBackend{config, statedb.Copy()} - registry, err := abigen.NewRegistryCaller(contracts_config.RegistrySmartContractAddress, caller) - if err != nil { - log.Error("Failed to access registry!", "err", err) - } - goldTokenAddress, err := registry.GetAddressForOrDie(&bind.CallOpts{}, contracts_config.GoldTokenRegistryId) - if err != nil { - log.Error("Failed to get address for GoldToken!", "err", err) - } - - return vm.BlockContext{ + blockContext := vm.BlockContext{ CanTransfer: CanTransfer, Transfer: Transfer, GetHash: GetHashFn(header, chain), @@ -86,9 +71,11 @@ func NewEVMBlockContext(header *types.Header, chain ChainContext, author *common Random: random, ExcessBlobGas: header.ExcessBlobGas, L1CostFunc: types.NewL1CostFunc(config, statedb), - // Celo specific parameters - GoldTokenAddress: goldTokenAddress, } + + setCeloFieldsInBlockContext(&blockContext, header, config, statedb) + + return blockContext } // NewEVMTxContext creates a new transaction context for a single transaction. From 3e0916dd04db804936b8c85fbc49aed47f77173d Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Wed, 11 Oct 2023 14:32:48 +0200 Subject: [PATCH 3/5] Add fee currency exchange rates to BlockContext Closes https://github.com/celo-org/optimism/issues/58 --- contracts/config/registry_ids.go | 4 +-- core/celo_evm.go | 50 ++++++++++++++++++++++++++++++++ core/vm/evm.go | 1 + 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/contracts/config/registry_ids.go b/contracts/config/registry_ids.go index be261a32e7..059f087350 100644 --- a/contracts/config/registry_ids.go +++ b/contracts/config/registry_ids.go @@ -14,7 +14,7 @@ var ( // BlockchainParametersRegistryId = makeRegistryId("BlockchainParameters") // ElectionRegistryId = makeRegistryId("Election") // EpochRewardsRegistryId = makeRegistryId("EpochRewards") - // FeeCurrencyWhitelistRegistryId = makeRegistryId("FeeCurrencyWhitelist") + FeeCurrencyWhitelistRegistryId = makeRegistryId("FeeCurrencyWhitelist") // FreezerRegistryId = makeRegistryId("Freezer") // GasPriceMinimumRegistryId = makeRegistryId("GasPriceMinimum") GoldTokenRegistryId = makeRegistryId("GoldToken") @@ -22,7 +22,7 @@ var ( // LockedGoldRegistryId = makeRegistryId("LockedGold") // RandomRegistryId = makeRegistryId("Random") // ReserveRegistryId = makeRegistryId("Reserve") - // SortedOraclesRegistryId = makeRegistryId("SortedOracles") + SortedOraclesRegistryId = makeRegistryId("SortedOracles") // StableTokenRegistryId = makeRegistryId("StableToken") // ValidatorsRegistryId = makeRegistryId("Validators") // FeeHandlerId = makeRegistryId("FeeHandler") diff --git a/core/celo_evm.go b/core/celo_evm.go index 797c86cabf..3eb18c8ce8 100644 --- a/core/celo_evm.go +++ b/core/celo_evm.go @@ -1,7 +1,11 @@ package core import ( + "fmt" + "math/big" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/contracts/celo/abigen" contracts_config "github.com/ethereum/go-ethereum/contracts/config" "github.com/ethereum/go-ethereum/core/state" @@ -11,6 +15,46 @@ import ( "github.com/ethereum/go-ethereum/params" ) +// Returns the exchange rates for all gas currencies from CELO +func getExchangeRates(caller *CeloBackend, registry *abigen.RegistryCaller) (map[common.Address]*big.Rat, error) { + exchangeRates := map[common.Address]*big.Rat{} + whitelistAddress, err := registry.GetAddressForOrDie(&bind.CallOpts{}, contracts_config.FeeCurrencyWhitelistRegistryId) + if err != nil { + return exchangeRates, fmt.Errorf("Failed to get address for FeeCurrencyWhitelist: %w", err) + } + whitelist, err := abigen.NewFeeCurrencyWhitelistCaller(whitelistAddress, caller) + if err != nil { + return exchangeRates, fmt.Errorf("Failed to access FeeCurrencyWhitelist: %w", err) + } + oracleAddress, err := registry.GetAddressForOrDie(&bind.CallOpts{}, contracts_config.SortedOraclesRegistryId) + if err != nil { + return exchangeRates, fmt.Errorf("Failed to get address for SortedOracle: %w", err) + } + oracle, err := abigen.NewSortedOraclesCaller(oracleAddress, caller) + if err != nil { + return exchangeRates, fmt.Errorf("Failed to access SortedOracle: %w", err) + } + + whitelistedTokens, err := whitelist.GetWhitelist(&bind.CallOpts{}) + if err != nil { + return exchangeRates, fmt.Errorf("Failed to get whitelisted tokens: %w", err) + } + for _, tokenAddress := range whitelistedTokens { + numerator, denominator, err := oracle.MedianRate(&bind.CallOpts{}, tokenAddress) + if err != nil { + log.Error("Failed to get medianRate for gas currency!", "err", err, "tokenAddress", tokenAddress) + continue + } + if denominator.Sign() == 0 { + log.Error("Bad exchange rate for fee currency", "tokenAddress", tokenAddress, "numerator", numerator, "denominator", denominator) + continue + } + exchangeRates[tokenAddress] = big.NewRat(numerator.Int64(), denominator.Int64()) + } + + return exchangeRates, nil +} + func setCeloFieldsInBlockContext(blockContext *vm.BlockContext, header *types.Header, config *params.ChainConfig, statedb *state.StateDB) { if !config.IsCel2(header.Time) { return @@ -28,4 +72,10 @@ func setCeloFieldsInBlockContext(blockContext *vm.BlockContext, header *types.He if err != nil { log.Error("Failed to get address for GoldToken!", "err", err) } + + // Add fee currency exchange rates + blockContext.ExchangeRates, err = getExchangeRates(caller, registry) + if err != nil { + log.Error("Error fetching exchange rates!", "err", err) + } } diff --git a/core/vm/evm.go b/core/vm/evm.go index 221745870f..e8fe2e3959 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -94,6 +94,7 @@ type BlockContext struct { // Celo specific information GoldTokenAddress common.Address + ExchangeRates map[common.Address]*big.Rat } // TxContext provides the EVM with information about a transaction. From f4158d1b48885f9cf2c058f12fb4bba3805957ac Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Wed, 11 Oct 2023 14:33:48 +0200 Subject: [PATCH 4/5] Initialize new contracts in dev mode genesis --- core/celo_genesis.go | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/core/celo_genesis.go b/core/celo_genesis.go index 19096cde23..87a1f68200 100644 --- a/core/celo_genesis.go +++ b/core/celo_genesis.go @@ -1,6 +1,7 @@ package core import ( + "bytes" "encoding/hex" "fmt" "math/big" @@ -26,6 +27,11 @@ func DecodeHex(hexbytes []byte) ([]byte, error) { return bytes, nil } +// Calculate address in evm mapping: keccak(key ++ mapping_slot) +func CalcMapAddr(slot common.Hash, key common.Hash) common.Hash { + return crypto.Keccak256Hash(append(key.Bytes(), slot.Bytes()...)) +} + var DevPrivateKey, _ = crypto.HexToECDSA("2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5") var DevAddr = common.BytesToAddress(DevAddr32.Bytes()) var DevAddr32 = common.HexToHash("0x42cf1bbc38BaAA3c4898ce8790e21eD2738c6A4a") @@ -37,6 +43,7 @@ func celoGenesisAccounts() map[common.Address]GenesisAccount { proxy_implementation_slot = common.HexToHash("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc") ) + // Initialize Bytecodes registryBytecode, err := DecodeHex(contracts.RegistryBytecodeRaw) if err != nil { panic(err) @@ -49,7 +56,27 @@ func celoGenesisAccounts() map[common.Address]GenesisAccount { if err != nil { panic(err) } + sortedOraclesBytecodeLinked := bytes.Replace(contracts.SortedOraclesBytecodeRaw, []byte("__$c0b499b413513d0c67e2a6a17d90846cb3$__"), []byte("000000000000000000000000000000000000ce17"), -1) + sortedOraclesBytecode, err := DecodeHex(sortedOraclesBytecodeLinked) + if err != nil { + panic(err) + } + feeCurrencyWhitelistBytecode, err := DecodeHex(contracts.FeeCurrencyWhitelistBytecodeRaw) + if err != nil { + panic(err) + } + feeCurrencyBytecode, err := DecodeHex(contracts.FeeCurrencyBytecodeRaw) + if err != nil { + panic(err) + } + addressSortedLinkedListWithMedian, err := DecodeHex(contracts.AddressSortedLinkedListWithMedianBytecodeRaw) + if err != nil { + panic(err) + } + devBalance, ok := new(big.Int).SetString("100000000000000000000", 10) + var devBalance32 common.Hash + devBalance.FillBytes(devBalance32[:]) if !ok { panic("Could not set devBalance!") } @@ -79,6 +106,33 @@ func celoGenesisAccounts() map[common.Address]GenesisAccount { Code: goldTokenBytecode, Balance: big.NewInt(0), }, + common.HexToAddress("0xce14"): { + Code: feeCurrencyWhitelistBytecode, + Balance: big.NewInt(0), + Storage: map[common.Hash]common.Hash{ + common.HexToHash("0x1"): common.HexToHash("0x1"), // array length 1 + crypto.Keccak256Hash(common.HexToHash("0x1").Bytes()): common.HexToHash("0xce16"), // FeeCurrency + }, + }, + common.HexToAddress("0xce15"): { + Code: sortedOraclesBytecode, + Storage: map[common.Hash]common.Hash{ + common.HexToHash("0x0"): DevAddr32, // _owner + }, + Balance: big.NewInt(0), + }, + common.HexToAddress("0xce16"): { + Code: feeCurrencyBytecode, + Balance: big.NewInt(0), + Storage: map[common.Hash]common.Hash{ + CalcMapAddr(common.HexToHash("0x0"), DevAddr32): devBalance32, // _balances[DevAddr] + common.HexToHash("0x2"): devBalance32, // _totalSupply + }, + }, + common.HexToAddress("0xce17"): { + Code: addressSortedLinkedListWithMedian, + Balance: big.NewInt(0), + }, DevAddr: { Balance: devBalance, }, From 13cec5b446fb5e3822ce4b83f8d9945b7b0fd2ee Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Wed, 11 Oct 2023 14:34:52 +0200 Subject: [PATCH 5/5] Fee currency e2e test stub --- e2e_test/run_all_tests.sh | 5 +++-- e2e_test/shared.sh | 6 ++++++ e2e_test/test_fee_currency.sh | 21 +++++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100755 e2e_test/test_fee_currency.sh diff --git a/e2e_test/run_all_tests.sh b/e2e_test/run_all_tests.sh index 59413a8f1d..77961f59c4 100755 --- a/e2e_test/run_all_tests.sh +++ b/e2e_test/run_all_tests.sh @@ -2,6 +2,7 @@ set -eo pipefail SCRIPT_DIR=$(readlink -f "$(dirname "$0")") +TEST_GLOB=$1 ## Start geth cd "$SCRIPT_DIR/.." || exit 1 @@ -24,7 +25,7 @@ echo Geth ready, start tests failures=0 tests=0 cd "$SCRIPT_DIR" || exit 1 -for f in test_* +for f in test_*"$TEST_GLOB"* do echo -e "\nRun $f" if "./$f" @@ -45,7 +46,7 @@ echo if [[ $failures -eq 0 ]] then tput setaf 2 || true - echo All tests succeeded! + echo All $tests tests succeeded! else tput setaf 1 || true echo $failures/$tests failed. diff --git a/e2e_test/shared.sh b/e2e_test/shared.sh index d8c7daf9be..e931a8b345 100644 --- a/e2e_test/shared.sh +++ b/e2e_test/shared.sh @@ -7,3 +7,9 @@ ACC_ADDR=0x42cf1bbc38BaAA3c4898ce8790e21eD2738c6A4a ACC_PRIVKEY=0x2771aff413cac48d9f8c114fabddd9195a2129f3c2c436caa07e27bb7f58ead5 REGISTRY_ADDR=0x000000000000000000000000000000000000ce10 TOKEN_ADDR=0x000000000000000000000000000000000000ce12 +FEE_CURRENCY_WHITELIST_ADDR=0x000000000000000000000000000000000000ce14 +SORTED_ORACLES_ADDR=0x000000000000000000000000000000000000ce15 +FEE_CURRENCY=0x000000000000000000000000000000000000ce16 + +FIXIDITY_1=1000000000000000000000000 +ZERO_ADDRESS=0x0000000000000000000000000000000000000000 diff --git a/e2e_test/test_fee_currency.sh b/e2e_test/test_fee_currency.sh new file mode 100755 index 0000000000..3645e88d5a --- /dev/null +++ b/e2e_test/test_fee_currency.sh @@ -0,0 +1,21 @@ +#!/bin/bash +#shellcheck disable=SC2086 +set -eo pipefail +set -x + +source shared.sh + +# Register fee currency whitelist and sorted oracles +cast send --private-key $ACC_PRIVKEY $REGISTRY_ADDR 'function setAddressFor(string calldata identifier, address addr) external' FeeCurrencyWhitelist $FEE_CURRENCY_WHITELIST_ADDR +cast send --private-key $ACC_PRIVKEY $REGISTRY_ADDR 'function setAddressFor(string calldata identifier, address addr) external' SortedOracles $SORTED_ORACLES_ADDR +# Add our account as oracle and submit value +cast send --private-key $ACC_PRIVKEY $SORTED_ORACLES_ADDR 'function addOracle(address token, address oracleAddress) external' $FEE_CURRENCY $ACC_ADDR +cast send --private-key $ACC_PRIVKEY $SORTED_ORACLES_ADDR 'function report(address token, uint256 value, address lesserKey, address greaterKey) external' $FEE_CURRENCY $FIXIDITY_1 $ZERO_ADDRESS $ZERO_ADDRESS + +# Debug suggestions: +# cast call $FEE_CURRENCY_WHITELIST_ADDR 'function getWhitelist() external view returns (address[] memory)' +# cast logs 'event OracleReported(address indexed token, address indexed oracle, uint256 timestamp, uint256 value)' +# cast call $SORTED_ORACLES_ADDR 'function medianRate(address token) external view returns (uint256, uint256)' $FEE_CURRENCY + +# Send token and check balance (TODO: add fee currency) +cast send --private-key $ACC_PRIVKEY --value 10 0x000000000000000000000000000000000000dEaD