diff --git a/contracts/erc1967proxy/ERC1967Proxy.abi b/contracts/erc1967proxy/ERC1967Proxy.abi new file mode 100644 index 0000000..eb07bad --- /dev/null +++ b/contracts/erc1967proxy/ERC1967Proxy.abi @@ -0,0 +1,67 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "implementation", + "type": "address", + "internalType": "address" + }, + { + "name": "_data", + "type": "bytes", + "internalType": "bytes" + } + ], + "stateMutability": "payable" + }, + { + "type": "fallback", + "stateMutability": "payable" + }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC1967InvalidImplementation", + "inputs": [ + { + "name": "implementation", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC1967NonPayable", + "inputs": [] + }, + { + "type": "error", + "name": "FailedCall", + "inputs": [] + } +] diff --git a/contracts/erc1967proxy/ERC1967Proxy.bin b/contracts/erc1967proxy/ERC1967Proxy.bin new file mode 100644 index 0000000..05ca565 --- /dev/null +++ b/contracts/erc1967proxy/ERC1967Proxy.bin @@ -0,0 +1 @@ +608060405261028c8038038061001481610158565b9283398101604082820312610140578151916001600160a01b03831690818403610140576020810151906001600160401b038211610140570182601f82011215610140578051906001600160401b0382116101445761007c601f8301601f1916602001610158565b938285526020838301011161014057815f9260208093018387015e84010152823b1561012e577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a2805115610117576101079161017d565b505b6040516082908161020a8239f35b505034156101095763b398979f60e01b5f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b6040519190601f01601f191682016001600160401b0381118382101761014457604052565b905f8091602081519101845af480806101f6575b156101b15750506040513d81523d5f602083013e60203d82010160405290565b156101d657639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b3d156101e7576040513d5f823e3d90fd5b63d6bda27560e01b5f5260045ffd5b503d1515806101915750813b151561019156fe60806040527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545f9081906001600160a01b0316368280378136915af43d5f803e156048573d5ff35b3d5ffdfea264697066735822122014e90b4a0575eac550ea455374a3550d1857b2a03810b58b0a1ba6c7cc0039cb64736f6c63430008220033 diff --git a/contracts/erc1967proxy/erc1967proxy.go b/contracts/erc1967proxy/erc1967proxy.go new file mode 100644 index 0000000..f8ed5c6 --- /dev/null +++ b/contracts/erc1967proxy/erc1967proxy.go @@ -0,0 +1,368 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package erc1967proxy + +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 +) + +// ERC1967ProxyMetaData contains all meta data concerning the ERC1967Proxy contract. +var ERC1967ProxyMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"payable\"},{\"type\":\"fallback\",\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedCall\",\"inputs\":[]}]", + Bin: "0x608060405261028c8038038061001481610158565b9283398101604082820312610140578151916001600160a01b03831690818403610140576020810151906001600160401b038211610140570182601f82011215610140578051906001600160401b0382116101445761007c601f8301601f1916602001610158565b938285526020838301011161014057815f9260208093018387015e84010152823b1561012e577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a2805115610117576101079161017d565b505b6040516082908161020a8239f35b505034156101095763b398979f60e01b5f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b6040519190601f01601f191682016001600160401b0381118382101761014457604052565b905f8091602081519101845af480806101f6575b156101b15750506040513d81523d5f602083013e60203d82010160405290565b156101d657639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b3d156101e7576040513d5f823e3d90fd5b63d6bda27560e01b5f5260045ffd5b503d1515806101915750813b151561019156fe60806040527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545f9081906001600160a01b0316368280378136915af43d5f803e156048573d5ff35b3d5ffdfea264697066735822122014e90b4a0575eac550ea455374a3550d1857b2a03810b58b0a1ba6c7cc0039cb64736f6c63430008220033", +} + +// ERC1967ProxyABI is the input ABI used to generate the binding from. +// Deprecated: Use ERC1967ProxyMetaData.ABI instead. +var ERC1967ProxyABI = ERC1967ProxyMetaData.ABI + +// ERC1967ProxyBin is the compiled bytecode used for deploying new contracts. +// Deprecated: Use ERC1967ProxyMetaData.Bin instead. +var ERC1967ProxyBin = ERC1967ProxyMetaData.Bin + +// DeployERC1967Proxy deploys a new Ethereum contract, binding an instance of ERC1967Proxy to it. +func DeployERC1967Proxy(auth *bind.TransactOpts, backend bind.ContractBackend, implementation common.Address, _data []byte) (common.Address, *types.Transaction, *ERC1967Proxy, error) { + parsed, err := ERC1967ProxyMetaData.GetAbi() + if err != nil { + return common.Address{}, nil, nil, err + } + if parsed == nil { + return common.Address{}, nil, nil, errors.New("GetABI returned nil") + } + + address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(ERC1967ProxyBin), backend, implementation, _data) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, tx, &ERC1967Proxy{ERC1967ProxyCaller: ERC1967ProxyCaller{contract: contract}, ERC1967ProxyTransactor: ERC1967ProxyTransactor{contract: contract}, ERC1967ProxyFilterer: ERC1967ProxyFilterer{contract: contract}}, nil +} + +// ERC1967Proxy is an auto generated Go binding around an Ethereum contract. +type ERC1967Proxy struct { + ERC1967ProxyCaller // Read-only binding to the contract + ERC1967ProxyTransactor // Write-only binding to the contract + ERC1967ProxyFilterer // Log filterer for contract events +} + +// ERC1967ProxyCaller is an auto generated read-only Go binding around an Ethereum contract. +type ERC1967ProxyCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC1967ProxyTransactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC1967ProxyTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC1967ProxyFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC1967ProxyFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC1967ProxySession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC1967ProxySession struct { + Contract *ERC1967Proxy // 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 +} + +// ERC1967ProxyCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC1967ProxyCallerSession struct { + Contract *ERC1967ProxyCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC1967ProxyTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC1967ProxyTransactorSession struct { + Contract *ERC1967ProxyTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC1967ProxyRaw is an auto generated low-level Go binding around an Ethereum contract. +type ERC1967ProxyRaw struct { + Contract *ERC1967Proxy // Generic contract binding to access the raw methods on +} + +// ERC1967ProxyCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC1967ProxyCallerRaw struct { + Contract *ERC1967ProxyCaller // Generic read-only contract binding to access the raw methods on +} + +// ERC1967ProxyTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC1967ProxyTransactorRaw struct { + Contract *ERC1967ProxyTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC1967Proxy creates a new instance of ERC1967Proxy, bound to a specific deployed contract. +func NewERC1967Proxy(address common.Address, backend bind.ContractBackend) (*ERC1967Proxy, error) { + contract, err := bindERC1967Proxy(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC1967Proxy{ERC1967ProxyCaller: ERC1967ProxyCaller{contract: contract}, ERC1967ProxyTransactor: ERC1967ProxyTransactor{contract: contract}, ERC1967ProxyFilterer: ERC1967ProxyFilterer{contract: contract}}, nil +} + +// NewERC1967ProxyCaller creates a new read-only instance of ERC1967Proxy, bound to a specific deployed contract. +func NewERC1967ProxyCaller(address common.Address, caller bind.ContractCaller) (*ERC1967ProxyCaller, error) { + contract, err := bindERC1967Proxy(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC1967ProxyCaller{contract: contract}, nil +} + +// NewERC1967ProxyTransactor creates a new write-only instance of ERC1967Proxy, bound to a specific deployed contract. +func NewERC1967ProxyTransactor(address common.Address, transactor bind.ContractTransactor) (*ERC1967ProxyTransactor, error) { + contract, err := bindERC1967Proxy(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC1967ProxyTransactor{contract: contract}, nil +} + +// NewERC1967ProxyFilterer creates a new log filterer instance of ERC1967Proxy, bound to a specific deployed contract. +func NewERC1967ProxyFilterer(address common.Address, filterer bind.ContractFilterer) (*ERC1967ProxyFilterer, error) { + contract, err := bindERC1967Proxy(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC1967ProxyFilterer{contract: contract}, nil +} + +// bindERC1967Proxy binds a generic wrapper to an already deployed contract. +func bindERC1967Proxy(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := ERC1967ProxyMetaData.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 (_ERC1967Proxy *ERC1967ProxyRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC1967Proxy.Contract.ERC1967ProxyCaller.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 (_ERC1967Proxy *ERC1967ProxyRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC1967Proxy.Contract.ERC1967ProxyTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC1967Proxy *ERC1967ProxyRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC1967Proxy.Contract.ERC1967ProxyTransactor.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 (_ERC1967Proxy *ERC1967ProxyCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC1967Proxy.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 (_ERC1967Proxy *ERC1967ProxyTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC1967Proxy.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC1967Proxy *ERC1967ProxyTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC1967Proxy.Contract.contract.Transact(opts, method, params...) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_ERC1967Proxy *ERC1967ProxyTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { + return _ERC1967Proxy.contract.RawTransact(opts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_ERC1967Proxy *ERC1967ProxySession) Fallback(calldata []byte) (*types.Transaction, error) { + return _ERC1967Proxy.Contract.Fallback(&_ERC1967Proxy.TransactOpts, calldata) +} + +// Fallback is a paid mutator transaction binding the contract fallback function. +// +// Solidity: fallback() payable returns() +func (_ERC1967Proxy *ERC1967ProxyTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { + return _ERC1967Proxy.Contract.Fallback(&_ERC1967Proxy.TransactOpts, calldata) +} + +// ERC1967ProxyUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the ERC1967Proxy contract. +type ERC1967ProxyUpgradedIterator struct { + Event *ERC1967ProxyUpgraded // 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 *ERC1967ProxyUpgradedIterator) 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(ERC1967ProxyUpgraded) + 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(ERC1967ProxyUpgraded) + 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 *ERC1967ProxyUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC1967ProxyUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC1967ProxyUpgraded represents a Upgraded event raised by the ERC1967Proxy contract. +type ERC1967ProxyUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_ERC1967Proxy *ERC1967ProxyFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*ERC1967ProxyUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _ERC1967Proxy.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &ERC1967ProxyUpgradedIterator{contract: _ERC1967Proxy.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_ERC1967Proxy *ERC1967ProxyFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *ERC1967ProxyUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _ERC1967Proxy.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(ERC1967ProxyUpgraded) + if err := _ERC1967Proxy.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_ERC1967Proxy *ERC1967ProxyFilterer) ParseUpgraded(log types.Log) (*ERC1967ProxyUpgraded, error) { + event := new(ERC1967ProxyUpgraded) + if err := _ERC1967Proxy.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/contracts/valuestore/ValueStore.abi b/contracts/valuestore/ValueStore.abi index 7dac1df..d184b62 100644 --- a/contracts/valuestore/ValueStore.abi +++ b/contracts/valuestore/ValueStore.abi @@ -4,6 +4,32 @@ "inputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "MAX_TIMESTAMP_GAP", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "UPGRADE_INTERFACE_VERSION", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "getValue", @@ -43,6 +69,19 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "initialOwner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "owner", @@ -56,6 +95,26 @@ ], "stateMutability": "view" }, + { + "type": "function", + "name": "proxiableUUID", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "renounceOwnership", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, { "type": "function", "name": "setMultipleValues", @@ -122,11 +181,35 @@ "name": "denominator", "type": "uint256", "internalType": "uint256" + }, + { + "name": "timestamp", + "type": "uint256", + "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "supportsInterface", + "inputs": [ + { + "name": "interfaceId", + "type": "bytes4", + "internalType": "bytes4" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, { "type": "function", "name": "transferOwnership", @@ -140,6 +223,37 @@ "outputs": [], "stateMutability": "nonpayable" }, + { + "type": "function", + "name": "upgradeToAndCall", + "inputs": [ + { + "name": "newImplementation", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + } + ], + "outputs": [], + "stateMutability": "payable" + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, { "type": "event", "name": "OwnershipTransferred", @@ -159,6 +273,19 @@ ], "anonymous": false }, + { + "type": "event", + "name": "Upgraded", + "inputs": [ + { + "name": "implementation", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, { "type": "event", "name": "ValueUpdated", @@ -166,7 +293,7 @@ { "name": "key", "type": "string", - "indexed": false, + "indexed": true, "internalType": "string" }, { @@ -196,10 +323,185 @@ { "name": "timestamp", "type": "uint256", - "indexed": false, + "indexed": true, "internalType": "uint256" } ], "anonymous": false + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "DivisionByZero", + "inputs": [] + }, + { + "type": "error", + "name": "DivisionByZeroInBatch", + "inputs": [ + { + "name": "index", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "ERC1967InvalidImplementation", + "inputs": [ + { + "name": "implementation", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "ERC1967NonPayable", + "inputs": [] + }, + { + "type": "error", + "name": "FailedCall", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidArrayLengths", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidInitialization", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidKey", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidKeyInBatch", + "inputs": [ + { + "name": "index", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "NoDataForKey", + "inputs": [] + }, + { + "type": "error", + "name": "NotInitializing", + "inputs": [] + }, + { + "type": "error", + "name": "OwnableInvalidOwner", + "inputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "OwnableUnauthorizedAccount", + "inputs": [ + { + "name": "account", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "TimestampNotIncreasing", + "inputs": [ + { + "name": "newTimestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "existingTimestamp", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "TimestampTooFarInFuture", + "inputs": [ + { + "name": "timestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "blockTime", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "TimestampTooFarInPast", + "inputs": [ + { + "name": "timestamp", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "blockTime", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "UUPSUnauthorizedCallContext", + "inputs": [] + }, + { + "type": "error", + "name": "UUPSUnsupportedProxiableUUID", + "inputs": [ + { + "name": "slot", + "type": "bytes32", + "internalType": "bytes32" + } + ] + }, + { + "type": "error", + "name": "ZeroAddress", + "inputs": [] } ] diff --git a/contracts/valuestore/ValueStore.bin b/contracts/valuestore/ValueStore.bin index 965c5e7..1bb8b7d 100644 --- a/contracts/valuestore/ValueStore.bin +++ b/contracts/valuestore/ValueStore.bin @@ -1 +1 @@ -6080604052348015600e575f5ffd5b50335f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36110bf806100b55f395ff3fe608060405234801561000f575f5ffd5b5060043610610055575f3560e01c80634a7edea8146100595780636080b54f146100755780638da5cb5b14610091578063960384a0146100af578063f2fde38b146100e3575b5f5ffd5b610073600480360381019061006e9190610951565b6100ff565b005b61008f600480360381019061008a9190610af0565b61047c565b005b61009961061c565b6040516100a69190610bc5565b60405180910390f35b6100c960048036038101906100c49190610bde565b610640565b6040516100da959493929190610c38565b60405180910390f35b6100fd60048036038101906100f89190610cb3565b6106db565b005b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461018d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018490610d38565b60405180910390fd5b878790508a8a90501480156101a75750858590508a8a9050145b80156101b85750838390508a8a9050145b80156101c95750818190508a8a9050145b610208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ff90610da0565b60405180910390fd5b5f5f90505b8a8a905081101561046f575f85858381811061022c5761022b610dbe565b5b90506020020135148061025857505f83838381811061024e5761024d610dbe565b5b9050602002013514155b610297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028e90610e35565b60405180910390fd5b6040518060a001604052808a8a848181106102b5576102b4610dbe565b5b9050602002013581526020018888848181106102d4576102d3610dbe565b5b9050602002013581526020018686848181106102f3576102f2610dbe565b5b90506020020135815260200184848481811061031257610311610dbe565b5b9050602002013581526020014281525060018c8c8481811061033757610336610dbe565b5b90506020028101906103499190610e5f565b604051610357929190610efd565b90815260200160405180910390205f820151815f0155602082015181600101556040820151816002015560608201518160030155608082015181600401559050507f5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d8b8b838181106103cc576103cb610dbe565b5b90506020028101906103de9190610e5f565b8b8b858181106103f1576103f0610dbe565b5b905060200201358a8a8681811061040b5761040a610dbe565b5b9050602002013589898781811061042557610424610dbe565b5b9050602002013588888881811061043f5761043e610dbe565b5b905060200201354260405161045a9796959493929190610f51565b60405180910390a1808060010191505061020d565b5050505050505050505050565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461050a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050190610d38565b60405180910390fd5b5f82148061051857505f8114155b610557576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054e90610e35565b60405180910390fd5b6040518060a001604052808581526020018481526020018381526020018281526020014281525060018787604051610590929190610efd565b90815260200160405180910390205f820151815f0155602082015181600101556040820151816002015560608201518160030155608082015181600401559050507f5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d8686868686864260405161060c9796959493929190610f51565b60405180910390a1505050505050565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5f5f5f5f5f60018888604051610658929190610efd565b908152602001604051809103902090505f8160040154036106ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a590611003565b60405180910390fd5b805f0154816001015482600201548360030154846004015495509550955095509550509295509295909350565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610769576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076090610d38565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036107d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ce9061106b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff165f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3805f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f8401126108bc576108bb61089b565b5b8235905067ffffffffffffffff8111156108d9576108d861089f565b5b6020830191508360208202830111156108f5576108f46108a3565b5b9250929050565b5f5f83601f8401126109115761091061089b565b5b8235905067ffffffffffffffff81111561092e5761092d61089f565b5b60208301915083602082028301111561094a576109496108a3565b5b9250929050565b5f5f5f5f5f5f5f5f5f5f60a08b8d03121561096f5761096e610893565b5b5f8b013567ffffffffffffffff81111561098c5761098b610897565b5b6109988d828e016108a7565b9a509a505060208b013567ffffffffffffffff8111156109bb576109ba610897565b5b6109c78d828e016108fc565b985098505060408b013567ffffffffffffffff8111156109ea576109e9610897565b5b6109f68d828e016108fc565b965096505060608b013567ffffffffffffffff811115610a1957610a18610897565b5b610a258d828e016108fc565b945094505060808b013567ffffffffffffffff811115610a4857610a47610897565b5b610a548d828e016108fc565b92509250509295989b9194979a5092959850565b5f5f83601f840112610a7d57610a7c61089b565b5b8235905067ffffffffffffffff811115610a9a57610a9961089f565b5b602083019150836001820283011115610ab657610ab56108a3565b5b9250929050565b5f819050919050565b610acf81610abd565b8114610ad9575f5ffd5b50565b5f81359050610aea81610ac6565b92915050565b5f5f5f5f5f5f60a08789031215610b0a57610b09610893565b5b5f87013567ffffffffffffffff811115610b2757610b26610897565b5b610b3389828a01610a68565b96509650506020610b4689828a01610adc565b9450506040610b5789828a01610adc565b9350506060610b6889828a01610adc565b9250506080610b7989828a01610adc565b9150509295509295509295565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610baf82610b86565b9050919050565b610bbf81610ba5565b82525050565b5f602082019050610bd85f830184610bb6565b92915050565b5f5f60208385031215610bf457610bf3610893565b5b5f83013567ffffffffffffffff811115610c1157610c10610897565b5b610c1d85828601610a68565b92509250509250929050565b610c3281610abd565b82525050565b5f60a082019050610c4b5f830188610c29565b610c586020830187610c29565b610c656040830186610c29565b610c726060830185610c29565b610c7f6080830184610c29565b9695505050505050565b610c9281610ba5565b8114610c9c575f5ffd5b50565b5f81359050610cad81610c89565b92915050565b5f60208284031215610cc857610cc7610893565b5b5f610cd584828501610c9f565b91505092915050565b5f82825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e65720000000000000000005f82015250565b5f610d22601783610cde565b9150610d2d82610cee565b602082019050919050565b5f6020820190508181035f830152610d4f81610d16565b9050919050565b7f4172726179206c656e67746873206d757374206d6174636800000000000000005f82015250565b5f610d8a601883610cde565b9150610d9582610d56565b602082019050919050565b5f6020820190508181035f830152610db781610d7e565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f6469766973696f6e206279207a65726f000000000000000000000000000000005f82015250565b5f610e1f601083610cde565b9150610e2a82610deb565b602082019050919050565b5f6020820190508181035f830152610e4c81610e13565b9050919050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83356001602003843603038112610e7b57610e7a610e53565b5b80840192508235915067ffffffffffffffff821115610e9d57610e9c610e57565b5b602083019250600182023603831315610eb957610eb8610e5b565b5b509250929050565b5f81905092915050565b828183375f83830152505050565b5f610ee48385610ec1565b9350610ef1838584610ecb565b82840190509392505050565b5f610f09828486610ed9565b91508190509392505050565b5f601f19601f8301169050919050565b5f610f308385610cde565b9350610f3d838584610ecb565b610f4683610f15565b840190509392505050565b5f60c0820190508181035f830152610f6a81898b610f25565b9050610f796020830188610c29565b610f866040830187610c29565b610f936060830186610c29565b610fa06080830185610c29565b610fad60a0830184610c29565b98975050505050505050565b7f4e6f206461746120666f72206b657900000000000000000000000000000000005f82015250565b5f610fed600f83610cde565b9150610ff882610fb9565b602082019050919050565b5f6020820190508181035f83015261101a81610fe1565b9050919050565b7f4e6577206f776e6572206973207a65726f2061646472657373000000000000005f82015250565b5f611055601983610cde565b915061106082611021565b602082019050919050565b5f6020820190508181035f83015261108281611049565b905091905056fea264697066735822122046477468a2fe8c028640964929d9efa4e7b1c8ec32936a7b52a0b5c5c063756264736f6c634300081e0033 \ No newline at end of file +60a080604052346100c257306080525f516020610f985f395f51905f525460ff8160401c166100b3576002600160401b03196001600160401b03821601610060575b604051610ed190816100c7823960805181818161084001526108e30152f35b6001600160401b0319166001600160401b039081175f516020610f985f395f51905f525581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f80610041565b63f92ee8a960e01b5f5260045ffd5b5f80fdfe60a0806040526004361015610012575f80fd5b5f3560e01c90816301ffc9a714610a5f575080634f1ef2861461089457806352d1902d1461082e578063715018a6146107c757806372f755b2146104725780638da5cb5b1461043e578063960384a0146103aa578063ad3cb1cc1461034c578063be2e017914610330578063c4d66de814610224578063e329c28c146100cf5763f2fde38b146100a0575f80fd5b346100cb5760203660031901126100cb576100c96100bc610ab2565b6100c4610c90565b610c1f565b005b5f80fd5b346100cb5760c03660031901126100cb576004356001600160401b0381116100cb576100ff903690600401610b8d565b60243590604435606435926084359460a4359561011a610c90565b8415610215578515158061020d575b6101fe577f5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d946101f99261016789610162368585610b18565b610cc3565b60405161017381610ac8565b85815260048a60208301898152604084018c8152606085019188835260808601938452604051888882376020818a81015f815203019020955186555160018601555160028501555160038401555191015581604051928392833781015f815203902095604051948594859094939260609260808301968352602083015260408201520152565b0390a3005b6323d359a360e01b5f5260045ffd5b508015610129565b630eda9c3d60e31b5f5260045ffd5b346100cb5760203660031901126100cb5761023d610ab2565b5f516020610e7c5f395f51905f525460ff8160401c16801561031c575b61030d5768ffffffffffffffffff191668010000000000000001175f516020610e7c5f395f51905f52556001600160a01b038116156102fe576102a79061029f610d84565b6100c4610d84565b68ff0000000000000000195f516020610e7c5f395f51905f5254165f516020610e7c5f395f51905f52557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b63d92e233d60e01b5f5260045ffd5b63f92ee8a960e01b5f5260045ffd5b5060016001600160401b038216101561025a565b346100cb575f3660031901126100cb576020604051610e108152f35b346100cb575f3660031901126100cb57604080519061036b8183610af7565b600582526020820191640352e302e360dc1b83528151928391602083525180918160208501528484015e5f828201840152601f01601f19168101030190f35b346100cb5760203660031901126100cb576004356001600160401b0381116100cb576103dc6020913690600401610b8d565b919082604051938492833781015f815203019020600481015490811561042f5760a09181549160018101549060036002820154910154916040519485526020850152604084015260608301526080820152f35b6339a07f5560e11b5f5260045ffd5b346100cb575f3660031901126100cb575f516020610e3c5f395f51905f52546040516001600160a01b039091168152602090f35b346100cb5760c03660031901126100cb576004356001600160401b0381116100cb576104a2903690600401610b5d565b906024356001600160401b0381116100cb576104c2903690600401610b5d565b90608052906044356001600160401b0381116100cb576104e6903690600401610b5d565b6064929192356001600160401b0381116100cb57610508903690600401610b5d565b9190956084356001600160401b0381116100cb5761052a903690600401610b5d565b94909560a4356001600160401b0381116100cb5761054c903690600401610b5d565b979092610557610c90565b8985148015906107bd575b80156107b3575b80156107a9575b801561079f575b610790575f5b85811061058657005b610591818784610bba565b90501561077e576105a381898e610c0f565b3515158061076b575b610759578a81808a8f828f8f838f948f8f8f918f908f928b8f898d938d809a97818f9599818d81809d8f8b8f846105e4918194610bba565b926105f091928d610c0f565b359136906105fd92610b18565b9061060791610cc3565b816080519161061592610c0f565b359b61062092610c0f565b359861062b92610c0f565b359461063692610c0f565b359361064192610c0f565b35926040519461065086610ac8565b85526020850190815260408501918252606085019283526080850193845261067987878a610bba565b9081604051928392833781015f8152036020019020945185555160018501555160028401555160038301555190600401556106b392610bba565b96909b81608051916106c492610c0f565b35976106cf92610c0f565b35966106da92610c0f565b35956106e6918c610c0f565b35956106f2918d610c0f565b359581604051928392833781015f81520390209360405193849361072d93859094939260609260808301968352602083015260408201520152565b037f5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d91a360010161057d565b6379ae650760e01b5f5260045260245ffd5b50610777818a85610c0f565b35156105ac565b630b414c8760e21b5f5260045260245ffd5b63a9854bc960e01b5f5260045ffd5b5088851415610577565b5087851415610570565b5086851415610569565b5085851415610562565b346100cb575f3660031901126100cb576107df610c90565b5f516020610e3c5f395f51905f5280546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346100cb575f3660031901126100cb577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036108855760206040515f516020610e5c5f395f51905f528152f35b63703e46dd60e11b5f5260045ffd5b60403660031901126100cb576108a8610ab2565b6024356001600160401b0381116100cb57366023820112156100cb576108d8903690602481600401359101610b18565b906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115610a3d575b506108855761091b610c90565b6040516352d1902d60e01b81526001600160a01b0382169290602081600481875afa5f9181610a09575b5061095d5783634c9c8ce360e01b5f5260045260245ffd5b805f516020610e5c5f395f51905f528592036109f75750823b156109e5575f516020610e5c5f395f51905f5280546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28051156109cd576100c991610daf565b5050346109d657005b63b398979f60e01b5f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b632a87526960e21b5f5260045260245ffd5b9091506020813d602011610a35575b81610a2560209383610af7565b810103126100cb57519085610945565b3d9150610a18565b5f516020610e5c5f395f51905f52546001600160a01b0316141590508361090e565b346100cb5760203660031901126100cb576004359063ffffffff60e01b82168092036100cb576020916301ffc9a760e01b8114908115610aa1575b5015158152f35b6304b01c2560e51b14905083610a9a565b600435906001600160a01b03821682036100cb57565b60a081019081106001600160401b03821117610ae357604052565b634e487b7160e01b5f52604160045260245ffd5b90601f801991011681019081106001600160401b03821117610ae357604052565b9291926001600160401b038211610ae35760405191610b41601f8201601f191660200184610af7565b8294818452818301116100cb578281602093845f960137010152565b9181601f840112156100cb578235916001600160401b0383116100cb576020808501948460051b0101116100cb57565b9181601f840112156100cb578235916001600160401b0383116100cb57602083818601950101116100cb57565b9190811015610bfb5760051b81013590601e19813603018212156100cb5701908135916001600160401b0383116100cb5760200182360381136100cb579190565b634e487b7160e01b5f52603260045260245ffd5b9190811015610bfb5760051b0190565b6001600160a01b03168015610c7d575f516020610e3c5f395f51905f5280546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b631e4fbdf760e01b5f525f60045260245ffd5b5f516020610e3c5f395f51905f52546001600160a01b03163303610cb057565b63118cdaa760e01b5f523360045260245ffd5b610e104201804211610d59578211610d6d57610e10421180610d44575b610d2d576040518151600492602091839181908401835e81015f81520301902001549081610d0c575050565b81811115610d18575050565b631a6e512d60e31b5f5260045260245260445ffd5b5063272c289560e11b5f526004524260245260445ffd5b50610e0f194201428111610d59578210610ce0565b634e487b7160e01b5f52601160045260245ffd5b50632161dd6360e21b5f526004524260245260445ffd5b60ff5f516020610e7c5f395f51905f525460401c1615610da057565b631afcd79f60e31b5f5260045ffd5b905f8091602081519101845af48080610e28575b15610de35750506040513d81523d5f602083013e60203d82010160405290565b15610e0857639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b3d15610e19576040513d5f823e3d90fd5b63d6bda27560e01b5f5260045ffd5b503d151580610dc35750813b1515610dc356fe9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a26469706673582212206299334f0a82cdac751ef8aa1ea547ebf15ae6b8cb9615bb6fb3d8e01b4e13b464736f6c63430008220033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00 diff --git a/contracts/valuestore/ValueStore.go b/contracts/valuestore/ValueStore.go index 3bdaa8e..553156c 100644 --- a/contracts/valuestore/ValueStore.go +++ b/contracts/valuestore/ValueStore.go @@ -31,8 +31,8 @@ var ( // ValueStoreMetaData contains all meta data concerning the ValueStore contract. var ValueStoreMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"getValue\",\"inputs\":[{\"name\":\"key\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"fairValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"valueUsd\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"numerator\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"denominator\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setMultipleValues\",\"inputs\":[{\"name\":\"keys\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"fairValues\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"valueUsds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"numerators\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"denominators\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"timestamps\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setValue\",\"inputs\":[{\"name\":\"key\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"fairValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"valueUsd\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"numerator\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"denominator\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValueUpdated\",\"inputs\":[{\"name\":\"key\",\"type\":\"string\",\"indexed\":false,\"internalType\":\"string\"},{\"name\":\"fairValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"valueUsd\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"numerator\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"denominator\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]", - Bin: "0x6080604052348015600e575f5ffd5b50335f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055503373ffffffffffffffffffffffffffffffffffffffff165f73ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36110bf806100b55f395ff3fe608060405234801561000f575f5ffd5b5060043610610055575f3560e01c80634a7edea8146100595780636080b54f146100755780638da5cb5b14610091578063960384a0146100af578063f2fde38b146100e3575b5f5ffd5b610073600480360381019061006e9190610951565b6100ff565b005b61008f600480360381019061008a9190610af0565b61047c565b005b61009961061c565b6040516100a69190610bc5565b60405180910390f35b6100c960048036038101906100c49190610bde565b610640565b6040516100da959493929190610c38565b60405180910390f35b6100fd60048036038101906100f89190610cb3565b6106db565b005b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461018d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018490610d38565b60405180910390fd5b878790508a8a90501480156101a75750858590508a8a9050145b80156101b85750838390508a8a9050145b80156101c95750818190508a8a9050145b610208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ff90610da0565b60405180910390fd5b5f5f90505b8a8a905081101561046f575f85858381811061022c5761022b610dbe565b5b90506020020135148061025857505f83838381811061024e5761024d610dbe565b5b9050602002013514155b610297576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161028e90610e35565b60405180910390fd5b6040518060a001604052808a8a848181106102b5576102b4610dbe565b5b9050602002013581526020018888848181106102d4576102d3610dbe565b5b9050602002013581526020018686848181106102f3576102f2610dbe565b5b90506020020135815260200184848481811061031257610311610dbe565b5b9050602002013581526020014281525060018c8c8481811061033757610336610dbe565b5b90506020028101906103499190610e5f565b604051610357929190610efd565b90815260200160405180910390205f820151815f0155602082015181600101556040820151816002015560608201518160030155608082015181600401559050507f5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d8b8b838181106103cc576103cb610dbe565b5b90506020028101906103de9190610e5f565b8b8b858181106103f1576103f0610dbe565b5b905060200201358a8a8681811061040b5761040a610dbe565b5b9050602002013589898781811061042557610424610dbe565b5b9050602002013588888881811061043f5761043e610dbe565b5b905060200201354260405161045a9796959493929190610f51565b60405180910390a1808060010191505061020d565b5050505050505050505050565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461050a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161050190610d38565b60405180910390fd5b5f82148061051857505f8114155b610557576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054e90610e35565b60405180910390fd5b6040518060a001604052808581526020018481526020018381526020018281526020014281525060018787604051610590929190610efd565b90815260200160405180910390205f820151815f0155602082015181600101556040820151816002015560608201518160030155608082015181600401559050507f5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d8686868686864260405161060c9796959493929190610f51565b60405180910390a1505050505050565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f5f5f5f5f5f60018888604051610658929190610efd565b908152602001604051809103902090505f8160040154036106ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a590611003565b60405180910390fd5b805f0154816001015482600201548360030154846004015495509550955095509550509295509295909350565b5f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610769576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076090610d38565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036107d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ce9061106b565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff165f5f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3805f5f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f8401126108bc576108bb61089b565b5b8235905067ffffffffffffffff8111156108d9576108d861089f565b5b6020830191508360208202830111156108f5576108f46108a3565b5b9250929050565b5f5f83601f8401126109115761091061089b565b5b8235905067ffffffffffffffff81111561092e5761092d61089f565b5b60208301915083602082028301111561094a576109496108a3565b5b9250929050565b5f5f5f5f5f5f5f5f5f5f60a08b8d03121561096f5761096e610893565b5b5f8b013567ffffffffffffffff81111561098c5761098b610897565b5b6109988d828e016108a7565b9a509a505060208b013567ffffffffffffffff8111156109bb576109ba610897565b5b6109c78d828e016108fc565b985098505060408b013567ffffffffffffffff8111156109ea576109e9610897565b5b6109f68d828e016108fc565b965096505060608b013567ffffffffffffffff811115610a1957610a18610897565b5b610a258d828e016108fc565b945094505060808b013567ffffffffffffffff811115610a4857610a47610897565b5b610a548d828e016108fc565b92509250509295989b9194979a5092959850565b5f5f83601f840112610a7d57610a7c61089b565b5b8235905067ffffffffffffffff811115610a9a57610a9961089f565b5b602083019150836001820283011115610ab657610ab56108a3565b5b9250929050565b5f819050919050565b610acf81610abd565b8114610ad9575f5ffd5b50565b5f81359050610aea81610ac6565b92915050565b5f5f5f5f5f5f60a08789031215610b0a57610b09610893565b5b5f87013567ffffffffffffffff811115610b2757610b26610897565b5b610b3389828a01610a68565b96509650506020610b4689828a01610adc565b9450506040610b5789828a01610adc565b9350506060610b6889828a01610adc565b9250506080610b7989828a01610adc565b9150509295509295509295565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610baf82610b86565b9050919050565b610bbf81610ba5565b82525050565b5f602082019050610bd85f830184610bb6565b92915050565b5f5f60208385031215610bf457610bf3610893565b5b5f83013567ffffffffffffffff811115610c1157610c10610897565b5b610c1d85828601610a68565b92509250509250929050565b610c3281610abd565b82525050565b5f60a082019050610c4b5f830188610c29565b610c586020830187610c29565b610c656040830186610c29565b610c726060830185610c29565b610c7f6080830184610c29565b9695505050505050565b610c9281610ba5565b8114610c9c575f5ffd5b50565b5f81359050610cad81610c89565b92915050565b5f60208284031215610cc857610cc7610893565b5b5f610cd584828501610c9f565b91505092915050565b5f82825260208201905092915050565b7f43616c6c6572206973206e6f7420746865206f776e65720000000000000000005f82015250565b5f610d22601783610cde565b9150610d2d82610cee565b602082019050919050565b5f6020820190508181035f830152610d4f81610d16565b9050919050565b7f4172726179206c656e67746873206d757374206d6174636800000000000000005f82015250565b5f610d8a601883610cde565b9150610d9582610d56565b602082019050919050565b5f6020820190508181035f830152610db781610d7e565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f6469766973696f6e206279207a65726f000000000000000000000000000000005f82015250565b5f610e1f601083610cde565b9150610e2a82610deb565b602082019050919050565b5f6020820190508181035f830152610e4c81610e13565b9050919050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83356001602003843603038112610e7b57610e7a610e53565b5b80840192508235915067ffffffffffffffff821115610e9d57610e9c610e57565b5b602083019250600182023603831315610eb957610eb8610e5b565b5b509250929050565b5f81905092915050565b828183375f83830152505050565b5f610ee48385610ec1565b9350610ef1838584610ecb565b82840190509392505050565b5f610f09828486610ed9565b91508190509392505050565b5f601f19601f8301169050919050565b5f610f308385610cde565b9350610f3d838584610ecb565b610f4683610f15565b840190509392505050565b5f60c0820190508181035f830152610f6a81898b610f25565b9050610f796020830188610c29565b610f866040830187610c29565b610f936060830186610c29565b610fa06080830185610c29565b610fad60a0830184610c29565b98975050505050505050565b7f4e6f206461746120666f72206b657900000000000000000000000000000000005f82015250565b5f610fed600f83610cde565b9150610ff882610fb9565b602082019050919050565b5f6020820190508181035f83015261101a81610fe1565b9050919050565b7f4e6577206f776e6572206973207a65726f2061646472657373000000000000005f82015250565b5f611055601983610cde565b915061106082611021565b602082019050919050565b5f6020820190508181035f83015261108281611049565b905091905056fea264697066735822122046477468a2fe8c028640964929d9efa4e7b1c8ec32936a7b52a0b5c5c063756264736f6c634300081e0033", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"MAX_TIMESTAMP_GAP\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"UPGRADE_INTERFACE_VERSION\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\",\"internalType\":\"string\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getValue\",\"inputs\":[{\"name\":\"key\",\"type\":\"string\",\"internalType\":\"string\"}],\"outputs\":[{\"name\":\"fairValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"valueUsd\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"numerator\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"denominator\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"initialOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"proxiableUUID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setMultipleValues\",\"inputs\":[{\"name\":\"keys\",\"type\":\"string[]\",\"internalType\":\"string[]\"},{\"name\":\"fairValues\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"valueUsds\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"numerators\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"denominators\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"timestamps\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"setValue\",\"inputs\":[{\"name\":\"key\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"fairValue\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"valueUsd\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"numerator\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"denominator\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"supportsInterface\",\"inputs\":[{\"name\":\"interfaceId\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"inputs\":[{\"name\":\"newImplementation\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Upgraded\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"ValueUpdated\",\"inputs\":[{\"name\":\"key\",\"type\":\"string\",\"indexed\":true,\"internalType\":\"string\"},{\"name\":\"fairValue\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"valueUsd\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"numerator\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"denominator\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"timestamp\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AddressEmptyCode\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"DivisionByZero\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"DivisionByZeroInBatch\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"ERC1967InvalidImplementation\",\"inputs\":[{\"name\":\"implementation\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"ERC1967NonPayable\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"FailedCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidArrayLengths\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidKey\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidKeyInBatch\",\"inputs\":[{\"name\":\"index\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"NoDataForKey\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"OwnableInvalidOwner\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"OwnableUnauthorizedAccount\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}]},{\"type\":\"error\",\"name\":\"TimestampNotIncreasing\",\"inputs\":[{\"name\":\"newTimestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"existingTimestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"TimestampTooFarInFuture\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockTime\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"TimestampTooFarInPast\",\"inputs\":[{\"name\":\"timestamp\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"blockTime\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"UUPSUnauthorizedCallContext\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"UUPSUnsupportedProxiableUUID\",\"inputs\":[{\"name\":\"slot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"type\":\"error\",\"name\":\"ZeroAddress\",\"inputs\":[]}]", + Bin: "0x60a080604052346100c257306080525f516020610f985f395f51905f525460ff8160401c166100b3576002600160401b03196001600160401b03821601610060575b604051610ed190816100c7823960805181818161084001526108e30152f35b6001600160401b0319166001600160401b039081175f516020610f985f395f51905f525581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a15f80610041565b63f92ee8a960e01b5f5260045ffd5b5f80fdfe60a0806040526004361015610012575f80fd5b5f3560e01c90816301ffc9a714610a5f575080634f1ef2861461089457806352d1902d1461082e578063715018a6146107c757806372f755b2146104725780638da5cb5b1461043e578063960384a0146103aa578063ad3cb1cc1461034c578063be2e017914610330578063c4d66de814610224578063e329c28c146100cf5763f2fde38b146100a0575f80fd5b346100cb5760203660031901126100cb576100c96100bc610ab2565b6100c4610c90565b610c1f565b005b5f80fd5b346100cb5760c03660031901126100cb576004356001600160401b0381116100cb576100ff903690600401610b8d565b60243590604435606435926084359460a4359561011a610c90565b8415610215578515158061020d575b6101fe577f5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d946101f99261016789610162368585610b18565b610cc3565b60405161017381610ac8565b85815260048a60208301898152604084018c8152606085019188835260808601938452604051888882376020818a81015f815203019020955186555160018601555160028501555160038401555191015581604051928392833781015f815203902095604051948594859094939260609260808301968352602083015260408201520152565b0390a3005b6323d359a360e01b5f5260045ffd5b508015610129565b630eda9c3d60e31b5f5260045ffd5b346100cb5760203660031901126100cb5761023d610ab2565b5f516020610e7c5f395f51905f525460ff8160401c16801561031c575b61030d5768ffffffffffffffffff191668010000000000000001175f516020610e7c5f395f51905f52556001600160a01b038116156102fe576102a79061029f610d84565b6100c4610d84565b68ff0000000000000000195f516020610e7c5f395f51905f5254165f516020610e7c5f395f51905f52557fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602060405160018152a1005b63d92e233d60e01b5f5260045ffd5b63f92ee8a960e01b5f5260045ffd5b5060016001600160401b038216101561025a565b346100cb575f3660031901126100cb576020604051610e108152f35b346100cb575f3660031901126100cb57604080519061036b8183610af7565b600582526020820191640352e302e360dc1b83528151928391602083525180918160208501528484015e5f828201840152601f01601f19168101030190f35b346100cb5760203660031901126100cb576004356001600160401b0381116100cb576103dc6020913690600401610b8d565b919082604051938492833781015f815203019020600481015490811561042f5760a09181549160018101549060036002820154910154916040519485526020850152604084015260608301526080820152f35b6339a07f5560e11b5f5260045ffd5b346100cb575f3660031901126100cb575f516020610e3c5f395f51905f52546040516001600160a01b039091168152602090f35b346100cb5760c03660031901126100cb576004356001600160401b0381116100cb576104a2903690600401610b5d565b906024356001600160401b0381116100cb576104c2903690600401610b5d565b90608052906044356001600160401b0381116100cb576104e6903690600401610b5d565b6064929192356001600160401b0381116100cb57610508903690600401610b5d565b9190956084356001600160401b0381116100cb5761052a903690600401610b5d565b94909560a4356001600160401b0381116100cb5761054c903690600401610b5d565b979092610557610c90565b8985148015906107bd575b80156107b3575b80156107a9575b801561079f575b610790575f5b85811061058657005b610591818784610bba565b90501561077e576105a381898e610c0f565b3515158061076b575b610759578a81808a8f828f8f838f948f8f8f918f908f928b8f898d938d809a97818f9599818d81809d8f8b8f846105e4918194610bba565b926105f091928d610c0f565b359136906105fd92610b18565b9061060791610cc3565b816080519161061592610c0f565b359b61062092610c0f565b359861062b92610c0f565b359461063692610c0f565b359361064192610c0f565b35926040519461065086610ac8565b85526020850190815260408501918252606085019283526080850193845261067987878a610bba565b9081604051928392833781015f8152036020019020945185555160018501555160028401555160038301555190600401556106b392610bba565b96909b81608051916106c492610c0f565b35976106cf92610c0f565b35966106da92610c0f565b35956106e6918c610c0f565b35956106f2918d610c0f565b359581604051928392833781015f81520390209360405193849361072d93859094939260609260808301968352602083015260408201520152565b037f5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d91a360010161057d565b6379ae650760e01b5f5260045260245ffd5b50610777818a85610c0f565b35156105ac565b630b414c8760e21b5f5260045260245ffd5b63a9854bc960e01b5f5260045ffd5b5088851415610577565b5087851415610570565b5086851415610569565b5085851415610562565b346100cb575f3660031901126100cb576107df610c90565b5f516020610e3c5f395f51905f5280546001600160a01b031981169091555f906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a3005b346100cb575f3660031901126100cb577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036108855760206040515f516020610e5c5f395f51905f528152f35b63703e46dd60e11b5f5260045ffd5b60403660031901126100cb576108a8610ab2565b6024356001600160401b0381116100cb57366023820112156100cb576108d8903690602481600401359101610b18565b906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115610a3d575b506108855761091b610c90565b6040516352d1902d60e01b81526001600160a01b0382169290602081600481875afa5f9181610a09575b5061095d5783634c9c8ce360e01b5f5260045260245ffd5b805f516020610e5c5f395f51905f528592036109f75750823b156109e5575f516020610e5c5f395f51905f5280546001600160a01b031916821790557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b5f80a28051156109cd576100c991610daf565b5050346109d657005b63b398979f60e01b5f5260045ffd5b634c9c8ce360e01b5f5260045260245ffd5b632a87526960e21b5f5260045260245ffd5b9091506020813d602011610a35575b81610a2560209383610af7565b810103126100cb57519085610945565b3d9150610a18565b5f516020610e5c5f395f51905f52546001600160a01b0316141590508361090e565b346100cb5760203660031901126100cb576004359063ffffffff60e01b82168092036100cb576020916301ffc9a760e01b8114908115610aa1575b5015158152f35b6304b01c2560e51b14905083610a9a565b600435906001600160a01b03821682036100cb57565b60a081019081106001600160401b03821117610ae357604052565b634e487b7160e01b5f52604160045260245ffd5b90601f801991011681019081106001600160401b03821117610ae357604052565b9291926001600160401b038211610ae35760405191610b41601f8201601f191660200184610af7565b8294818452818301116100cb578281602093845f960137010152565b9181601f840112156100cb578235916001600160401b0383116100cb576020808501948460051b0101116100cb57565b9181601f840112156100cb578235916001600160401b0383116100cb57602083818601950101116100cb57565b9190811015610bfb5760051b81013590601e19813603018212156100cb5701908135916001600160401b0383116100cb5760200182360381136100cb579190565b634e487b7160e01b5f52603260045260245ffd5b9190811015610bfb5760051b0190565b6001600160a01b03168015610c7d575f516020610e3c5f395f51905f5280546001600160a01b0319811683179091556001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f80a3565b631e4fbdf760e01b5f525f60045260245ffd5b5f516020610e3c5f395f51905f52546001600160a01b03163303610cb057565b63118cdaa760e01b5f523360045260245ffd5b610e104201804211610d59578211610d6d57610e10421180610d44575b610d2d576040518151600492602091839181908401835e81015f81520301902001549081610d0c575050565b81811115610d18575050565b631a6e512d60e31b5f5260045260245260445ffd5b5063272c289560e11b5f526004524260245260445ffd5b50610e0f194201428111610d59578210610ce0565b634e487b7160e01b5f52601160045260245ffd5b50632161dd6360e21b5f526004524260245260445ffd5b60ff5f516020610e7c5f395f51905f525460401c1615610da057565b631afcd79f60e31b5f5260045ffd5b905f8091602081519101845af48080610e28575b15610de35750506040513d81523d5f602083013e60203d82010160405290565b15610e0857639996b31560e01b5f9081526001600160a01b0391909116600452602490fd5b3d15610e19576040513d5f823e3d90fd5b63d6bda27560e01b5f5260045ffd5b503d151580610dc35750813b1515610dc356fe9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbcf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a26469706673582212206299334f0a82cdac751ef8aa1ea547ebf15ae6b8cb9615bb6fb3d8e01b4e13b464736f6c63430008220033f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00", } // ValueStoreABI is the input ABI used to generate the binding from. @@ -202,6 +202,68 @@ func (_ValueStore *ValueStoreTransactorRaw) Transact(opts *bind.TransactOpts, me return _ValueStore.Contract.contract.Transact(opts, method, params...) } +// MAXTIMESTAMPGAP is a free data retrieval call binding the contract method 0xbe2e0179. +// +// Solidity: function MAX_TIMESTAMP_GAP() view returns(uint256) +func (_ValueStore *ValueStoreCaller) MAXTIMESTAMPGAP(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ValueStore.contract.Call(opts, &out, "MAX_TIMESTAMP_GAP") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MAXTIMESTAMPGAP is a free data retrieval call binding the contract method 0xbe2e0179. +// +// Solidity: function MAX_TIMESTAMP_GAP() view returns(uint256) +func (_ValueStore *ValueStoreSession) MAXTIMESTAMPGAP() (*big.Int, error) { + return _ValueStore.Contract.MAXTIMESTAMPGAP(&_ValueStore.CallOpts) +} + +// MAXTIMESTAMPGAP is a free data retrieval call binding the contract method 0xbe2e0179. +// +// Solidity: function MAX_TIMESTAMP_GAP() view returns(uint256) +func (_ValueStore *ValueStoreCallerSession) MAXTIMESTAMPGAP() (*big.Int, error) { + return _ValueStore.Contract.MAXTIMESTAMPGAP(&_ValueStore.CallOpts) +} + +// UPGRADEINTERFACEVERSION is a free data retrieval call binding the contract method 0xad3cb1cc. +// +// Solidity: function UPGRADE_INTERFACE_VERSION() view returns(string) +func (_ValueStore *ValueStoreCaller) UPGRADEINTERFACEVERSION(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ValueStore.contract.Call(opts, &out, "UPGRADE_INTERFACE_VERSION") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// UPGRADEINTERFACEVERSION is a free data retrieval call binding the contract method 0xad3cb1cc. +// +// Solidity: function UPGRADE_INTERFACE_VERSION() view returns(string) +func (_ValueStore *ValueStoreSession) UPGRADEINTERFACEVERSION() (string, error) { + return _ValueStore.Contract.UPGRADEINTERFACEVERSION(&_ValueStore.CallOpts) +} + +// UPGRADEINTERFACEVERSION is a free data retrieval call binding the contract method 0xad3cb1cc. +// +// Solidity: function UPGRADE_INTERFACE_VERSION() view returns(string) +func (_ValueStore *ValueStoreCallerSession) UPGRADEINTERFACEVERSION() (string, error) { + return _ValueStore.Contract.UPGRADEINTERFACEVERSION(&_ValueStore.CallOpts) +} + // GetValue is a free data retrieval call binding the contract method 0x960384a0. // // Solidity: function getValue(string key) view returns(uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 timestamp) @@ -293,6 +355,110 @@ func (_ValueStore *ValueStoreCallerSession) Owner() (common.Address, error) { return _ValueStore.Contract.Owner(&_ValueStore.CallOpts) } +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_ValueStore *ValueStoreCaller) ProxiableUUID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _ValueStore.contract.Call(opts, &out, "proxiableUUID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_ValueStore *ValueStoreSession) ProxiableUUID() ([32]byte, error) { + return _ValueStore.Contract.ProxiableUUID(&_ValueStore.CallOpts) +} + +// ProxiableUUID is a free data retrieval call binding the contract method 0x52d1902d. +// +// Solidity: function proxiableUUID() view returns(bytes32) +func (_ValueStore *ValueStoreCallerSession) ProxiableUUID() ([32]byte, error) { + return _ValueStore.Contract.ProxiableUUID(&_ValueStore.CallOpts) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_ValueStore *ValueStoreCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { + var out []interface{} + err := _ValueStore.contract.Call(opts, &out, "supportsInterface", interfaceId) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_ValueStore *ValueStoreSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _ValueStore.Contract.SupportsInterface(&_ValueStore.CallOpts, interfaceId) +} + +// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. +// +// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) +func (_ValueStore *ValueStoreCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { + return _ValueStore.Contract.SupportsInterface(&_ValueStore.CallOpts, interfaceId) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address initialOwner) returns() +func (_ValueStore *ValueStoreTransactor) Initialize(opts *bind.TransactOpts, initialOwner common.Address) (*types.Transaction, error) { + return _ValueStore.contract.Transact(opts, "initialize", initialOwner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address initialOwner) returns() +func (_ValueStore *ValueStoreSession) Initialize(initialOwner common.Address) (*types.Transaction, error) { + return _ValueStore.Contract.Initialize(&_ValueStore.TransactOpts, initialOwner) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address initialOwner) returns() +func (_ValueStore *ValueStoreTransactorSession) Initialize(initialOwner common.Address) (*types.Transaction, error) { + return _ValueStore.Contract.Initialize(&_ValueStore.TransactOpts, initialOwner) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ValueStore *ValueStoreTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ValueStore.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ValueStore *ValueStoreSession) RenounceOwnership() (*types.Transaction, error) { + return _ValueStore.Contract.RenounceOwnership(&_ValueStore.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_ValueStore *ValueStoreTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _ValueStore.Contract.RenounceOwnership(&_ValueStore.TransactOpts) +} + // SetMultipleValues is a paid mutator transaction binding the contract method 0x72f755b2. // // Solidity: function setMultipleValues(string[] keys, uint256[] fairValues, uint256[] valueUsds, uint256[] numerators, uint256[] denominators, uint256[] timestamps) returns() @@ -314,25 +480,25 @@ func (_ValueStore *ValueStoreTransactorSession) SetMultipleValues(keys []string, return _ValueStore.Contract.SetMultipleValues(&_ValueStore.TransactOpts, keys, fairValues, valueUsds, numerators, denominators, timestamps) } -// SetValue is a paid mutator transaction binding the contract method 0x6080b54f. +// SetValue is a paid mutator transaction binding the contract method 0xe329c28c. // -// Solidity: function setValue(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator) returns() -func (_ValueStore *ValueStoreTransactor) SetValue(opts *bind.TransactOpts, key string, fairValue *big.Int, valueUsd *big.Int, numerator *big.Int, denominator *big.Int) (*types.Transaction, error) { - return _ValueStore.contract.Transact(opts, "setValue", key, fairValue, valueUsd, numerator, denominator) +// Solidity: function setValue(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 timestamp) returns() +func (_ValueStore *ValueStoreTransactor) SetValue(opts *bind.TransactOpts, key string, fairValue *big.Int, valueUsd *big.Int, numerator *big.Int, denominator *big.Int, timestamp *big.Int) (*types.Transaction, error) { + return _ValueStore.contract.Transact(opts, "setValue", key, fairValue, valueUsd, numerator, denominator, timestamp) } -// SetValue is a paid mutator transaction binding the contract method 0x6080b54f. +// SetValue is a paid mutator transaction binding the contract method 0xe329c28c. // -// Solidity: function setValue(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator) returns() -func (_ValueStore *ValueStoreSession) SetValue(key string, fairValue *big.Int, valueUsd *big.Int, numerator *big.Int, denominator *big.Int) (*types.Transaction, error) { - return _ValueStore.Contract.SetValue(&_ValueStore.TransactOpts, key, fairValue, valueUsd, numerator, denominator) +// Solidity: function setValue(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 timestamp) returns() +func (_ValueStore *ValueStoreSession) SetValue(key string, fairValue *big.Int, valueUsd *big.Int, numerator *big.Int, denominator *big.Int, timestamp *big.Int) (*types.Transaction, error) { + return _ValueStore.Contract.SetValue(&_ValueStore.TransactOpts, key, fairValue, valueUsd, numerator, denominator, timestamp) } -// SetValue is a paid mutator transaction binding the contract method 0x6080b54f. +// SetValue is a paid mutator transaction binding the contract method 0xe329c28c. // -// Solidity: function setValue(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator) returns() -func (_ValueStore *ValueStoreTransactorSession) SetValue(key string, fairValue *big.Int, valueUsd *big.Int, numerator *big.Int, denominator *big.Int) (*types.Transaction, error) { - return _ValueStore.Contract.SetValue(&_ValueStore.TransactOpts, key, fairValue, valueUsd, numerator, denominator) +// Solidity: function setValue(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 timestamp) returns() +func (_ValueStore *ValueStoreTransactorSession) SetValue(key string, fairValue *big.Int, valueUsd *big.Int, numerator *big.Int, denominator *big.Int, timestamp *big.Int) (*types.Transaction, error) { + return _ValueStore.Contract.SetValue(&_ValueStore.TransactOpts, key, fairValue, valueUsd, numerator, denominator, timestamp) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. @@ -356,6 +522,161 @@ func (_ValueStore *ValueStoreTransactorSession) TransferOwnership(newOwner commo return _ValueStore.Contract.TransferOwnership(&_ValueStore.TransactOpts, newOwner) } +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_ValueStore *ValueStoreTransactor) UpgradeToAndCall(opts *bind.TransactOpts, newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _ValueStore.contract.Transact(opts, "upgradeToAndCall", newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_ValueStore *ValueStoreSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _ValueStore.Contract.UpgradeToAndCall(&_ValueStore.TransactOpts, newImplementation, data) +} + +// UpgradeToAndCall is a paid mutator transaction binding the contract method 0x4f1ef286. +// +// Solidity: function upgradeToAndCall(address newImplementation, bytes data) payable returns() +func (_ValueStore *ValueStoreTransactorSession) UpgradeToAndCall(newImplementation common.Address, data []byte) (*types.Transaction, error) { + return _ValueStore.Contract.UpgradeToAndCall(&_ValueStore.TransactOpts, newImplementation, data) +} + +// ValueStoreInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the ValueStore contract. +type ValueStoreInitializedIterator struct { + Event *ValueStoreInitialized // 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 *ValueStoreInitializedIterator) 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(ValueStoreInitialized) + 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(ValueStoreInitialized) + 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 *ValueStoreInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ValueStoreInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ValueStoreInitialized represents a Initialized event raised by the ValueStore contract. +type ValueStoreInitialized struct { + Version uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_ValueStore *ValueStoreFilterer) FilterInitialized(opts *bind.FilterOpts) (*ValueStoreInitializedIterator, error) { + + logs, sub, err := _ValueStore.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &ValueStoreInitializedIterator{contract: _ValueStore.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_ValueStore *ValueStoreFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *ValueStoreInitialized) (event.Subscription, error) { + + logs, sub, err := _ValueStore.contract.WatchLogs(opts, "Initialized") + 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(ValueStoreInitialized) + if err := _ValueStore.contract.UnpackLog(event, "Initialized", 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 +} + +// ParseInitialized is a log parse operation binding the contract event 0xc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2. +// +// Solidity: event Initialized(uint64 version) +func (_ValueStore *ValueStoreFilterer) ParseInitialized(log types.Log) (*ValueStoreInitialized, error) { + event := new(ValueStoreInitialized) + if err := _ValueStore.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // ValueStoreOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the ValueStore contract. type ValueStoreOwnershipTransferredIterator struct { Event *ValueStoreOwnershipTransferred // Event containing the contract specifics and raw log @@ -509,6 +830,150 @@ func (_ValueStore *ValueStoreFilterer) ParseOwnershipTransferred(log types.Log) return event, nil } +// ValueStoreUpgradedIterator is returned from FilterUpgraded and is used to iterate over the raw logs and unpacked data for Upgraded events raised by the ValueStore contract. +type ValueStoreUpgradedIterator struct { + Event *ValueStoreUpgraded // 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 *ValueStoreUpgradedIterator) 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(ValueStoreUpgraded) + 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(ValueStoreUpgraded) + 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 *ValueStoreUpgradedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ValueStoreUpgradedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ValueStoreUpgraded represents a Upgraded event raised by the ValueStore contract. +type ValueStoreUpgraded struct { + Implementation common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUpgraded is a free log retrieval operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_ValueStore *ValueStoreFilterer) FilterUpgraded(opts *bind.FilterOpts, implementation []common.Address) (*ValueStoreUpgradedIterator, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _ValueStore.contract.FilterLogs(opts, "Upgraded", implementationRule) + if err != nil { + return nil, err + } + return &ValueStoreUpgradedIterator{contract: _ValueStore.contract, event: "Upgraded", logs: logs, sub: sub}, nil +} + +// WatchUpgraded is a free log subscription operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_ValueStore *ValueStoreFilterer) WatchUpgraded(opts *bind.WatchOpts, sink chan<- *ValueStoreUpgraded, implementation []common.Address) (event.Subscription, error) { + + var implementationRule []interface{} + for _, implementationItem := range implementation { + implementationRule = append(implementationRule, implementationItem) + } + + logs, sub, err := _ValueStore.contract.WatchLogs(opts, "Upgraded", implementationRule) + 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(ValueStoreUpgraded) + if err := _ValueStore.contract.UnpackLog(event, "Upgraded", 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 +} + +// ParseUpgraded is a log parse operation binding the contract event 0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b. +// +// Solidity: event Upgraded(address indexed implementation) +func (_ValueStore *ValueStoreFilterer) ParseUpgraded(log types.Log) (*ValueStoreUpgraded, error) { + event := new(ValueStoreUpgraded) + if err := _ValueStore.contract.UnpackLog(event, "Upgraded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // ValueStoreValueUpdatedIterator is returned from FilterValueUpdated and is used to iterate over the raw logs and unpacked data for ValueUpdated events raised by the ValueStore contract. type ValueStoreValueUpdatedIterator struct { Event *ValueStoreValueUpdated // Event containing the contract specifics and raw log @@ -578,7 +1043,7 @@ func (it *ValueStoreValueUpdatedIterator) Close() error { // ValueStoreValueUpdated represents a ValueUpdated event raised by the ValueStore contract. type ValueStoreValueUpdated struct { - Key string + Key common.Hash FairValue *big.Int ValueUsd *big.Int Numerator *big.Int @@ -589,10 +1054,20 @@ type ValueStoreValueUpdated struct { // FilterValueUpdated is a free log retrieval operation binding the contract event 0x5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d. // -// Solidity: event ValueUpdated(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 timestamp) -func (_ValueStore *ValueStoreFilterer) FilterValueUpdated(opts *bind.FilterOpts) (*ValueStoreValueUpdatedIterator, error) { +// Solidity: event ValueUpdated(string indexed key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 indexed timestamp) +func (_ValueStore *ValueStoreFilterer) FilterValueUpdated(opts *bind.FilterOpts, key []string, timestamp []*big.Int) (*ValueStoreValueUpdatedIterator, error) { + + var keyRule []interface{} + for _, keyItem := range key { + keyRule = append(keyRule, keyItem) + } + + var timestampRule []interface{} + for _, timestampItem := range timestamp { + timestampRule = append(timestampRule, timestampItem) + } - logs, sub, err := _ValueStore.contract.FilterLogs(opts, "ValueUpdated") + logs, sub, err := _ValueStore.contract.FilterLogs(opts, "ValueUpdated", keyRule, timestampRule) if err != nil { return nil, err } @@ -601,10 +1076,20 @@ func (_ValueStore *ValueStoreFilterer) FilterValueUpdated(opts *bind.FilterOpts) // WatchValueUpdated is a free log subscription operation binding the contract event 0x5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d. // -// Solidity: event ValueUpdated(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 timestamp) -func (_ValueStore *ValueStoreFilterer) WatchValueUpdated(opts *bind.WatchOpts, sink chan<- *ValueStoreValueUpdated) (event.Subscription, error) { +// Solidity: event ValueUpdated(string indexed key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 indexed timestamp) +func (_ValueStore *ValueStoreFilterer) WatchValueUpdated(opts *bind.WatchOpts, sink chan<- *ValueStoreValueUpdated, key []string, timestamp []*big.Int) (event.Subscription, error) { + + var keyRule []interface{} + for _, keyItem := range key { + keyRule = append(keyRule, keyItem) + } + + var timestampRule []interface{} + for _, timestampItem := range timestamp { + timestampRule = append(timestampRule, timestampItem) + } - logs, sub, err := _ValueStore.contract.WatchLogs(opts, "ValueUpdated") + logs, sub, err := _ValueStore.contract.WatchLogs(opts, "ValueUpdated", keyRule, timestampRule) if err != nil { return nil, err } @@ -638,7 +1123,7 @@ func (_ValueStore *ValueStoreFilterer) WatchValueUpdated(opts *bind.WatchOpts, s // ParseValueUpdated is a log parse operation binding the contract event 0x5f2a8c3a90ec95498a7028ec8d4e67159d8aa0e0bd28284ea430ba0f1da6877d. // -// Solidity: event ValueUpdated(string key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 timestamp) +// Solidity: event ValueUpdated(string indexed key, uint256 fairValue, uint256 valueUsd, uint256 numerator, uint256 denominator, uint256 indexed timestamp) func (_ValueStore *ValueStoreFilterer) ParseValueUpdated(log types.Log) (*ValueStoreValueUpdated, error) { event := new(ValueStoreValueUpdated) if err := _ValueStore.contract.UnpackLog(event, "ValueUpdated", log); err != nil { diff --git a/onchain/contractDeployment.go b/onchain/contractDeployment.go index 255772c..54d6fca 100644 --- a/onchain/contractDeployment.go +++ b/onchain/contractDeployment.go @@ -1,8 +1,12 @@ package onchain import ( + "encoding/hex" + "os" + "strings" "time" + erc1967proxy "github.com/diadata-org/fair-value/contracts/erc1967proxy" ValueStore "github.com/diadata-org/fair-value/contracts/valuestore" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" @@ -32,22 +36,97 @@ func DeployOrBindContract( } } else { - // deploy contract - var addr common.Address - var tx *types.Transaction - addr, tx, *contract, err = ValueStore.DeployValueStore(auth, conn) + var implAddr common.Address + var implTx *types.Transaction + implAddr, implTx, *contract, err = ValueStore.DeployValueStore(auth, conn) if err != nil { - log.Fatalf("could not deploy contract: %v", err) + log.Fatalf("could not deploy ValueStore implementation: %v", err) return err } - log.Infof("Contract pending deploy: 0x%x.", addr) - log.Infof("Transaction waiting to be mined: 0x%x.", tx.Hash()) - // bind backup - *contractBackup, err = ValueStore.NewValueStore(addr, connBackup) + log.Infof("ValueStore Implementation pending deploy: 0x%x.", implAddr) + log.Infof("Implementation Transaction waiting to be mined: 0x%x.", implTx.Hash()) + + log.Info("Waiting for implementation deployment to be mined...") + time.Sleep(30 * time.Second) + + proxyBytecodeHex, err := os.ReadFile("contracts/erc1967proxy/ERC1967Proxy.bin") + if err != nil { + log.Fatalf("could not read proxy bytecode: %v", err) + return err + } + + hexString := strings.TrimSpace(strings.TrimPrefix(string(proxyBytecodeHex), "0x")) + proxyBytecode, err := hex.DecodeString(hexString) + if err != nil { + log.Fatalf("could not decode proxy bytecode: %v", err) + return err + } + + proxyABI, err := erc1967proxy.ERC1967ProxyMetaData.GetAbi() + if err != nil { + log.Fatalf("could not parse proxy ABI: %v", err) + return err + } + + valueStoreABI, err := ValueStore.ValueStoreMetaData.GetAbi() + if err != nil { + log.Fatalf("could not parse ValueStore ABI: %v", err) + return err + } + + initializeData, err := valueStoreABI.Pack("initialize", auth.From) if err != nil { + log.Fatalf("could not pack initialize data: %v", err) return err } - time.Sleep(180000 * time.Millisecond) + + proxyAddr, proxyTx, _, err := bind.DeployContract( + auth, + *proxyABI, + proxyBytecode, + conn, + implAddr, + initializeData, + ) + if err != nil { + log.Fatalf("could not deploy proxy: %v", err) + return err + } + + log.Infof("ERC1967Proxy pending deploy: 0x%x.", proxyAddr) + log.Infof("Proxy Transaction waiting to be mined: 0x%x.", proxyTx.Hash()) + + *contract, err = ValueStore.NewValueStore(proxyAddr, conn) + if err != nil { + log.Fatalf("could not bind to proxy: %v", err) + return err + } + + *contractBackup, err = ValueStore.NewValueStore(proxyAddr, connBackup) + if err != nil { + log.Fatalf("could not bind backup to proxy: %v", err) + return err + } + + log.Info("Waiting for proxy deployment to be mined...") + time.Sleep(30 * time.Second) + + owner, err := (*contract).Owner(nil) + if err != nil { + log.Warnf("Could not verify owner: %v", err) + } else { + log.Infof("Proxy owner verified: 0x%x", owner) + if owner != auth.From { + log.Warnf("Owner mismatch! Expected: 0x%x, Got: 0x%x", auth.From, owner) + } else { + log.Info("Owner correctly set to deployer address") + } + } + + log.Info("Deployment successful!") + log.Infof("ValueStore Implementation: 0x%x", implAddr) + log.Infof("ERC1967Proxy (use this address): 0x%x", proxyAddr) + log.Infof("Deployer (Owner): 0x%x", auth.From) } return nil }