diff --git a/.env.example b/.env.example index 66649542c..de288ea8d 100755 --- a/.env.example +++ b/.env.example @@ -1,5 +1,6 @@ RPC_URI_FOR_1= RPC_URI_FOR_10= +RPC_URI_FOR_137= RPC_URI_FOR_250= RPC_URI_FOR_8453= RPC_URI_FOR_42161= diff --git a/INSTALL.md b/INSTALL.md index 963a18f92..8a5275e7b 100755 --- a/INSTALL.md +++ b/INSTALL.md @@ -25,6 +25,7 @@ Run `nano /etc/systemd/system/server.conf` and put the environment variables in ``` RPC_URI_FOR_1= RPC_URI_FOR_10= +RPC_URI_FOR_137= RPC_URI_FOR_250= RPC_URI_FOR_8453= RPC_URI_FOR_42161= diff --git a/README.md b/README.md index bbb260f9c..ee793b3c6 100755 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ First, ensure [Docker](https://docs.docker.com/get-started/overview/) is install ``` RPC_URI_FOR_1= RPC_URI_FOR_10= +RPC_URI_FOR_137= RPC_URI_FOR_250= RPC_URI_FOR_8453= RPC_URI_FOR_42161= @@ -28,6 +29,7 @@ First, ensure [Go](https://go.dev/) is installed on your system. then, clone the ``` RPC_URI_FOR_1= RPC_URI_FOR_10= +RPC_URI_FOR_137= RPC_URI_FOR_250= RPC_URI_FOR_8453= RPC_URI_FOR_42161= @@ -54,7 +56,7 @@ curl http://localhost:8080/1/vaults/all ## Endpoints `GET` `[BASE_URL]/[chainID]/vaults/all` -> This endpoint returns all the vaults of the specified chainID. Supported chains are `1`, `10`, `250`, `8453` and `42161`. +> This endpoint returns all the vaults of the specified chainID. Supported chains are `1`, `10`, `137`, `250`, `8453` and `42161`. > > **Query** `?skip=N` will skip N vault from the graphQL query. Default is `0` @@ -66,7 +68,7 @@ curl http://localhost:8080/1/vaults/all ------- `GET` `[BASE_URL]/[chainID]/vaults/[address]` -> This endpoint returns the vault matching the specified address, for the specified chainID. Supported chains are `1`, `10`, `250`, `8453`, and `42161`. +> This endpoint returns the vault matching the specified address, for the specified chainID. Supported chains are `1`, `10`, `137`, `250`, `8453`, and `42161`. > > **Query** > `?strategiesCondition=debtLimit|inQueue|absolute` will select the "active" strategies based on the specified strategy. Default is `debtLimit` diff --git a/cmd/daemons.go b/cmd/daemons.go index a425de5a5..d28b212e3 100755 --- a/cmd/daemons.go +++ b/cmd/daemons.go @@ -6,7 +6,6 @@ import ( "time" "github.com/yearn/ydaemon/common/env" - "github.com/yearn/ydaemon/common/helpers" "github.com/yearn/ydaemon/common/logs" "github.com/yearn/ydaemon/external/partners" "github.com/yearn/ydaemon/external/vaults" @@ -47,7 +46,7 @@ func runDaemonWithBlocks(chainID uint64, startBlock uint64, endBlock *uint64, wg // SummonDaemons is a function that summons the daemons for a given chainID. func SummonDaemons(chainID uint64) { - if !helpers.Contains(env.SUPPORTED_CHAIN_IDS, chainID) { + if _, ok := env.CHAINS[chainID]; !ok { return } @@ -70,7 +69,7 @@ func SummonDaemons(chainID uint64) { // LoadDaemons is a function that loads the previous store state for a given chainID func LoadDaemons(chainID uint64) { - if !helpers.Contains(env.SUPPORTED_CHAIN_IDS, chainID) { + if _, ok := env.CHAINS[chainID]; !ok { return } diff --git a/cmd/daemons_test.go b/cmd/daemons_test.go deleted file mode 100755 index e64f2fb2e..000000000 --- a/cmd/daemons_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package main - -import ( - "sync" - "testing" - - "github.com/yearn/ydaemon/common/env" -) - -// init is fired directly on app start and prepare the multicall clients -func TestDaemons(t *testing.T) { - var wg sync.WaitGroup - - //Testing for chainID == 1 - go func(wg *sync.WaitGroup) { - LoadDaemons(1) - SummonDaemons(1) - wg.Done() - }(&wg) - - //Testing for chainID == 4 - go func(wg *sync.WaitGroup) { - LoadDaemons(4) - SummonDaemons(4) - wg.Done() - }(&wg) - - //Testing for chainID == 10 - go func(wg *sync.WaitGroup) { - LoadDaemons(10) - SummonDaemons(10) - wg.Done() - }(&wg) - - //Testing for chainID == 250 - go func(wg *sync.WaitGroup) { - LoadDaemons(250) - SummonDaemons(250) - wg.Done() - }(&wg) - - //Testing for chainID == 42161 - go func(wg *sync.WaitGroup) { - LoadDaemons(42161) - SummonDaemons(42161) - wg.Done() - }(&wg) - wg.Add(5) - wg.Wait() - - //Edge case testing with values overwrite - env.API_V1_BASE_URL = `https://thisisarandomurithatshouldnotbeset.yearn.fi/` - SummonDaemons(1) -} diff --git a/cmd/flags.chains.go b/cmd/flags.chains.go index 0dcbf45f7..c117c729e 100644 --- a/cmd/flags.chains.go +++ b/cmd/flags.chains.go @@ -9,35 +9,21 @@ import ( "github.com/yearn/ydaemon/common/helpers" ) -type arrayFlags []string +type arrayFlags string -var chainFlag arrayFlags - -func (i *arrayFlags) String() string { - defaultSupportedChains := env.SUPPORTED_CHAIN_IDS - supportedChainsString := `` - for _, chainID := range defaultSupportedChains { - supportedChainsString += strconv.FormatUint(chainID, 10) + ` ` - } - supportedChainsString = strings.Trim(supportedChainsString, ` `) - return supportedChainsString -} -func (i *arrayFlags) Set(value string) error { - *i = append(*i, value) - return nil -} - -func handleChainsInitialization() []uint64 { +func handleChainsInitialization(rawChains *string) []uint64 { /********************************************************************************************** ** chainFlag is an array of strings, so we need to convert it to an array of uint64, excluding ** any invalid chain IDs or duplicates. **********************************************************************************************/ - for _, chainIDString := range chainFlag { + chainStr := strings.Split(*rawChains, `,`) + + for _, chainIDString := range chainStr { chainID, err := strconv.ParseUint(chainIDString, 10, 64) if err != nil { continue } - if !helpers.Contains(env.SUPPORTED_CHAIN_IDS, chainID) { + if _, ok := env.CHAINS[chainID]; !ok { continue } if helpers.Contains(chains, chainID) { diff --git a/cmd/flags.go b/cmd/flags.go index be465cd79..9d88b1c2a 100644 --- a/cmd/flags.go +++ b/cmd/flags.go @@ -14,9 +14,9 @@ func initFlags() { /********************************************************************************************** ** Flag group: Chains ** Description: List of chain IDs to run yDaemon for - ** Default: All supported chains (1, 10, 250, 8453, 42161) + ** Default: All supported chains (1, 10, 137, 250, 8453, 42161) **********************************************************************************************/ - flag.Var(&chainFlag, "chains", `List of chain IDs to run yDaemon for: --chains 1 10 250 8453 42161`) + rawChains := flag.String(`chains`, `1,10,137,250,8453,42161`, `List of chain IDs to run yDaemon for: --chains 1,10,137,250,8453,42161`) /********************************************************************************************** ** Flag group: Sentry @@ -44,7 +44,7 @@ func initFlags() { endBlock = nil } - handleChainsInitialization() + handleChainsInitialization(rawChains) handleSentryInitialization() handleProcessInitialization(rawProcess) } diff --git a/cmd/server.go b/cmd/server.go index 2cddc99c7..f1e96bbbe 100755 --- a/cmd/server.go +++ b/cmd/server.go @@ -63,6 +63,7 @@ func NewRouter() *gin.Engine { router.GET(`:chainID/vaults/apy/:address`, c.GetVaultsVisionAPY) router.GET(`:chainID/earned/:address/:vaults`, c.GetEarnedPerVaultPerUser) router.GET(`:chainID/earned/:address`, c.GetEarnedPerUser) + router.GET(`earned/:address`, c.GetEarnedPerUserForAllChains) // Retrieve the strategies for a specific chainID router.GET(`:chainID/strategies/all`, c.GetAllStrategies) diff --git a/cmd/server_test.go b/cmd/server_test.go deleted file mode 100755 index 807c1afcc..000000000 --- a/cmd/server_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package main - -import ( - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestEnvironment(t *testing.T) { - //Init the server as non-blocking mode - go NewRouter().Run() - time.Sleep(3 * time.Second) - - //Init the daemons as blocking mode: we want to wait for them to complete before we continue - SummonDaemons(1) - SummonDaemons(10) - SummonDaemons(250) - SummonDaemons(8453) - SummonDaemons(42161) - - //Testing the reports endpoint - resp, err := http.Get(`http://localhost:8080/250/reports/0xb99d6662127d9A3c68Bc949679f364E1739E2CA1`) - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.StatusCode) - resp, err = http.Get(`http://localhost:8080/hello/reports/0xb99d6662127d9A3c68Bc949679f364E1739E2CA1`) - assert.NoError(t, err) - assert.Equal(t, http.StatusBadRequest, resp.StatusCode) - - //Testing the info/chains route - resp, err = http.Get(`http://localhost:8080/info/chains`) - assert.NoError(t, err) - assert.Equal(t, http.StatusOK, resp.StatusCode) -} diff --git a/cmd/status.go b/cmd/status.go index 53ac01263..a02cf5fdd 100644 --- a/cmd/status.go +++ b/cmd/status.go @@ -5,7 +5,7 @@ import "github.com/yearn/ydaemon/common/env" var STATUS_FOR_CHAINID = map[uint64]string{} func init() { - for _, chainID := range env.SUPPORTED_CHAIN_IDS { + for chainID := range env.CHAINS { setStatusForChainID(chainID, "Not Started") } } diff --git a/common/contracts/ERC4626.go b/common/contracts/ERC4626.go new file mode 100644 index 000000000..3ecaf33d6 --- /dev/null +++ b/common/contracts/ERC4626.go @@ -0,0 +1,2947 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contracts + +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 +) + +// ERC4626MetaData contains all meta data concerning the ERC4626 contract. +var ERC4626MetaData = &bind.MetaData{ + ABI: "[{\"name\":\"Rewards\",\"inputs\":[{\"name\":\"pending\",\"type\":\"uint256\",\"indexed\":false},{\"name\":\"streaming\",\"type\":\"uint256\",\"indexed\":false},{\"name\":\"unlocked\",\"type\":\"uint256\",\"indexed\":false},{\"name\":\"delta\",\"type\":\"int256\",\"indexed\":false}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"SetFeeRate\",\"inputs\":[{\"name\":\"fee_rate\",\"type\":\"uint256\",\"indexed\":false}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"SetHalfTime\",\"inputs\":[{\"name\":\"half_time\",\"type\":\"uint256\",\"indexed\":false}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"PendingManagement\",\"inputs\":[{\"name\":\"management\",\"type\":\"address\",\"indexed\":true}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"SetManagement\",\"inputs\":[{\"name\":\"management\",\"type\":\"address\",\"indexed\":true}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"SetTreasury\",\"inputs\":[{\"name\":\"treasury\",\"type\":\"address\",\"indexed\":true}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"Transfer\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true},{\"name\":\"receiver\",\"type\":\"address\",\"indexed\":true},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"Approval\",\"inputs\":[{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true},{\"name\":\"spender\",\"type\":\"address\",\"indexed\":true},{\"name\":\"value\",\"type\":\"uint256\",\"indexed\":false}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"Deposit\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true},{\"name\":\"assets\",\"type\":\"uint256\",\"indexed\":false},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false}],\"anonymous\":false,\"type\":\"event\"},{\"name\":\"Withdraw\",\"inputs\":[{\"name\":\"sender\",\"type\":\"address\",\"indexed\":true},{\"name\":\"receiver\",\"type\":\"address\",\"indexed\":true},{\"name\":\"owner\",\"type\":\"address\",\"indexed\":true},{\"name\":\"assets\",\"type\":\"uint256\",\"indexed\":false},{\"name\":\"shares\",\"type\":\"uint256\",\"indexed\":false}],\"anonymous\":false,\"type\":\"event\"},{\"stateMutability\":\"nonpayable\",\"type\":\"constructor\",\"inputs\":[{\"name\":\"_asset\",\"type\":\"address\"}],\"outputs\":[]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transfer\",\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferFrom\",\"inputs\":[{\"name\":\"_from\",\"type\":\"address\"},{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"approve\",\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"increaseAllowance\",\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"decreaseAllowance\",\"inputs\":[{\"name\":\"_spender\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalAssets\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"convertToShares\",\"inputs\":[{\"name\":\"_assets\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"convertToAssets\",\"inputs\":[{\"name\":\"_shares\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"maxDeposit\",\"inputs\":[{\"name\":\"_receiver\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"previewDeposit\",\"inputs\":[{\"name\":\"_assets\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"_assets\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"deposit\",\"inputs\":[{\"name\":\"_assets\",\"type\":\"uint256\"},{\"name\":\"_receiver\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"maxMint\",\"inputs\":[{\"name\":\"_receiver\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"previewMint\",\"inputs\":[{\"name\":\"_shares\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"mint\",\"inputs\":[{\"name\":\"_shares\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"mint\",\"inputs\":[{\"name\":\"_shares\",\"type\":\"uint256\"},{\"name\":\"_receiver\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"maxWithdraw\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"previewWithdraw\",\"inputs\":[{\"name\":\"_assets\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"_assets\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"_assets\",\"type\":\"uint256\"},{\"name\":\"_receiver\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"withdraw\",\"inputs\":[{\"name\":\"_assets\",\"type\":\"uint256\"},{\"name\":\"_receiver\",\"type\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"maxRedeem\",\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"previewRedeem\",\"inputs\":[{\"name\":\"_shares\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"redeem\",\"inputs\":[{\"name\":\"_shares\",\"type\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"redeem\",\"inputs\":[{\"name\":\"_shares\",\"type\":\"uint256\"},{\"name\":\"_receiver\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"redeem\",\"inputs\":[{\"name\":\"_shares\",\"type\":\"uint256\"},{\"name\":\"_receiver\",\"type\":\"address\"},{\"name\":\"_owner\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"update_amounts\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"get_amounts\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"int256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"vote_weight\",\"inputs\":[{\"name\":\"_account\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"known\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"rescue\",\"inputs\":[{\"name\":\"_token\",\"type\":\"address\"},{\"name\":\"_receiver\",\"type\":\"address\"}],\"outputs\":[]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"set_performance_fee_rate\",\"inputs\":[{\"name\":\"_fee_rate\",\"type\":\"uint256\"}],\"outputs\":[]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"set_half_time\",\"inputs\":[{\"name\":\"_half_time\",\"type\":\"uint256\"}],\"outputs\":[]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"set_management\",\"inputs\":[{\"name\":\"_management\",\"type\":\"address\"}],\"outputs\":[]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"accept_management\",\"inputs\":[],\"outputs\":[]},{\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"set_treasury\",\"inputs\":[{\"name\":\"_treasury\",\"type\":\"address\"}],\"outputs\":[]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"updated\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"management\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"pending_management\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"performance_fee_rate\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"treasury\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"half_time\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalSupply\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOf\",\"inputs\":[{\"name\":\"arg0\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"allowance\",\"inputs\":[{\"name\":\"arg0\",\"type\":\"address\"},{\"name\":\"arg1\",\"type\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"name\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"symbol\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"string\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"decimals\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\"}]},{\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"asset\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\"}]}]", +} + +// ERC4626ABI is the input ABI used to generate the binding from. +// Deprecated: Use ERC4626MetaData.ABI instead. +var ERC4626ABI = ERC4626MetaData.ABI + +// ERC4626 is an auto generated Go binding around an Ethereum contract. +type ERC4626 struct { + ERC4626Caller // Read-only binding to the contract + ERC4626Transactor // Write-only binding to the contract + ERC4626Filterer // Log filterer for contract events +} + +// ERC4626Caller is an auto generated read-only Go binding around an Ethereum contract. +type ERC4626Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC4626Transactor is an auto generated write-only Go binding around an Ethereum contract. +type ERC4626Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC4626Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type ERC4626Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// ERC4626Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type ERC4626Session struct { + Contract *ERC4626 // 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 +} + +// ERC4626CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type ERC4626CallerSession struct { + Contract *ERC4626Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// ERC4626TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type ERC4626TransactorSession struct { + Contract *ERC4626Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// ERC4626Raw is an auto generated low-level Go binding around an Ethereum contract. +type ERC4626Raw struct { + Contract *ERC4626 // Generic contract binding to access the raw methods on +} + +// ERC4626CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type ERC4626CallerRaw struct { + Contract *ERC4626Caller // Generic read-only contract binding to access the raw methods on +} + +// ERC4626TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type ERC4626TransactorRaw struct { + Contract *ERC4626Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewERC4626 creates a new instance of ERC4626, bound to a specific deployed contract. +func NewERC4626(address common.Address, backend bind.ContractBackend) (*ERC4626, error) { + contract, err := bindERC4626(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &ERC4626{ERC4626Caller: ERC4626Caller{contract: contract}, ERC4626Transactor: ERC4626Transactor{contract: contract}, ERC4626Filterer: ERC4626Filterer{contract: contract}}, nil +} + +// NewERC4626Caller creates a new read-only instance of ERC4626, bound to a specific deployed contract. +func NewERC4626Caller(address common.Address, caller bind.ContractCaller) (*ERC4626Caller, error) { + contract, err := bindERC4626(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &ERC4626Caller{contract: contract}, nil +} + +// NewERC4626Transactor creates a new write-only instance of ERC4626, bound to a specific deployed contract. +func NewERC4626Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC4626Transactor, error) { + contract, err := bindERC4626(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &ERC4626Transactor{contract: contract}, nil +} + +// NewERC4626Filterer creates a new log filterer instance of ERC4626, bound to a specific deployed contract. +func NewERC4626Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC4626Filterer, error) { + contract, err := bindERC4626(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &ERC4626Filterer{contract: contract}, nil +} + +// bindERC4626 binds a generic wrapper to an already deployed contract. +func bindERC4626(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(ERC4626ABI)) + 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 (_ERC4626 *ERC4626Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC4626.Contract.ERC4626Caller.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 (_ERC4626 *ERC4626Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC4626.Contract.ERC4626Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC4626 *ERC4626Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC4626.Contract.ERC4626Transactor.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 (_ERC4626 *ERC4626CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _ERC4626.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 (_ERC4626 *ERC4626TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC4626.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_ERC4626 *ERC4626TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _ERC4626.Contract.contract.Transact(opts, method, params...) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address arg0, address arg1) view returns(uint256) +func (_ERC4626 *ERC4626Caller) Allowance(opts *bind.CallOpts, arg0 common.Address, arg1 common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "allowance", arg0, arg1) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address arg0, address arg1) view returns(uint256) +func (_ERC4626 *ERC4626Session) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _ERC4626.Contract.Allowance(&_ERC4626.CallOpts, arg0, arg1) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address arg0, address arg1) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) Allowance(arg0 common.Address, arg1 common.Address) (*big.Int, error) { + return _ERC4626.Contract.Allowance(&_ERC4626.CallOpts, arg0, arg1) +} + +// Asset is a free data retrieval call binding the contract method 0x38d52e0f. +// +// Solidity: function asset() view returns(address) +func (_ERC4626 *ERC4626Caller) Asset(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "asset") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Asset is a free data retrieval call binding the contract method 0x38d52e0f. +// +// Solidity: function asset() view returns(address) +func (_ERC4626 *ERC4626Session) Asset() (common.Address, error) { + return _ERC4626.Contract.Asset(&_ERC4626.CallOpts) +} + +// Asset is a free data retrieval call binding the contract method 0x38d52e0f. +// +// Solidity: function asset() view returns(address) +func (_ERC4626 *ERC4626CallerSession) Asset() (common.Address, error) { + return _ERC4626.Contract.Asset(&_ERC4626.CallOpts) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address arg0) view returns(uint256) +func (_ERC4626 *ERC4626Caller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "balanceOf", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address arg0) view returns(uint256) +func (_ERC4626 *ERC4626Session) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _ERC4626.Contract.BalanceOf(&_ERC4626.CallOpts, arg0) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address arg0) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { + return _ERC4626.Contract.BalanceOf(&_ERC4626.CallOpts, arg0) +} + +// ConvertToAssets is a free data retrieval call binding the contract method 0x07a2d13a. +// +// Solidity: function convertToAssets(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626Caller) ConvertToAssets(opts *bind.CallOpts, _shares *big.Int) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "convertToAssets", _shares) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ConvertToAssets is a free data retrieval call binding the contract method 0x07a2d13a. +// +// Solidity: function convertToAssets(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626Session) ConvertToAssets(_shares *big.Int) (*big.Int, error) { + return _ERC4626.Contract.ConvertToAssets(&_ERC4626.CallOpts, _shares) +} + +// ConvertToAssets is a free data retrieval call binding the contract method 0x07a2d13a. +// +// Solidity: function convertToAssets(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) ConvertToAssets(_shares *big.Int) (*big.Int, error) { + return _ERC4626.Contract.ConvertToAssets(&_ERC4626.CallOpts, _shares) +} + +// ConvertToShares is a free data retrieval call binding the contract method 0xc6e6f592. +// +// Solidity: function convertToShares(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626Caller) ConvertToShares(opts *bind.CallOpts, _assets *big.Int) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "convertToShares", _assets) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ConvertToShares is a free data retrieval call binding the contract method 0xc6e6f592. +// +// Solidity: function convertToShares(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626Session) ConvertToShares(_assets *big.Int) (*big.Int, error) { + return _ERC4626.Contract.ConvertToShares(&_ERC4626.CallOpts, _assets) +} + +// ConvertToShares is a free data retrieval call binding the contract method 0xc6e6f592. +// +// Solidity: function convertToShares(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) ConvertToShares(_assets *big.Int) (*big.Int, error) { + return _ERC4626.Contract.ConvertToShares(&_ERC4626.CallOpts, _assets) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC4626 *ERC4626Caller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC4626 *ERC4626Session) Decimals() (uint8, error) { + return _ERC4626.Contract.Decimals(&_ERC4626.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_ERC4626 *ERC4626CallerSession) Decimals() (uint8, error) { + return _ERC4626.Contract.Decimals(&_ERC4626.CallOpts) +} + +// GetAmounts is a free data retrieval call binding the contract method 0xccaf0c30. +// +// Solidity: function get_amounts() view returns(uint256, uint256, uint256, uint256, int256) +func (_ERC4626 *ERC4626Caller) GetAmounts(opts *bind.CallOpts) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "get_amounts") + + if err != nil { + return *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + out3 := *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + out4 := *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + + return out0, out1, out2, out3, out4, err + +} + +// GetAmounts is a free data retrieval call binding the contract method 0xccaf0c30. +// +// Solidity: function get_amounts() view returns(uint256, uint256, uint256, uint256, int256) +func (_ERC4626 *ERC4626Session) GetAmounts() (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, error) { + return _ERC4626.Contract.GetAmounts(&_ERC4626.CallOpts) +} + +// GetAmounts is a free data retrieval call binding the contract method 0xccaf0c30. +// +// Solidity: function get_amounts() view returns(uint256, uint256, uint256, uint256, int256) +func (_ERC4626 *ERC4626CallerSession) GetAmounts() (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, error) { + return _ERC4626.Contract.GetAmounts(&_ERC4626.CallOpts) +} + +// HalfTime is a free data retrieval call binding the contract method 0xc5c91533. +// +// Solidity: function half_time() view returns(uint256) +func (_ERC4626 *ERC4626Caller) HalfTime(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "half_time") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// HalfTime is a free data retrieval call binding the contract method 0xc5c91533. +// +// Solidity: function half_time() view returns(uint256) +func (_ERC4626 *ERC4626Session) HalfTime() (*big.Int, error) { + return _ERC4626.Contract.HalfTime(&_ERC4626.CallOpts) +} + +// HalfTime is a free data retrieval call binding the contract method 0xc5c91533. +// +// Solidity: function half_time() view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) HalfTime() (*big.Int, error) { + return _ERC4626.Contract.HalfTime(&_ERC4626.CallOpts) +} + +// Known is a free data retrieval call binding the contract method 0xc445c938. +// +// Solidity: function known() view returns(uint256) +func (_ERC4626 *ERC4626Caller) Known(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "known") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Known is a free data retrieval call binding the contract method 0xc445c938. +// +// Solidity: function known() view returns(uint256) +func (_ERC4626 *ERC4626Session) Known() (*big.Int, error) { + return _ERC4626.Contract.Known(&_ERC4626.CallOpts) +} + +// Known is a free data retrieval call binding the contract method 0xc445c938. +// +// Solidity: function known() view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) Known() (*big.Int, error) { + return _ERC4626.Contract.Known(&_ERC4626.CallOpts) +} + +// Management is a free data retrieval call binding the contract method 0x88a8d602. +// +// Solidity: function management() view returns(address) +func (_ERC4626 *ERC4626Caller) Management(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "management") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Management is a free data retrieval call binding the contract method 0x88a8d602. +// +// Solidity: function management() view returns(address) +func (_ERC4626 *ERC4626Session) Management() (common.Address, error) { + return _ERC4626.Contract.Management(&_ERC4626.CallOpts) +} + +// Management is a free data retrieval call binding the contract method 0x88a8d602. +// +// Solidity: function management() view returns(address) +func (_ERC4626 *ERC4626CallerSession) Management() (common.Address, error) { + return _ERC4626.Contract.Management(&_ERC4626.CallOpts) +} + +// MaxDeposit is a free data retrieval call binding the contract method 0x402d267d. +// +// Solidity: function maxDeposit(address _receiver) view returns(uint256) +func (_ERC4626 *ERC4626Caller) MaxDeposit(opts *bind.CallOpts, _receiver common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "maxDeposit", _receiver) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MaxDeposit is a free data retrieval call binding the contract method 0x402d267d. +// +// Solidity: function maxDeposit(address _receiver) view returns(uint256) +func (_ERC4626 *ERC4626Session) MaxDeposit(_receiver common.Address) (*big.Int, error) { + return _ERC4626.Contract.MaxDeposit(&_ERC4626.CallOpts, _receiver) +} + +// MaxDeposit is a free data retrieval call binding the contract method 0x402d267d. +// +// Solidity: function maxDeposit(address _receiver) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) MaxDeposit(_receiver common.Address) (*big.Int, error) { + return _ERC4626.Contract.MaxDeposit(&_ERC4626.CallOpts, _receiver) +} + +// MaxMint is a free data retrieval call binding the contract method 0xc63d75b6. +// +// Solidity: function maxMint(address _receiver) view returns(uint256) +func (_ERC4626 *ERC4626Caller) MaxMint(opts *bind.CallOpts, _receiver common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "maxMint", _receiver) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MaxMint is a free data retrieval call binding the contract method 0xc63d75b6. +// +// Solidity: function maxMint(address _receiver) view returns(uint256) +func (_ERC4626 *ERC4626Session) MaxMint(_receiver common.Address) (*big.Int, error) { + return _ERC4626.Contract.MaxMint(&_ERC4626.CallOpts, _receiver) +} + +// MaxMint is a free data retrieval call binding the contract method 0xc63d75b6. +// +// Solidity: function maxMint(address _receiver) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) MaxMint(_receiver common.Address) (*big.Int, error) { + return _ERC4626.Contract.MaxMint(&_ERC4626.CallOpts, _receiver) +} + +// MaxRedeem is a free data retrieval call binding the contract method 0xd905777e. +// +// Solidity: function maxRedeem(address _owner) view returns(uint256) +func (_ERC4626 *ERC4626Caller) MaxRedeem(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "maxRedeem", _owner) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MaxRedeem is a free data retrieval call binding the contract method 0xd905777e. +// +// Solidity: function maxRedeem(address _owner) view returns(uint256) +func (_ERC4626 *ERC4626Session) MaxRedeem(_owner common.Address) (*big.Int, error) { + return _ERC4626.Contract.MaxRedeem(&_ERC4626.CallOpts, _owner) +} + +// MaxRedeem is a free data retrieval call binding the contract method 0xd905777e. +// +// Solidity: function maxRedeem(address _owner) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) MaxRedeem(_owner common.Address) (*big.Int, error) { + return _ERC4626.Contract.MaxRedeem(&_ERC4626.CallOpts, _owner) +} + +// MaxWithdraw is a free data retrieval call binding the contract method 0xce96cb77. +// +// Solidity: function maxWithdraw(address _owner) view returns(uint256) +func (_ERC4626 *ERC4626Caller) MaxWithdraw(opts *bind.CallOpts, _owner common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "maxWithdraw", _owner) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MaxWithdraw is a free data retrieval call binding the contract method 0xce96cb77. +// +// Solidity: function maxWithdraw(address _owner) view returns(uint256) +func (_ERC4626 *ERC4626Session) MaxWithdraw(_owner common.Address) (*big.Int, error) { + return _ERC4626.Contract.MaxWithdraw(&_ERC4626.CallOpts, _owner) +} + +// MaxWithdraw is a free data retrieval call binding the contract method 0xce96cb77. +// +// Solidity: function maxWithdraw(address _owner) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) MaxWithdraw(_owner common.Address) (*big.Int, error) { + return _ERC4626.Contract.MaxWithdraw(&_ERC4626.CallOpts, _owner) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC4626 *ERC4626Caller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC4626 *ERC4626Session) Name() (string, error) { + return _ERC4626.Contract.Name(&_ERC4626.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_ERC4626 *ERC4626CallerSession) Name() (string, error) { + return _ERC4626.Contract.Name(&_ERC4626.CallOpts) +} + +// PendingManagement is a free data retrieval call binding the contract method 0x770817ec. +// +// Solidity: function pending_management() view returns(address) +func (_ERC4626 *ERC4626Caller) PendingManagement(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "pending_management") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PendingManagement is a free data retrieval call binding the contract method 0x770817ec. +// +// Solidity: function pending_management() view returns(address) +func (_ERC4626 *ERC4626Session) PendingManagement() (common.Address, error) { + return _ERC4626.Contract.PendingManagement(&_ERC4626.CallOpts) +} + +// PendingManagement is a free data retrieval call binding the contract method 0x770817ec. +// +// Solidity: function pending_management() view returns(address) +func (_ERC4626 *ERC4626CallerSession) PendingManagement() (common.Address, error) { + return _ERC4626.Contract.PendingManagement(&_ERC4626.CallOpts) +} + +// PerformanceFeeRate is a free data retrieval call binding the contract method 0x18f7b782. +// +// Solidity: function performance_fee_rate() view returns(uint256) +func (_ERC4626 *ERC4626Caller) PerformanceFeeRate(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "performance_fee_rate") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PerformanceFeeRate is a free data retrieval call binding the contract method 0x18f7b782. +// +// Solidity: function performance_fee_rate() view returns(uint256) +func (_ERC4626 *ERC4626Session) PerformanceFeeRate() (*big.Int, error) { + return _ERC4626.Contract.PerformanceFeeRate(&_ERC4626.CallOpts) +} + +// PerformanceFeeRate is a free data retrieval call binding the contract method 0x18f7b782. +// +// Solidity: function performance_fee_rate() view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) PerformanceFeeRate() (*big.Int, error) { + return _ERC4626.Contract.PerformanceFeeRate(&_ERC4626.CallOpts) +} + +// PreviewDeposit is a free data retrieval call binding the contract method 0xef8b30f7. +// +// Solidity: function previewDeposit(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626Caller) PreviewDeposit(opts *bind.CallOpts, _assets *big.Int) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "previewDeposit", _assets) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PreviewDeposit is a free data retrieval call binding the contract method 0xef8b30f7. +// +// Solidity: function previewDeposit(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626Session) PreviewDeposit(_assets *big.Int) (*big.Int, error) { + return _ERC4626.Contract.PreviewDeposit(&_ERC4626.CallOpts, _assets) +} + +// PreviewDeposit is a free data retrieval call binding the contract method 0xef8b30f7. +// +// Solidity: function previewDeposit(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) PreviewDeposit(_assets *big.Int) (*big.Int, error) { + return _ERC4626.Contract.PreviewDeposit(&_ERC4626.CallOpts, _assets) +} + +// PreviewMint is a free data retrieval call binding the contract method 0xb3d7f6b9. +// +// Solidity: function previewMint(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626Caller) PreviewMint(opts *bind.CallOpts, _shares *big.Int) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "previewMint", _shares) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PreviewMint is a free data retrieval call binding the contract method 0xb3d7f6b9. +// +// Solidity: function previewMint(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626Session) PreviewMint(_shares *big.Int) (*big.Int, error) { + return _ERC4626.Contract.PreviewMint(&_ERC4626.CallOpts, _shares) +} + +// PreviewMint is a free data retrieval call binding the contract method 0xb3d7f6b9. +// +// Solidity: function previewMint(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) PreviewMint(_shares *big.Int) (*big.Int, error) { + return _ERC4626.Contract.PreviewMint(&_ERC4626.CallOpts, _shares) +} + +// PreviewRedeem is a free data retrieval call binding the contract method 0x4cdad506. +// +// Solidity: function previewRedeem(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626Caller) PreviewRedeem(opts *bind.CallOpts, _shares *big.Int) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "previewRedeem", _shares) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PreviewRedeem is a free data retrieval call binding the contract method 0x4cdad506. +// +// Solidity: function previewRedeem(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626Session) PreviewRedeem(_shares *big.Int) (*big.Int, error) { + return _ERC4626.Contract.PreviewRedeem(&_ERC4626.CallOpts, _shares) +} + +// PreviewRedeem is a free data retrieval call binding the contract method 0x4cdad506. +// +// Solidity: function previewRedeem(uint256 _shares) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) PreviewRedeem(_shares *big.Int) (*big.Int, error) { + return _ERC4626.Contract.PreviewRedeem(&_ERC4626.CallOpts, _shares) +} + +// PreviewWithdraw is a free data retrieval call binding the contract method 0x0a28a477. +// +// Solidity: function previewWithdraw(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626Caller) PreviewWithdraw(opts *bind.CallOpts, _assets *big.Int) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "previewWithdraw", _assets) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// PreviewWithdraw is a free data retrieval call binding the contract method 0x0a28a477. +// +// Solidity: function previewWithdraw(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626Session) PreviewWithdraw(_assets *big.Int) (*big.Int, error) { + return _ERC4626.Contract.PreviewWithdraw(&_ERC4626.CallOpts, _assets) +} + +// PreviewWithdraw is a free data retrieval call binding the contract method 0x0a28a477. +// +// Solidity: function previewWithdraw(uint256 _assets) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) PreviewWithdraw(_assets *big.Int) (*big.Int, error) { + return _ERC4626.Contract.PreviewWithdraw(&_ERC4626.CallOpts, _assets) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC4626 *ERC4626Caller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC4626 *ERC4626Session) Symbol() (string, error) { + return _ERC4626.Contract.Symbol(&_ERC4626.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_ERC4626 *ERC4626CallerSession) Symbol() (string, error) { + return _ERC4626.Contract.Symbol(&_ERC4626.CallOpts) +} + +// TotalAssets is a free data retrieval call binding the contract method 0x01e1d114. +// +// Solidity: function totalAssets() view returns(uint256) +func (_ERC4626 *ERC4626Caller) TotalAssets(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "totalAssets") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalAssets is a free data retrieval call binding the contract method 0x01e1d114. +// +// Solidity: function totalAssets() view returns(uint256) +func (_ERC4626 *ERC4626Session) TotalAssets() (*big.Int, error) { + return _ERC4626.Contract.TotalAssets(&_ERC4626.CallOpts) +} + +// TotalAssets is a free data retrieval call binding the contract method 0x01e1d114. +// +// Solidity: function totalAssets() view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) TotalAssets() (*big.Int, error) { + return _ERC4626.Contract.TotalAssets(&_ERC4626.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC4626 *ERC4626Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC4626 *ERC4626Session) TotalSupply() (*big.Int, error) { + return _ERC4626.Contract.TotalSupply(&_ERC4626.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) TotalSupply() (*big.Int, error) { + return _ERC4626.Contract.TotalSupply(&_ERC4626.CallOpts) +} + +// Treasury is a free data retrieval call binding the contract method 0x61d027b3. +// +// Solidity: function treasury() view returns(address) +func (_ERC4626 *ERC4626Caller) Treasury(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "treasury") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Treasury is a free data retrieval call binding the contract method 0x61d027b3. +// +// Solidity: function treasury() view returns(address) +func (_ERC4626 *ERC4626Session) Treasury() (common.Address, error) { + return _ERC4626.Contract.Treasury(&_ERC4626.CallOpts) +} + +// Treasury is a free data retrieval call binding the contract method 0x61d027b3. +// +// Solidity: function treasury() view returns(address) +func (_ERC4626 *ERC4626CallerSession) Treasury() (common.Address, error) { + return _ERC4626.Contract.Treasury(&_ERC4626.CallOpts) +} + +// Updated is a free data retrieval call binding the contract method 0x7b2aab03. +// +// Solidity: function updated() view returns(uint256) +func (_ERC4626 *ERC4626Caller) Updated(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "updated") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Updated is a free data retrieval call binding the contract method 0x7b2aab03. +// +// Solidity: function updated() view returns(uint256) +func (_ERC4626 *ERC4626Session) Updated() (*big.Int, error) { + return _ERC4626.Contract.Updated(&_ERC4626.CallOpts) +} + +// Updated is a free data retrieval call binding the contract method 0x7b2aab03. +// +// Solidity: function updated() view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) Updated() (*big.Int, error) { + return _ERC4626.Contract.Updated(&_ERC4626.CallOpts) +} + +// VoteWeight is a free data retrieval call binding the contract method 0xf49ec310. +// +// Solidity: function vote_weight(address _account) view returns(uint256) +func (_ERC4626 *ERC4626Caller) VoteWeight(opts *bind.CallOpts, _account common.Address) (*big.Int, error) { + var out []interface{} + err := _ERC4626.contract.Call(opts, &out, "vote_weight", _account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// VoteWeight is a free data retrieval call binding the contract method 0xf49ec310. +// +// Solidity: function vote_weight(address _account) view returns(uint256) +func (_ERC4626 *ERC4626Session) VoteWeight(_account common.Address) (*big.Int, error) { + return _ERC4626.Contract.VoteWeight(&_ERC4626.CallOpts, _account) +} + +// VoteWeight is a free data retrieval call binding the contract method 0xf49ec310. +// +// Solidity: function vote_weight(address _account) view returns(uint256) +func (_ERC4626 *ERC4626CallerSession) VoteWeight(_account common.Address) (*big.Int, error) { + return _ERC4626.Contract.VoteWeight(&_ERC4626.CallOpts, _account) +} + +// AcceptManagement is a paid mutator transaction binding the contract method 0x759be10c. +// +// Solidity: function accept_management() returns() +func (_ERC4626 *ERC4626Transactor) AcceptManagement(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "accept_management") +} + +// AcceptManagement is a paid mutator transaction binding the contract method 0x759be10c. +// +// Solidity: function accept_management() returns() +func (_ERC4626 *ERC4626Session) AcceptManagement() (*types.Transaction, error) { + return _ERC4626.Contract.AcceptManagement(&_ERC4626.TransactOpts) +} + +// AcceptManagement is a paid mutator transaction binding the contract method 0x759be10c. +// +// Solidity: function accept_management() returns() +func (_ERC4626 *ERC4626TransactorSession) AcceptManagement() (*types.Transaction, error) { + return _ERC4626.Contract.AcceptManagement(&_ERC4626.TransactOpts) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Transactor) Approve(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "approve", _spender, _value) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Session) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Approve(&_ERC4626.TransactOpts, _spender, _value) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626TransactorSession) Approve(_spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Approve(&_ERC4626.TransactOpts, _spender, _value) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Transactor) DecreaseAllowance(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "decreaseAllowance", _spender, _value) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Session) DecreaseAllowance(_spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.DecreaseAllowance(&_ERC4626.TransactOpts, _spender, _value) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626TransactorSession) DecreaseAllowance(_spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.DecreaseAllowance(&_ERC4626.TransactOpts, _spender, _value) +} + +// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. +// +// Solidity: function deposit(uint256 _assets) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Deposit(opts *bind.TransactOpts, _assets *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "deposit", _assets) +} + +// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. +// +// Solidity: function deposit(uint256 _assets) returns(uint256) +func (_ERC4626 *ERC4626Session) Deposit(_assets *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Deposit(&_ERC4626.TransactOpts, _assets) +} + +// Deposit is a paid mutator transaction binding the contract method 0xb6b55f25. +// +// Solidity: function deposit(uint256 _assets) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Deposit(_assets *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Deposit(&_ERC4626.TransactOpts, _assets) +} + +// Deposit0 is a paid mutator transaction binding the contract method 0x6e553f65. +// +// Solidity: function deposit(uint256 _assets, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Deposit0(opts *bind.TransactOpts, _assets *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "deposit0", _assets, _receiver) +} + +// Deposit0 is a paid mutator transaction binding the contract method 0x6e553f65. +// +// Solidity: function deposit(uint256 _assets, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626Session) Deposit0(_assets *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Deposit0(&_ERC4626.TransactOpts, _assets, _receiver) +} + +// Deposit0 is a paid mutator transaction binding the contract method 0x6e553f65. +// +// Solidity: function deposit(uint256 _assets, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Deposit0(_assets *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Deposit0(&_ERC4626.TransactOpts, _assets, _receiver) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Transactor) IncreaseAllowance(opts *bind.TransactOpts, _spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "increaseAllowance", _spender, _value) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Session) IncreaseAllowance(_spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.IncreaseAllowance(&_ERC4626.TransactOpts, _spender, _value) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address _spender, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626TransactorSession) IncreaseAllowance(_spender common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.IncreaseAllowance(&_ERC4626.TransactOpts, _spender, _value) +} + +// Mint is a paid mutator transaction binding the contract method 0xa0712d68. +// +// Solidity: function mint(uint256 _shares) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Mint(opts *bind.TransactOpts, _shares *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "mint", _shares) +} + +// Mint is a paid mutator transaction binding the contract method 0xa0712d68. +// +// Solidity: function mint(uint256 _shares) returns(uint256) +func (_ERC4626 *ERC4626Session) Mint(_shares *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Mint(&_ERC4626.TransactOpts, _shares) +} + +// Mint is a paid mutator transaction binding the contract method 0xa0712d68. +// +// Solidity: function mint(uint256 _shares) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Mint(_shares *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Mint(&_ERC4626.TransactOpts, _shares) +} + +// Mint0 is a paid mutator transaction binding the contract method 0x94bf804d. +// +// Solidity: function mint(uint256 _shares, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Mint0(opts *bind.TransactOpts, _shares *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "mint0", _shares, _receiver) +} + +// Mint0 is a paid mutator transaction binding the contract method 0x94bf804d. +// +// Solidity: function mint(uint256 _shares, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626Session) Mint0(_shares *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Mint0(&_ERC4626.TransactOpts, _shares, _receiver) +} + +// Mint0 is a paid mutator transaction binding the contract method 0x94bf804d. +// +// Solidity: function mint(uint256 _shares, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Mint0(_shares *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Mint0(&_ERC4626.TransactOpts, _shares, _receiver) +} + +// Redeem is a paid mutator transaction binding the contract method 0xdb006a75. +// +// Solidity: function redeem(uint256 _shares) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Redeem(opts *bind.TransactOpts, _shares *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "redeem", _shares) +} + +// Redeem is a paid mutator transaction binding the contract method 0xdb006a75. +// +// Solidity: function redeem(uint256 _shares) returns(uint256) +func (_ERC4626 *ERC4626Session) Redeem(_shares *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Redeem(&_ERC4626.TransactOpts, _shares) +} + +// Redeem is a paid mutator transaction binding the contract method 0xdb006a75. +// +// Solidity: function redeem(uint256 _shares) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Redeem(_shares *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Redeem(&_ERC4626.TransactOpts, _shares) +} + +// Redeem0 is a paid mutator transaction binding the contract method 0x7bde82f2. +// +// Solidity: function redeem(uint256 _shares, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Redeem0(opts *bind.TransactOpts, _shares *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "redeem0", _shares, _receiver) +} + +// Redeem0 is a paid mutator transaction binding the contract method 0x7bde82f2. +// +// Solidity: function redeem(uint256 _shares, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626Session) Redeem0(_shares *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Redeem0(&_ERC4626.TransactOpts, _shares, _receiver) +} + +// Redeem0 is a paid mutator transaction binding the contract method 0x7bde82f2. +// +// Solidity: function redeem(uint256 _shares, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Redeem0(_shares *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Redeem0(&_ERC4626.TransactOpts, _shares, _receiver) +} + +// Redeem1 is a paid mutator transaction binding the contract method 0xba087652. +// +// Solidity: function redeem(uint256 _shares, address _receiver, address _owner) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Redeem1(opts *bind.TransactOpts, _shares *big.Int, _receiver common.Address, _owner common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "redeem1", _shares, _receiver, _owner) +} + +// Redeem1 is a paid mutator transaction binding the contract method 0xba087652. +// +// Solidity: function redeem(uint256 _shares, address _receiver, address _owner) returns(uint256) +func (_ERC4626 *ERC4626Session) Redeem1(_shares *big.Int, _receiver common.Address, _owner common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Redeem1(&_ERC4626.TransactOpts, _shares, _receiver, _owner) +} + +// Redeem1 is a paid mutator transaction binding the contract method 0xba087652. +// +// Solidity: function redeem(uint256 _shares, address _receiver, address _owner) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Redeem1(_shares *big.Int, _receiver common.Address, _owner common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Redeem1(&_ERC4626.TransactOpts, _shares, _receiver, _owner) +} + +// Rescue is a paid mutator transaction binding the contract method 0x4fdf5d1d. +// +// Solidity: function rescue(address _token, address _receiver) returns() +func (_ERC4626 *ERC4626Transactor) Rescue(opts *bind.TransactOpts, _token common.Address, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "rescue", _token, _receiver) +} + +// Rescue is a paid mutator transaction binding the contract method 0x4fdf5d1d. +// +// Solidity: function rescue(address _token, address _receiver) returns() +func (_ERC4626 *ERC4626Session) Rescue(_token common.Address, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Rescue(&_ERC4626.TransactOpts, _token, _receiver) +} + +// Rescue is a paid mutator transaction binding the contract method 0x4fdf5d1d. +// +// Solidity: function rescue(address _token, address _receiver) returns() +func (_ERC4626 *ERC4626TransactorSession) Rescue(_token common.Address, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Rescue(&_ERC4626.TransactOpts, _token, _receiver) +} + +// SetHalfTime is a paid mutator transaction binding the contract method 0x1bf93f86. +// +// Solidity: function set_half_time(uint256 _half_time) returns() +func (_ERC4626 *ERC4626Transactor) SetHalfTime(opts *bind.TransactOpts, _half_time *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "set_half_time", _half_time) +} + +// SetHalfTime is a paid mutator transaction binding the contract method 0x1bf93f86. +// +// Solidity: function set_half_time(uint256 _half_time) returns() +func (_ERC4626 *ERC4626Session) SetHalfTime(_half_time *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.SetHalfTime(&_ERC4626.TransactOpts, _half_time) +} + +// SetHalfTime is a paid mutator transaction binding the contract method 0x1bf93f86. +// +// Solidity: function set_half_time(uint256 _half_time) returns() +func (_ERC4626 *ERC4626TransactorSession) SetHalfTime(_half_time *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.SetHalfTime(&_ERC4626.TransactOpts, _half_time) +} + +// SetManagement is a paid mutator transaction binding the contract method 0xfd066ecc. +// +// Solidity: function set_management(address _management) returns() +func (_ERC4626 *ERC4626Transactor) SetManagement(opts *bind.TransactOpts, _management common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "set_management", _management) +} + +// SetManagement is a paid mutator transaction binding the contract method 0xfd066ecc. +// +// Solidity: function set_management(address _management) returns() +func (_ERC4626 *ERC4626Session) SetManagement(_management common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.SetManagement(&_ERC4626.TransactOpts, _management) +} + +// SetManagement is a paid mutator transaction binding the contract method 0xfd066ecc. +// +// Solidity: function set_management(address _management) returns() +func (_ERC4626 *ERC4626TransactorSession) SetManagement(_management common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.SetManagement(&_ERC4626.TransactOpts, _management) +} + +// SetPerformanceFeeRate is a paid mutator transaction binding the contract method 0x3047ce9d. +// +// Solidity: function set_performance_fee_rate(uint256 _fee_rate) returns() +func (_ERC4626 *ERC4626Transactor) SetPerformanceFeeRate(opts *bind.TransactOpts, _fee_rate *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "set_performance_fee_rate", _fee_rate) +} + +// SetPerformanceFeeRate is a paid mutator transaction binding the contract method 0x3047ce9d. +// +// Solidity: function set_performance_fee_rate(uint256 _fee_rate) returns() +func (_ERC4626 *ERC4626Session) SetPerformanceFeeRate(_fee_rate *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.SetPerformanceFeeRate(&_ERC4626.TransactOpts, _fee_rate) +} + +// SetPerformanceFeeRate is a paid mutator transaction binding the contract method 0x3047ce9d. +// +// Solidity: function set_performance_fee_rate(uint256 _fee_rate) returns() +func (_ERC4626 *ERC4626TransactorSession) SetPerformanceFeeRate(_fee_rate *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.SetPerformanceFeeRate(&_ERC4626.TransactOpts, _fee_rate) +} + +// SetTreasury is a paid mutator transaction binding the contract method 0x30bcd67b. +// +// Solidity: function set_treasury(address _treasury) returns() +func (_ERC4626 *ERC4626Transactor) SetTreasury(opts *bind.TransactOpts, _treasury common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "set_treasury", _treasury) +} + +// SetTreasury is a paid mutator transaction binding the contract method 0x30bcd67b. +// +// Solidity: function set_treasury(address _treasury) returns() +func (_ERC4626 *ERC4626Session) SetTreasury(_treasury common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.SetTreasury(&_ERC4626.TransactOpts, _treasury) +} + +// SetTreasury is a paid mutator transaction binding the contract method 0x30bcd67b. +// +// Solidity: function set_treasury(address _treasury) returns() +func (_ERC4626 *ERC4626TransactorSession) SetTreasury(_treasury common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.SetTreasury(&_ERC4626.TransactOpts, _treasury) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address _to, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Transactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "transfer", _to, _value) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address _to, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Session) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Transfer(&_ERC4626.TransactOpts, _to, _value) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address _to, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626TransactorSession) Transfer(_to common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Transfer(&_ERC4626.TransactOpts, _to, _value) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Transactor) TransferFrom(opts *bind.TransactOpts, _from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "transferFrom", _from, _to, _value) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626Session) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.TransferFrom(&_ERC4626.TransactOpts, _from, _to, _value) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address _from, address _to, uint256 _value) returns(bool) +func (_ERC4626 *ERC4626TransactorSession) TransferFrom(_from common.Address, _to common.Address, _value *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.TransferFrom(&_ERC4626.TransactOpts, _from, _to, _value) +} + +// UpdateAmounts is a paid mutator transaction binding the contract method 0x3ee352fc. +// +// Solidity: function update_amounts() returns(uint256, uint256, uint256) +func (_ERC4626 *ERC4626Transactor) UpdateAmounts(opts *bind.TransactOpts) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "update_amounts") +} + +// UpdateAmounts is a paid mutator transaction binding the contract method 0x3ee352fc. +// +// Solidity: function update_amounts() returns(uint256, uint256, uint256) +func (_ERC4626 *ERC4626Session) UpdateAmounts() (*types.Transaction, error) { + return _ERC4626.Contract.UpdateAmounts(&_ERC4626.TransactOpts) +} + +// UpdateAmounts is a paid mutator transaction binding the contract method 0x3ee352fc. +// +// Solidity: function update_amounts() returns(uint256, uint256, uint256) +func (_ERC4626 *ERC4626TransactorSession) UpdateAmounts() (*types.Transaction, error) { + return _ERC4626.Contract.UpdateAmounts(&_ERC4626.TransactOpts) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 _assets) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Withdraw(opts *bind.TransactOpts, _assets *big.Int) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "withdraw", _assets) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 _assets) returns(uint256) +func (_ERC4626 *ERC4626Session) Withdraw(_assets *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Withdraw(&_ERC4626.TransactOpts, _assets) +} + +// Withdraw is a paid mutator transaction binding the contract method 0x2e1a7d4d. +// +// Solidity: function withdraw(uint256 _assets) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Withdraw(_assets *big.Int) (*types.Transaction, error) { + return _ERC4626.Contract.Withdraw(&_ERC4626.TransactOpts, _assets) +} + +// Withdraw0 is a paid mutator transaction binding the contract method 0x00f714ce. +// +// Solidity: function withdraw(uint256 _assets, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Withdraw0(opts *bind.TransactOpts, _assets *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "withdraw0", _assets, _receiver) +} + +// Withdraw0 is a paid mutator transaction binding the contract method 0x00f714ce. +// +// Solidity: function withdraw(uint256 _assets, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626Session) Withdraw0(_assets *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Withdraw0(&_ERC4626.TransactOpts, _assets, _receiver) +} + +// Withdraw0 is a paid mutator transaction binding the contract method 0x00f714ce. +// +// Solidity: function withdraw(uint256 _assets, address _receiver) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Withdraw0(_assets *big.Int, _receiver common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Withdraw0(&_ERC4626.TransactOpts, _assets, _receiver) +} + +// Withdraw1 is a paid mutator transaction binding the contract method 0xb460af94. +// +// Solidity: function withdraw(uint256 _assets, address _receiver, address _owner) returns(uint256) +func (_ERC4626 *ERC4626Transactor) Withdraw1(opts *bind.TransactOpts, _assets *big.Int, _receiver common.Address, _owner common.Address) (*types.Transaction, error) { + return _ERC4626.contract.Transact(opts, "withdraw1", _assets, _receiver, _owner) +} + +// Withdraw1 is a paid mutator transaction binding the contract method 0xb460af94. +// +// Solidity: function withdraw(uint256 _assets, address _receiver, address _owner) returns(uint256) +func (_ERC4626 *ERC4626Session) Withdraw1(_assets *big.Int, _receiver common.Address, _owner common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Withdraw1(&_ERC4626.TransactOpts, _assets, _receiver, _owner) +} + +// Withdraw1 is a paid mutator transaction binding the contract method 0xb460af94. +// +// Solidity: function withdraw(uint256 _assets, address _receiver, address _owner) returns(uint256) +func (_ERC4626 *ERC4626TransactorSession) Withdraw1(_assets *big.Int, _receiver common.Address, _owner common.Address) (*types.Transaction, error) { + return _ERC4626.Contract.Withdraw1(&_ERC4626.TransactOpts, _assets, _receiver, _owner) +} + +// ERC4626ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the ERC4626 contract. +type ERC4626ApprovalIterator struct { + Event *ERC4626Approval // 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 *ERC4626ApprovalIterator) 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(ERC4626Approval) + 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(ERC4626Approval) + 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 *ERC4626ApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626ApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626Approval represents a Approval event raised by the ERC4626 contract. +type ERC4626Approval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC4626 *ERC4626Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*ERC4626ApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &ERC4626ApprovalIterator{contract: _ERC4626.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC4626 *ERC4626Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *ERC4626Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(ERC4626Approval) + if err := _ERC4626.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_ERC4626 *ERC4626Filterer) ParseApproval(log types.Log) (*ERC4626Approval, error) { + event := new(ERC4626Approval) + if err := _ERC4626.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626DepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the ERC4626 contract. +type ERC4626DepositIterator struct { + Event *ERC4626Deposit // 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 *ERC4626DepositIterator) 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(ERC4626Deposit) + 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(ERC4626Deposit) + 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 *ERC4626DepositIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626DepositIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626Deposit represents a Deposit event raised by the ERC4626 contract. +type ERC4626Deposit struct { + Sender common.Address + Owner common.Address + Assets *big.Int + Shares *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDeposit is a free log retrieval operation binding the contract event 0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7. +// +// Solidity: event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares) +func (_ERC4626 *ERC4626Filterer) FilterDeposit(opts *bind.FilterOpts, sender []common.Address, owner []common.Address) (*ERC4626DepositIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "Deposit", senderRule, ownerRule) + if err != nil { + return nil, err + } + return &ERC4626DepositIterator{contract: _ERC4626.contract, event: "Deposit", logs: logs, sub: sub}, nil +} + +// WatchDeposit is a free log subscription operation binding the contract event 0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7. +// +// Solidity: event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares) +func (_ERC4626 *ERC4626Filterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *ERC4626Deposit, sender []common.Address, owner []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "Deposit", senderRule, ownerRule) + 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(ERC4626Deposit) + if err := _ERC4626.contract.UnpackLog(event, "Deposit", 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 +} + +// ParseDeposit is a log parse operation binding the contract event 0xdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7. +// +// Solidity: event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares) +func (_ERC4626 *ERC4626Filterer) ParseDeposit(log types.Log) (*ERC4626Deposit, error) { + event := new(ERC4626Deposit) + if err := _ERC4626.contract.UnpackLog(event, "Deposit", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626PendingManagementIterator is returned from FilterPendingManagement and is used to iterate over the raw logs and unpacked data for PendingManagement events raised by the ERC4626 contract. +type ERC4626PendingManagementIterator struct { + Event *ERC4626PendingManagement // 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 *ERC4626PendingManagementIterator) 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(ERC4626PendingManagement) + 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(ERC4626PendingManagement) + 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 *ERC4626PendingManagementIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626PendingManagementIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626PendingManagement represents a PendingManagement event raised by the ERC4626 contract. +type ERC4626PendingManagement struct { + Management common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPendingManagement is a free log retrieval operation binding the contract event 0xe7b5cc087e6e47e33e86bdfe4720b7e849891938b18ff6e0c3f92299de79e60c. +// +// Solidity: event PendingManagement(address indexed management) +func (_ERC4626 *ERC4626Filterer) FilterPendingManagement(opts *bind.FilterOpts, management []common.Address) (*ERC4626PendingManagementIterator, error) { + + var managementRule []interface{} + for _, managementItem := range management { + managementRule = append(managementRule, managementItem) + } + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "PendingManagement", managementRule) + if err != nil { + return nil, err + } + return &ERC4626PendingManagementIterator{contract: _ERC4626.contract, event: "PendingManagement", logs: logs, sub: sub}, nil +} + +// WatchPendingManagement is a free log subscription operation binding the contract event 0xe7b5cc087e6e47e33e86bdfe4720b7e849891938b18ff6e0c3f92299de79e60c. +// +// Solidity: event PendingManagement(address indexed management) +func (_ERC4626 *ERC4626Filterer) WatchPendingManagement(opts *bind.WatchOpts, sink chan<- *ERC4626PendingManagement, management []common.Address) (event.Subscription, error) { + + var managementRule []interface{} + for _, managementItem := range management { + managementRule = append(managementRule, managementItem) + } + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "PendingManagement", managementRule) + 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(ERC4626PendingManagement) + if err := _ERC4626.contract.UnpackLog(event, "PendingManagement", 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 +} + +// ParsePendingManagement is a log parse operation binding the contract event 0xe7b5cc087e6e47e33e86bdfe4720b7e849891938b18ff6e0c3f92299de79e60c. +// +// Solidity: event PendingManagement(address indexed management) +func (_ERC4626 *ERC4626Filterer) ParsePendingManagement(log types.Log) (*ERC4626PendingManagement, error) { + event := new(ERC4626PendingManagement) + if err := _ERC4626.contract.UnpackLog(event, "PendingManagement", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626RewardsIterator is returned from FilterRewards and is used to iterate over the raw logs and unpacked data for Rewards events raised by the ERC4626 contract. +type ERC4626RewardsIterator struct { + Event *ERC4626Rewards // 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 *ERC4626RewardsIterator) 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(ERC4626Rewards) + 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(ERC4626Rewards) + 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 *ERC4626RewardsIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626RewardsIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626Rewards represents a Rewards event raised by the ERC4626 contract. +type ERC4626Rewards struct { + Pending *big.Int + Streaming *big.Int + Unlocked *big.Int + Delta *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRewards is a free log retrieval operation binding the contract event 0xabf5b9a9abf080b67be5bfa614a827845afc366da18173be4db7bf2761f2517e. +// +// Solidity: event Rewards(uint256 pending, uint256 streaming, uint256 unlocked, int256 delta) +func (_ERC4626 *ERC4626Filterer) FilterRewards(opts *bind.FilterOpts) (*ERC4626RewardsIterator, error) { + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "Rewards") + if err != nil { + return nil, err + } + return &ERC4626RewardsIterator{contract: _ERC4626.contract, event: "Rewards", logs: logs, sub: sub}, nil +} + +// WatchRewards is a free log subscription operation binding the contract event 0xabf5b9a9abf080b67be5bfa614a827845afc366da18173be4db7bf2761f2517e. +// +// Solidity: event Rewards(uint256 pending, uint256 streaming, uint256 unlocked, int256 delta) +func (_ERC4626 *ERC4626Filterer) WatchRewards(opts *bind.WatchOpts, sink chan<- *ERC4626Rewards) (event.Subscription, error) { + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "Rewards") + 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(ERC4626Rewards) + if err := _ERC4626.contract.UnpackLog(event, "Rewards", 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 +} + +// ParseRewards is a log parse operation binding the contract event 0xabf5b9a9abf080b67be5bfa614a827845afc366da18173be4db7bf2761f2517e. +// +// Solidity: event Rewards(uint256 pending, uint256 streaming, uint256 unlocked, int256 delta) +func (_ERC4626 *ERC4626Filterer) ParseRewards(log types.Log) (*ERC4626Rewards, error) { + event := new(ERC4626Rewards) + if err := _ERC4626.contract.UnpackLog(event, "Rewards", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626SetFeeRateIterator is returned from FilterSetFeeRate and is used to iterate over the raw logs and unpacked data for SetFeeRate events raised by the ERC4626 contract. +type ERC4626SetFeeRateIterator struct { + Event *ERC4626SetFeeRate // 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 *ERC4626SetFeeRateIterator) 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(ERC4626SetFeeRate) + 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(ERC4626SetFeeRate) + 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 *ERC4626SetFeeRateIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626SetFeeRateIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626SetFeeRate represents a SetFeeRate event raised by the ERC4626 contract. +type ERC4626SetFeeRate struct { + FeeRate *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetFeeRate is a free log retrieval operation binding the contract event 0x6717373928cccf59cc9912055cfa8db86e7085b95c94c15862b121114aa333be. +// +// Solidity: event SetFeeRate(uint256 fee_rate) +func (_ERC4626 *ERC4626Filterer) FilterSetFeeRate(opts *bind.FilterOpts) (*ERC4626SetFeeRateIterator, error) { + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "SetFeeRate") + if err != nil { + return nil, err + } + return &ERC4626SetFeeRateIterator{contract: _ERC4626.contract, event: "SetFeeRate", logs: logs, sub: sub}, nil +} + +// WatchSetFeeRate is a free log subscription operation binding the contract event 0x6717373928cccf59cc9912055cfa8db86e7085b95c94c15862b121114aa333be. +// +// Solidity: event SetFeeRate(uint256 fee_rate) +func (_ERC4626 *ERC4626Filterer) WatchSetFeeRate(opts *bind.WatchOpts, sink chan<- *ERC4626SetFeeRate) (event.Subscription, error) { + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "SetFeeRate") + 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(ERC4626SetFeeRate) + if err := _ERC4626.contract.UnpackLog(event, "SetFeeRate", 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 +} + +// ParseSetFeeRate is a log parse operation binding the contract event 0x6717373928cccf59cc9912055cfa8db86e7085b95c94c15862b121114aa333be. +// +// Solidity: event SetFeeRate(uint256 fee_rate) +func (_ERC4626 *ERC4626Filterer) ParseSetFeeRate(log types.Log) (*ERC4626SetFeeRate, error) { + event := new(ERC4626SetFeeRate) + if err := _ERC4626.contract.UnpackLog(event, "SetFeeRate", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626SetHalfTimeIterator is returned from FilterSetHalfTime and is used to iterate over the raw logs and unpacked data for SetHalfTime events raised by the ERC4626 contract. +type ERC4626SetHalfTimeIterator struct { + Event *ERC4626SetHalfTime // 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 *ERC4626SetHalfTimeIterator) 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(ERC4626SetHalfTime) + 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(ERC4626SetHalfTime) + 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 *ERC4626SetHalfTimeIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626SetHalfTimeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626SetHalfTime represents a SetHalfTime event raised by the ERC4626 contract. +type ERC4626SetHalfTime struct { + HalfTime *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetHalfTime is a free log retrieval operation binding the contract event 0xa1eced997ca08ff4a574f4f14ce5dfcb37e8bde7f90a609f48f0c86edf1224ee. +// +// Solidity: event SetHalfTime(uint256 half_time) +func (_ERC4626 *ERC4626Filterer) FilterSetHalfTime(opts *bind.FilterOpts) (*ERC4626SetHalfTimeIterator, error) { + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "SetHalfTime") + if err != nil { + return nil, err + } + return &ERC4626SetHalfTimeIterator{contract: _ERC4626.contract, event: "SetHalfTime", logs: logs, sub: sub}, nil +} + +// WatchSetHalfTime is a free log subscription operation binding the contract event 0xa1eced997ca08ff4a574f4f14ce5dfcb37e8bde7f90a609f48f0c86edf1224ee. +// +// Solidity: event SetHalfTime(uint256 half_time) +func (_ERC4626 *ERC4626Filterer) WatchSetHalfTime(opts *bind.WatchOpts, sink chan<- *ERC4626SetHalfTime) (event.Subscription, error) { + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "SetHalfTime") + 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(ERC4626SetHalfTime) + if err := _ERC4626.contract.UnpackLog(event, "SetHalfTime", 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 +} + +// ParseSetHalfTime is a log parse operation binding the contract event 0xa1eced997ca08ff4a574f4f14ce5dfcb37e8bde7f90a609f48f0c86edf1224ee. +// +// Solidity: event SetHalfTime(uint256 half_time) +func (_ERC4626 *ERC4626Filterer) ParseSetHalfTime(log types.Log) (*ERC4626SetHalfTime, error) { + event := new(ERC4626SetHalfTime) + if err := _ERC4626.contract.UnpackLog(event, "SetHalfTime", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626SetManagementIterator is returned from FilterSetManagement and is used to iterate over the raw logs and unpacked data for SetManagement events raised by the ERC4626 contract. +type ERC4626SetManagementIterator struct { + Event *ERC4626SetManagement // 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 *ERC4626SetManagementIterator) 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(ERC4626SetManagement) + 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(ERC4626SetManagement) + 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 *ERC4626SetManagementIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626SetManagementIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626SetManagement represents a SetManagement event raised by the ERC4626 contract. +type ERC4626SetManagement struct { + Management common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetManagement is a free log retrieval operation binding the contract event 0xafe23f9e1f603b288748a507d5a993957e9f14313a5889d5a070851299939d59. +// +// Solidity: event SetManagement(address indexed management) +func (_ERC4626 *ERC4626Filterer) FilterSetManagement(opts *bind.FilterOpts, management []common.Address) (*ERC4626SetManagementIterator, error) { + + var managementRule []interface{} + for _, managementItem := range management { + managementRule = append(managementRule, managementItem) + } + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "SetManagement", managementRule) + if err != nil { + return nil, err + } + return &ERC4626SetManagementIterator{contract: _ERC4626.contract, event: "SetManagement", logs: logs, sub: sub}, nil +} + +// WatchSetManagement is a free log subscription operation binding the contract event 0xafe23f9e1f603b288748a507d5a993957e9f14313a5889d5a070851299939d59. +// +// Solidity: event SetManagement(address indexed management) +func (_ERC4626 *ERC4626Filterer) WatchSetManagement(opts *bind.WatchOpts, sink chan<- *ERC4626SetManagement, management []common.Address) (event.Subscription, error) { + + var managementRule []interface{} + for _, managementItem := range management { + managementRule = append(managementRule, managementItem) + } + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "SetManagement", managementRule) + 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(ERC4626SetManagement) + if err := _ERC4626.contract.UnpackLog(event, "SetManagement", 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 +} + +// ParseSetManagement is a log parse operation binding the contract event 0xafe23f9e1f603b288748a507d5a993957e9f14313a5889d5a070851299939d59. +// +// Solidity: event SetManagement(address indexed management) +func (_ERC4626 *ERC4626Filterer) ParseSetManagement(log types.Log) (*ERC4626SetManagement, error) { + event := new(ERC4626SetManagement) + if err := _ERC4626.contract.UnpackLog(event, "SetManagement", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626SetTreasuryIterator is returned from FilterSetTreasury and is used to iterate over the raw logs and unpacked data for SetTreasury events raised by the ERC4626 contract. +type ERC4626SetTreasuryIterator struct { + Event *ERC4626SetTreasury // 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 *ERC4626SetTreasuryIterator) 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(ERC4626SetTreasury) + 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(ERC4626SetTreasury) + 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 *ERC4626SetTreasuryIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626SetTreasuryIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626SetTreasury represents a SetTreasury event raised by the ERC4626 contract. +type ERC4626SetTreasury struct { + Treasury common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetTreasury is a free log retrieval operation binding the contract event 0xcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef3. +// +// Solidity: event SetTreasury(address indexed treasury) +func (_ERC4626 *ERC4626Filterer) FilterSetTreasury(opts *bind.FilterOpts, treasury []common.Address) (*ERC4626SetTreasuryIterator, error) { + + var treasuryRule []interface{} + for _, treasuryItem := range treasury { + treasuryRule = append(treasuryRule, treasuryItem) + } + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "SetTreasury", treasuryRule) + if err != nil { + return nil, err + } + return &ERC4626SetTreasuryIterator{contract: _ERC4626.contract, event: "SetTreasury", logs: logs, sub: sub}, nil +} + +// WatchSetTreasury is a free log subscription operation binding the contract event 0xcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef3. +// +// Solidity: event SetTreasury(address indexed treasury) +func (_ERC4626 *ERC4626Filterer) WatchSetTreasury(opts *bind.WatchOpts, sink chan<- *ERC4626SetTreasury, treasury []common.Address) (event.Subscription, error) { + + var treasuryRule []interface{} + for _, treasuryItem := range treasury { + treasuryRule = append(treasuryRule, treasuryItem) + } + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "SetTreasury", treasuryRule) + 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(ERC4626SetTreasury) + if err := _ERC4626.contract.UnpackLog(event, "SetTreasury", 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 +} + +// ParseSetTreasury is a log parse operation binding the contract event 0xcb7ef3e545f5cdb893f5c568ba710fe08f336375a2d9fd66e161033f8fc09ef3. +// +// Solidity: event SetTreasury(address indexed treasury) +func (_ERC4626 *ERC4626Filterer) ParseSetTreasury(log types.Log) (*ERC4626SetTreasury, error) { + event := new(ERC4626SetTreasury) + if err := _ERC4626.contract.UnpackLog(event, "SetTreasury", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the ERC4626 contract. +type ERC4626TransferIterator struct { + Event *ERC4626Transfer // 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 *ERC4626TransferIterator) 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(ERC4626Transfer) + 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(ERC4626Transfer) + 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 *ERC4626TransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626TransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626Transfer represents a Transfer event raised by the ERC4626 contract. +type ERC4626Transfer struct { + Sender common.Address + Receiver common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed sender, address indexed receiver, uint256 value) +func (_ERC4626 *ERC4626Filterer) FilterTransfer(opts *bind.FilterOpts, sender []common.Address, receiver []common.Address) (*ERC4626TransferIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var receiverRule []interface{} + for _, receiverItem := range receiver { + receiverRule = append(receiverRule, receiverItem) + } + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "Transfer", senderRule, receiverRule) + if err != nil { + return nil, err + } + return &ERC4626TransferIterator{contract: _ERC4626.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed sender, address indexed receiver, uint256 value) +func (_ERC4626 *ERC4626Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *ERC4626Transfer, sender []common.Address, receiver []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var receiverRule []interface{} + for _, receiverItem := range receiver { + receiverRule = append(receiverRule, receiverItem) + } + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "Transfer", senderRule, receiverRule) + 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(ERC4626Transfer) + if err := _ERC4626.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed sender, address indexed receiver, uint256 value) +func (_ERC4626 *ERC4626Filterer) ParseTransfer(log types.Log) (*ERC4626Transfer, error) { + event := new(ERC4626Transfer) + if err := _ERC4626.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// ERC4626WithdrawIterator is returned from FilterWithdraw and is used to iterate over the raw logs and unpacked data for Withdraw events raised by the ERC4626 contract. +type ERC4626WithdrawIterator struct { + Event *ERC4626Withdraw // 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 *ERC4626WithdrawIterator) 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(ERC4626Withdraw) + 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(ERC4626Withdraw) + 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 *ERC4626WithdrawIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *ERC4626WithdrawIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// ERC4626Withdraw represents a Withdraw event raised by the ERC4626 contract. +type ERC4626Withdraw struct { + Sender common.Address + Receiver common.Address + Owner common.Address + Assets *big.Int + Shares *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWithdraw is a free log retrieval operation binding the contract event 0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db. +// +// Solidity: event Withdraw(address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares) +func (_ERC4626 *ERC4626Filterer) FilterWithdraw(opts *bind.FilterOpts, sender []common.Address, receiver []common.Address, owner []common.Address) (*ERC4626WithdrawIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var receiverRule []interface{} + for _, receiverItem := range receiver { + receiverRule = append(receiverRule, receiverItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _ERC4626.contract.FilterLogs(opts, "Withdraw", senderRule, receiverRule, ownerRule) + if err != nil { + return nil, err + } + return &ERC4626WithdrawIterator{contract: _ERC4626.contract, event: "Withdraw", logs: logs, sub: sub}, nil +} + +// WatchWithdraw is a free log subscription operation binding the contract event 0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db. +// +// Solidity: event Withdraw(address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares) +func (_ERC4626 *ERC4626Filterer) WatchWithdraw(opts *bind.WatchOpts, sink chan<- *ERC4626Withdraw, sender []common.Address, receiver []common.Address, owner []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var receiverRule []interface{} + for _, receiverItem := range receiver { + receiverRule = append(receiverRule, receiverItem) + } + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + logs, sub, err := _ERC4626.contract.WatchLogs(opts, "Withdraw", senderRule, receiverRule, ownerRule) + 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(ERC4626Withdraw) + if err := _ERC4626.contract.UnpackLog(event, "Withdraw", 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 +} + +// ParseWithdraw is a log parse operation binding the contract event 0xfbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db. +// +// Solidity: event Withdraw(address indexed sender, address indexed receiver, address indexed owner, uint256 assets, uint256 shares) +func (_ERC4626 *ERC4626Filterer) ParseWithdraw(log types.Log) (*ERC4626Withdraw, error) { + event := new(ERC4626Withdraw) + if err := _ERC4626.contract.UnpackLog(event, "Withdraw", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/common/contracts/yVault.registry.v4.go b/common/contracts/yVault.registry.v4.go new file mode 100644 index 000000000..9ec441a32 --- /dev/null +++ b/common/contracts/yVault.registry.v4.go @@ -0,0 +1,1617 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contracts + +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 +) + +// YRegistryV4MetaData contains all meta data concerning the YRegistryV4 contract. +var YRegistryV4MetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_governance\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_releaseRegistry\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousGovernance\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newGovernance\",\"type\":\"address\"}],\"name\":\"GovernanceTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"strategy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseVersion\",\"type\":\"uint256\"}],\"name\":\"NewEndorsedStrategy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseVersion\",\"type\":\"uint256\"}],\"name\":\"NewEndorsedVault\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"strategy\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseVersion\",\"type\":\"uint256\"}],\"name\":\"RemovedStrategy\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"releaseVersion\",\"type\":\"uint256\"}],\"name\":\"RemovedVault\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"assetIsUsed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"assets\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_strategy\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_releaseDelta\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_deploymentTimestamp\",\"type\":\"uint256\"}],\"name\":\"endorseStrategy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_strategy\",\"type\":\"address\"}],\"name\":\"endorseStrategy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vault\",\"type\":\"address\"}],\"name\":\"endorseVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vault\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_releaseDelta\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_deploymentTimestamp\",\"type\":\"uint256\"}],\"name\":\"endorseVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllEndorsedStrategies\",\"outputs\":[{\"internalType\":\"address[][]\",\"name\":\"allEndorsedStrategies\",\"type\":\"address[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAllEndorsedVaults\",\"outputs\":[{\"internalType\":\"address[][]\",\"name\":\"allEndorsedVaults\",\"type\":\"address[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAssets\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"}],\"name\":\"getEndorsedStrategies\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"}],\"name\":\"getEndorsedVaults\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governance\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"info\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"releaseVersion\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deploymentTimestamp\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"tag\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"_roleManager\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_profitMaxUnlockTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_releaseDelta\",\"type\":\"uint256\"}],\"name\":\"newEndorsedVault\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_vault\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"numAssets\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"}],\"name\":\"numEndorsedStrategies\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"}],\"name\":\"numEndorsedVaults\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"releaseRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"removeAsset\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_strategy\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"removeStrategy\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vault\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_index\",\"type\":\"uint256\"}],\"name\":\"removeVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_vault\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_tag\",\"type\":\"string\"}],\"name\":\"tagVault\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newGovernance\",\"type\":\"address\"}],\"name\":\"transferGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// YRegistryV4ABI is the input ABI used to generate the binding from. +// Deprecated: Use YRegistryV4MetaData.ABI instead. +var YRegistryV4ABI = YRegistryV4MetaData.ABI + +// YRegistryV4 is an auto generated Go binding around an Ethereum contract. +type YRegistryV4 struct { + YRegistryV4Caller // Read-only binding to the contract + YRegistryV4Transactor // Write-only binding to the contract + YRegistryV4Filterer // Log filterer for contract events +} + +// YRegistryV4Caller is an auto generated read-only Go binding around an Ethereum contract. +type YRegistryV4Caller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// YRegistryV4Transactor is an auto generated write-only Go binding around an Ethereum contract. +type YRegistryV4Transactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// YRegistryV4Filterer is an auto generated log filtering Go binding around an Ethereum contract events. +type YRegistryV4Filterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// YRegistryV4Session is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type YRegistryV4Session struct { + Contract *YRegistryV4 // 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 +} + +// YRegistryV4CallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type YRegistryV4CallerSession struct { + Contract *YRegistryV4Caller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// YRegistryV4TransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type YRegistryV4TransactorSession struct { + Contract *YRegistryV4Transactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// YRegistryV4Raw is an auto generated low-level Go binding around an Ethereum contract. +type YRegistryV4Raw struct { + Contract *YRegistryV4 // Generic contract binding to access the raw methods on +} + +// YRegistryV4CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type YRegistryV4CallerRaw struct { + Contract *YRegistryV4Caller // Generic read-only contract binding to access the raw methods on +} + +// YRegistryV4TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type YRegistryV4TransactorRaw struct { + Contract *YRegistryV4Transactor // Generic write-only contract binding to access the raw methods on +} + +// NewYRegistryV4 creates a new instance of YRegistryV4, bound to a specific deployed contract. +func NewYRegistryV4(address common.Address, backend bind.ContractBackend) (*YRegistryV4, error) { + contract, err := bindYRegistryV4(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &YRegistryV4{YRegistryV4Caller: YRegistryV4Caller{contract: contract}, YRegistryV4Transactor: YRegistryV4Transactor{contract: contract}, YRegistryV4Filterer: YRegistryV4Filterer{contract: contract}}, nil +} + +// NewYRegistryV4Caller creates a new read-only instance of YRegistryV4, bound to a specific deployed contract. +func NewYRegistryV4Caller(address common.Address, caller bind.ContractCaller) (*YRegistryV4Caller, error) { + contract, err := bindYRegistryV4(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &YRegistryV4Caller{contract: contract}, nil +} + +// NewYRegistryV4Transactor creates a new write-only instance of YRegistryV4, bound to a specific deployed contract. +func NewYRegistryV4Transactor(address common.Address, transactor bind.ContractTransactor) (*YRegistryV4Transactor, error) { + contract, err := bindYRegistryV4(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &YRegistryV4Transactor{contract: contract}, nil +} + +// NewYRegistryV4Filterer creates a new log filterer instance of YRegistryV4, bound to a specific deployed contract. +func NewYRegistryV4Filterer(address common.Address, filterer bind.ContractFilterer) (*YRegistryV4Filterer, error) { + contract, err := bindYRegistryV4(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &YRegistryV4Filterer{contract: contract}, nil +} + +// bindYRegistryV4 binds a generic wrapper to an already deployed contract. +func bindYRegistryV4(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(YRegistryV4ABI)) + 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 (_YRegistryV4 *YRegistryV4Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _YRegistryV4.Contract.YRegistryV4Caller.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 (_YRegistryV4 *YRegistryV4Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _YRegistryV4.Contract.YRegistryV4Transactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_YRegistryV4 *YRegistryV4Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _YRegistryV4.Contract.YRegistryV4Transactor.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 (_YRegistryV4 *YRegistryV4CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _YRegistryV4.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 (_YRegistryV4 *YRegistryV4TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _YRegistryV4.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_YRegistryV4 *YRegistryV4TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _YRegistryV4.Contract.contract.Transact(opts, method, params...) +} + +// AssetIsUsed is a free data retrieval call binding the contract method 0xac01762a. +// +// Solidity: function assetIsUsed(address ) view returns(bool) +func (_YRegistryV4 *YRegistryV4Caller) AssetIsUsed(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "assetIsUsed", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// AssetIsUsed is a free data retrieval call binding the contract method 0xac01762a. +// +// Solidity: function assetIsUsed(address ) view returns(bool) +func (_YRegistryV4 *YRegistryV4Session) AssetIsUsed(arg0 common.Address) (bool, error) { + return _YRegistryV4.Contract.AssetIsUsed(&_YRegistryV4.CallOpts, arg0) +} + +// AssetIsUsed is a free data retrieval call binding the contract method 0xac01762a. +// +// Solidity: function assetIsUsed(address ) view returns(bool) +func (_YRegistryV4 *YRegistryV4CallerSession) AssetIsUsed(arg0 common.Address) (bool, error) { + return _YRegistryV4.Contract.AssetIsUsed(&_YRegistryV4.CallOpts, arg0) +} + +// Assets is a free data retrieval call binding the contract method 0xcf35bdd0. +// +// Solidity: function assets(uint256 ) view returns(address) +func (_YRegistryV4 *YRegistryV4Caller) Assets(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "assets", arg0) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Assets is a free data retrieval call binding the contract method 0xcf35bdd0. +// +// Solidity: function assets(uint256 ) view returns(address) +func (_YRegistryV4 *YRegistryV4Session) Assets(arg0 *big.Int) (common.Address, error) { + return _YRegistryV4.Contract.Assets(&_YRegistryV4.CallOpts, arg0) +} + +// Assets is a free data retrieval call binding the contract method 0xcf35bdd0. +// +// Solidity: function assets(uint256 ) view returns(address) +func (_YRegistryV4 *YRegistryV4CallerSession) Assets(arg0 *big.Int) (common.Address, error) { + return _YRegistryV4.Contract.Assets(&_YRegistryV4.CallOpts, arg0) +} + +// GetAllEndorsedStrategies is a free data retrieval call binding the contract method 0x06a70f3d. +// +// Solidity: function getAllEndorsedStrategies() view returns(address[][] allEndorsedStrategies) +func (_YRegistryV4 *YRegistryV4Caller) GetAllEndorsedStrategies(opts *bind.CallOpts) ([][]common.Address, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "getAllEndorsedStrategies") + + if err != nil { + return *new([][]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([][]common.Address)).(*[][]common.Address) + + return out0, err + +} + +// GetAllEndorsedStrategies is a free data retrieval call binding the contract method 0x06a70f3d. +// +// Solidity: function getAllEndorsedStrategies() view returns(address[][] allEndorsedStrategies) +func (_YRegistryV4 *YRegistryV4Session) GetAllEndorsedStrategies() ([][]common.Address, error) { + return _YRegistryV4.Contract.GetAllEndorsedStrategies(&_YRegistryV4.CallOpts) +} + +// GetAllEndorsedStrategies is a free data retrieval call binding the contract method 0x06a70f3d. +// +// Solidity: function getAllEndorsedStrategies() view returns(address[][] allEndorsedStrategies) +func (_YRegistryV4 *YRegistryV4CallerSession) GetAllEndorsedStrategies() ([][]common.Address, error) { + return _YRegistryV4.Contract.GetAllEndorsedStrategies(&_YRegistryV4.CallOpts) +} + +// GetAllEndorsedVaults is a free data retrieval call binding the contract method 0x70df8ba7. +// +// Solidity: function getAllEndorsedVaults() view returns(address[][] allEndorsedVaults) +func (_YRegistryV4 *YRegistryV4Caller) GetAllEndorsedVaults(opts *bind.CallOpts) ([][]common.Address, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "getAllEndorsedVaults") + + if err != nil { + return *new([][]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([][]common.Address)).(*[][]common.Address) + + return out0, err + +} + +// GetAllEndorsedVaults is a free data retrieval call binding the contract method 0x70df8ba7. +// +// Solidity: function getAllEndorsedVaults() view returns(address[][] allEndorsedVaults) +func (_YRegistryV4 *YRegistryV4Session) GetAllEndorsedVaults() ([][]common.Address, error) { + return _YRegistryV4.Contract.GetAllEndorsedVaults(&_YRegistryV4.CallOpts) +} + +// GetAllEndorsedVaults is a free data retrieval call binding the contract method 0x70df8ba7. +// +// Solidity: function getAllEndorsedVaults() view returns(address[][] allEndorsedVaults) +func (_YRegistryV4 *YRegistryV4CallerSession) GetAllEndorsedVaults() ([][]common.Address, error) { + return _YRegistryV4.Contract.GetAllEndorsedVaults(&_YRegistryV4.CallOpts) +} + +// GetAssets is a free data retrieval call binding the contract method 0x67e4ac2c. +// +// Solidity: function getAssets() view returns(address[]) +func (_YRegistryV4 *YRegistryV4Caller) GetAssets(opts *bind.CallOpts) ([]common.Address, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "getAssets") + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetAssets is a free data retrieval call binding the contract method 0x67e4ac2c. +// +// Solidity: function getAssets() view returns(address[]) +func (_YRegistryV4 *YRegistryV4Session) GetAssets() ([]common.Address, error) { + return _YRegistryV4.Contract.GetAssets(&_YRegistryV4.CallOpts) +} + +// GetAssets is a free data retrieval call binding the contract method 0x67e4ac2c. +// +// Solidity: function getAssets() view returns(address[]) +func (_YRegistryV4 *YRegistryV4CallerSession) GetAssets() ([]common.Address, error) { + return _YRegistryV4.Contract.GetAssets(&_YRegistryV4.CallOpts) +} + +// GetEndorsedStrategies is a free data retrieval call binding the contract method 0x153a5b16. +// +// Solidity: function getEndorsedStrategies(address _asset) view returns(address[]) +func (_YRegistryV4 *YRegistryV4Caller) GetEndorsedStrategies(opts *bind.CallOpts, _asset common.Address) ([]common.Address, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "getEndorsedStrategies", _asset) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetEndorsedStrategies is a free data retrieval call binding the contract method 0x153a5b16. +// +// Solidity: function getEndorsedStrategies(address _asset) view returns(address[]) +func (_YRegistryV4 *YRegistryV4Session) GetEndorsedStrategies(_asset common.Address) ([]common.Address, error) { + return _YRegistryV4.Contract.GetEndorsedStrategies(&_YRegistryV4.CallOpts, _asset) +} + +// GetEndorsedStrategies is a free data retrieval call binding the contract method 0x153a5b16. +// +// Solidity: function getEndorsedStrategies(address _asset) view returns(address[]) +func (_YRegistryV4 *YRegistryV4CallerSession) GetEndorsedStrategies(_asset common.Address) ([]common.Address, error) { + return _YRegistryV4.Contract.GetEndorsedStrategies(&_YRegistryV4.CallOpts, _asset) +} + +// GetEndorsedVaults is a free data retrieval call binding the contract method 0x53d2e949. +// +// Solidity: function getEndorsedVaults(address _asset) view returns(address[]) +func (_YRegistryV4 *YRegistryV4Caller) GetEndorsedVaults(opts *bind.CallOpts, _asset common.Address) ([]common.Address, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "getEndorsedVaults", _asset) + + if err != nil { + return *new([]common.Address), err + } + + out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + + return out0, err + +} + +// GetEndorsedVaults is a free data retrieval call binding the contract method 0x53d2e949. +// +// Solidity: function getEndorsedVaults(address _asset) view returns(address[]) +func (_YRegistryV4 *YRegistryV4Session) GetEndorsedVaults(_asset common.Address) ([]common.Address, error) { + return _YRegistryV4.Contract.GetEndorsedVaults(&_YRegistryV4.CallOpts, _asset) +} + +// GetEndorsedVaults is a free data retrieval call binding the contract method 0x53d2e949. +// +// Solidity: function getEndorsedVaults(address _asset) view returns(address[]) +func (_YRegistryV4 *YRegistryV4CallerSession) GetEndorsedVaults(_asset common.Address) ([]common.Address, error) { + return _YRegistryV4.Contract.GetEndorsedVaults(&_YRegistryV4.CallOpts, _asset) +} + +// Governance is a free data retrieval call binding the contract method 0x5aa6e675. +// +// Solidity: function governance() view returns(address) +func (_YRegistryV4 *YRegistryV4Caller) Governance(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "governance") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Governance is a free data retrieval call binding the contract method 0x5aa6e675. +// +// Solidity: function governance() view returns(address) +func (_YRegistryV4 *YRegistryV4Session) Governance() (common.Address, error) { + return _YRegistryV4.Contract.Governance(&_YRegistryV4.CallOpts) +} + +// Governance is a free data retrieval call binding the contract method 0x5aa6e675. +// +// Solidity: function governance() view returns(address) +func (_YRegistryV4 *YRegistryV4CallerSession) Governance() (common.Address, error) { + return _YRegistryV4.Contract.Governance(&_YRegistryV4.CallOpts) +} + +// Info is a free data retrieval call binding the contract method 0x0aae7a6b. +// +// Solidity: function info(address ) view returns(address asset, uint256 releaseVersion, uint256 deploymentTimestamp, string tag) +func (_YRegistryV4 *YRegistryV4Caller) Info(opts *bind.CallOpts, arg0 common.Address) (struct { + Asset common.Address + ReleaseVersion *big.Int + DeploymentTimestamp *big.Int + Tag string +}, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "info", arg0) + + outstruct := new(struct { + Asset common.Address + ReleaseVersion *big.Int + DeploymentTimestamp *big.Int + Tag string + }) + if err != nil { + return *outstruct, err + } + + outstruct.Asset = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.ReleaseVersion = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.DeploymentTimestamp = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.Tag = *abi.ConvertType(out[3], new(string)).(*string) + + return *outstruct, err + +} + +// Info is a free data retrieval call binding the contract method 0x0aae7a6b. +// +// Solidity: function info(address ) view returns(address asset, uint256 releaseVersion, uint256 deploymentTimestamp, string tag) +func (_YRegistryV4 *YRegistryV4Session) Info(arg0 common.Address) (struct { + Asset common.Address + ReleaseVersion *big.Int + DeploymentTimestamp *big.Int + Tag string +}, error) { + return _YRegistryV4.Contract.Info(&_YRegistryV4.CallOpts, arg0) +} + +// Info is a free data retrieval call binding the contract method 0x0aae7a6b. +// +// Solidity: function info(address ) view returns(address asset, uint256 releaseVersion, uint256 deploymentTimestamp, string tag) +func (_YRegistryV4 *YRegistryV4CallerSession) Info(arg0 common.Address) (struct { + Asset common.Address + ReleaseVersion *big.Int + DeploymentTimestamp *big.Int + Tag string +}, error) { + return _YRegistryV4.Contract.Info(&_YRegistryV4.CallOpts, arg0) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_YRegistryV4 *YRegistryV4Caller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_YRegistryV4 *YRegistryV4Session) Name() (string, error) { + return _YRegistryV4.Contract.Name(&_YRegistryV4.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_YRegistryV4 *YRegistryV4CallerSession) Name() (string, error) { + return _YRegistryV4.Contract.Name(&_YRegistryV4.CallOpts) +} + +// NumAssets is a free data retrieval call binding the contract method 0xa46fe83b. +// +// Solidity: function numAssets() view returns(uint256) +func (_YRegistryV4 *YRegistryV4Caller) NumAssets(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "numAssets") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NumAssets is a free data retrieval call binding the contract method 0xa46fe83b. +// +// Solidity: function numAssets() view returns(uint256) +func (_YRegistryV4 *YRegistryV4Session) NumAssets() (*big.Int, error) { + return _YRegistryV4.Contract.NumAssets(&_YRegistryV4.CallOpts) +} + +// NumAssets is a free data retrieval call binding the contract method 0xa46fe83b. +// +// Solidity: function numAssets() view returns(uint256) +func (_YRegistryV4 *YRegistryV4CallerSession) NumAssets() (*big.Int, error) { + return _YRegistryV4.Contract.NumAssets(&_YRegistryV4.CallOpts) +} + +// NumEndorsedStrategies is a free data retrieval call binding the contract method 0x3e3c7b60. +// +// Solidity: function numEndorsedStrategies(address _asset) view returns(uint256) +func (_YRegistryV4 *YRegistryV4Caller) NumEndorsedStrategies(opts *bind.CallOpts, _asset common.Address) (*big.Int, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "numEndorsedStrategies", _asset) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NumEndorsedStrategies is a free data retrieval call binding the contract method 0x3e3c7b60. +// +// Solidity: function numEndorsedStrategies(address _asset) view returns(uint256) +func (_YRegistryV4 *YRegistryV4Session) NumEndorsedStrategies(_asset common.Address) (*big.Int, error) { + return _YRegistryV4.Contract.NumEndorsedStrategies(&_YRegistryV4.CallOpts, _asset) +} + +// NumEndorsedStrategies is a free data retrieval call binding the contract method 0x3e3c7b60. +// +// Solidity: function numEndorsedStrategies(address _asset) view returns(uint256) +func (_YRegistryV4 *YRegistryV4CallerSession) NumEndorsedStrategies(_asset common.Address) (*big.Int, error) { + return _YRegistryV4.Contract.NumEndorsedStrategies(&_YRegistryV4.CallOpts, _asset) +} + +// NumEndorsedVaults is a free data retrieval call binding the contract method 0xb2c6161c. +// +// Solidity: function numEndorsedVaults(address _asset) view returns(uint256) +func (_YRegistryV4 *YRegistryV4Caller) NumEndorsedVaults(opts *bind.CallOpts, _asset common.Address) (*big.Int, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "numEndorsedVaults", _asset) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// NumEndorsedVaults is a free data retrieval call binding the contract method 0xb2c6161c. +// +// Solidity: function numEndorsedVaults(address _asset) view returns(uint256) +func (_YRegistryV4 *YRegistryV4Session) NumEndorsedVaults(_asset common.Address) (*big.Int, error) { + return _YRegistryV4.Contract.NumEndorsedVaults(&_YRegistryV4.CallOpts, _asset) +} + +// NumEndorsedVaults is a free data retrieval call binding the contract method 0xb2c6161c. +// +// Solidity: function numEndorsedVaults(address _asset) view returns(uint256) +func (_YRegistryV4 *YRegistryV4CallerSession) NumEndorsedVaults(_asset common.Address) (*big.Int, error) { + return _YRegistryV4.Contract.NumEndorsedVaults(&_YRegistryV4.CallOpts, _asset) +} + +// ReleaseRegistry is a free data retrieval call binding the contract method 0x19ee073e. +// +// Solidity: function releaseRegistry() view returns(address) +func (_YRegistryV4 *YRegistryV4Caller) ReleaseRegistry(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _YRegistryV4.contract.Call(opts, &out, "releaseRegistry") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// ReleaseRegistry is a free data retrieval call binding the contract method 0x19ee073e. +// +// Solidity: function releaseRegistry() view returns(address) +func (_YRegistryV4 *YRegistryV4Session) ReleaseRegistry() (common.Address, error) { + return _YRegistryV4.Contract.ReleaseRegistry(&_YRegistryV4.CallOpts) +} + +// ReleaseRegistry is a free data retrieval call binding the contract method 0x19ee073e. +// +// Solidity: function releaseRegistry() view returns(address) +func (_YRegistryV4 *YRegistryV4CallerSession) ReleaseRegistry() (common.Address, error) { + return _YRegistryV4.Contract.ReleaseRegistry(&_YRegistryV4.CallOpts) +} + +// EndorseStrategy is a paid mutator transaction binding the contract method 0x0724b07b. +// +// Solidity: function endorseStrategy(address _strategy, uint256 _releaseDelta, uint256 _deploymentTimestamp) returns() +func (_YRegistryV4 *YRegistryV4Transactor) EndorseStrategy(opts *bind.TransactOpts, _strategy common.Address, _releaseDelta *big.Int, _deploymentTimestamp *big.Int) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "endorseStrategy", _strategy, _releaseDelta, _deploymentTimestamp) +} + +// EndorseStrategy is a paid mutator transaction binding the contract method 0x0724b07b. +// +// Solidity: function endorseStrategy(address _strategy, uint256 _releaseDelta, uint256 _deploymentTimestamp) returns() +func (_YRegistryV4 *YRegistryV4Session) EndorseStrategy(_strategy common.Address, _releaseDelta *big.Int, _deploymentTimestamp *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.EndorseStrategy(&_YRegistryV4.TransactOpts, _strategy, _releaseDelta, _deploymentTimestamp) +} + +// EndorseStrategy is a paid mutator transaction binding the contract method 0x0724b07b. +// +// Solidity: function endorseStrategy(address _strategy, uint256 _releaseDelta, uint256 _deploymentTimestamp) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) EndorseStrategy(_strategy common.Address, _releaseDelta *big.Int, _deploymentTimestamp *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.EndorseStrategy(&_YRegistryV4.TransactOpts, _strategy, _releaseDelta, _deploymentTimestamp) +} + +// EndorseStrategy0 is a paid mutator transaction binding the contract method 0x0a225ecf. +// +// Solidity: function endorseStrategy(address _strategy) returns() +func (_YRegistryV4 *YRegistryV4Transactor) EndorseStrategy0(opts *bind.TransactOpts, _strategy common.Address) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "endorseStrategy0", _strategy) +} + +// EndorseStrategy0 is a paid mutator transaction binding the contract method 0x0a225ecf. +// +// Solidity: function endorseStrategy(address _strategy) returns() +func (_YRegistryV4 *YRegistryV4Session) EndorseStrategy0(_strategy common.Address) (*types.Transaction, error) { + return _YRegistryV4.Contract.EndorseStrategy0(&_YRegistryV4.TransactOpts, _strategy) +} + +// EndorseStrategy0 is a paid mutator transaction binding the contract method 0x0a225ecf. +// +// Solidity: function endorseStrategy(address _strategy) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) EndorseStrategy0(_strategy common.Address) (*types.Transaction, error) { + return _YRegistryV4.Contract.EndorseStrategy0(&_YRegistryV4.TransactOpts, _strategy) +} + +// EndorseVault is a paid mutator transaction binding the contract method 0x29b2e0c6. +// +// Solidity: function endorseVault(address _vault) returns() +func (_YRegistryV4 *YRegistryV4Transactor) EndorseVault(opts *bind.TransactOpts, _vault common.Address) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "endorseVault", _vault) +} + +// EndorseVault is a paid mutator transaction binding the contract method 0x29b2e0c6. +// +// Solidity: function endorseVault(address _vault) returns() +func (_YRegistryV4 *YRegistryV4Session) EndorseVault(_vault common.Address) (*types.Transaction, error) { + return _YRegistryV4.Contract.EndorseVault(&_YRegistryV4.TransactOpts, _vault) +} + +// EndorseVault is a paid mutator transaction binding the contract method 0x29b2e0c6. +// +// Solidity: function endorseVault(address _vault) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) EndorseVault(_vault common.Address) (*types.Transaction, error) { + return _YRegistryV4.Contract.EndorseVault(&_YRegistryV4.TransactOpts, _vault) +} + +// EndorseVault0 is a paid mutator transaction binding the contract method 0x931074ba. +// +// Solidity: function endorseVault(address _vault, uint256 _releaseDelta, uint256 _deploymentTimestamp) returns() +func (_YRegistryV4 *YRegistryV4Transactor) EndorseVault0(opts *bind.TransactOpts, _vault common.Address, _releaseDelta *big.Int, _deploymentTimestamp *big.Int) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "endorseVault0", _vault, _releaseDelta, _deploymentTimestamp) +} + +// EndorseVault0 is a paid mutator transaction binding the contract method 0x931074ba. +// +// Solidity: function endorseVault(address _vault, uint256 _releaseDelta, uint256 _deploymentTimestamp) returns() +func (_YRegistryV4 *YRegistryV4Session) EndorseVault0(_vault common.Address, _releaseDelta *big.Int, _deploymentTimestamp *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.EndorseVault0(&_YRegistryV4.TransactOpts, _vault, _releaseDelta, _deploymentTimestamp) +} + +// EndorseVault0 is a paid mutator transaction binding the contract method 0x931074ba. +// +// Solidity: function endorseVault(address _vault, uint256 _releaseDelta, uint256 _deploymentTimestamp) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) EndorseVault0(_vault common.Address, _releaseDelta *big.Int, _deploymentTimestamp *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.EndorseVault0(&_YRegistryV4.TransactOpts, _vault, _releaseDelta, _deploymentTimestamp) +} + +// NewEndorsedVault is a paid mutator transaction binding the contract method 0x7be7b20b. +// +// Solidity: function newEndorsedVault(address _asset, string _name, string _symbol, address _roleManager, uint256 _profitMaxUnlockTime, uint256 _releaseDelta) returns(address _vault) +func (_YRegistryV4 *YRegistryV4Transactor) NewEndorsedVault(opts *bind.TransactOpts, _asset common.Address, _name string, _symbol string, _roleManager common.Address, _profitMaxUnlockTime *big.Int, _releaseDelta *big.Int) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "newEndorsedVault", _asset, _name, _symbol, _roleManager, _profitMaxUnlockTime, _releaseDelta) +} + +// NewEndorsedVault is a paid mutator transaction binding the contract method 0x7be7b20b. +// +// Solidity: function newEndorsedVault(address _asset, string _name, string _symbol, address _roleManager, uint256 _profitMaxUnlockTime, uint256 _releaseDelta) returns(address _vault) +func (_YRegistryV4 *YRegistryV4Session) NewEndorsedVault(_asset common.Address, _name string, _symbol string, _roleManager common.Address, _profitMaxUnlockTime *big.Int, _releaseDelta *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.NewEndorsedVault(&_YRegistryV4.TransactOpts, _asset, _name, _symbol, _roleManager, _profitMaxUnlockTime, _releaseDelta) +} + +// NewEndorsedVault is a paid mutator transaction binding the contract method 0x7be7b20b. +// +// Solidity: function newEndorsedVault(address _asset, string _name, string _symbol, address _roleManager, uint256 _profitMaxUnlockTime, uint256 _releaseDelta) returns(address _vault) +func (_YRegistryV4 *YRegistryV4TransactorSession) NewEndorsedVault(_asset common.Address, _name string, _symbol string, _roleManager common.Address, _profitMaxUnlockTime *big.Int, _releaseDelta *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.NewEndorsedVault(&_YRegistryV4.TransactOpts, _asset, _name, _symbol, _roleManager, _profitMaxUnlockTime, _releaseDelta) +} + +// RemoveAsset is a paid mutator transaction binding the contract method 0x2317ef67. +// +// Solidity: function removeAsset(address _asset, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4Transactor) RemoveAsset(opts *bind.TransactOpts, _asset common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "removeAsset", _asset, _index) +} + +// RemoveAsset is a paid mutator transaction binding the contract method 0x2317ef67. +// +// Solidity: function removeAsset(address _asset, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4Session) RemoveAsset(_asset common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.RemoveAsset(&_YRegistryV4.TransactOpts, _asset, _index) +} + +// RemoveAsset is a paid mutator transaction binding the contract method 0x2317ef67. +// +// Solidity: function removeAsset(address _asset, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) RemoveAsset(_asset common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.RemoveAsset(&_YRegistryV4.TransactOpts, _asset, _index) +} + +// RemoveStrategy is a paid mutator transaction binding the contract method 0xea682eeb. +// +// Solidity: function removeStrategy(address _strategy, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4Transactor) RemoveStrategy(opts *bind.TransactOpts, _strategy common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "removeStrategy", _strategy, _index) +} + +// RemoveStrategy is a paid mutator transaction binding the contract method 0xea682eeb. +// +// Solidity: function removeStrategy(address _strategy, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4Session) RemoveStrategy(_strategy common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.RemoveStrategy(&_YRegistryV4.TransactOpts, _strategy, _index) +} + +// RemoveStrategy is a paid mutator transaction binding the contract method 0xea682eeb. +// +// Solidity: function removeStrategy(address _strategy, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) RemoveStrategy(_strategy common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.RemoveStrategy(&_YRegistryV4.TransactOpts, _strategy, _index) +} + +// RemoveVault is a paid mutator transaction binding the contract method 0xb37c61cd. +// +// Solidity: function removeVault(address _vault, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4Transactor) RemoveVault(opts *bind.TransactOpts, _vault common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "removeVault", _vault, _index) +} + +// RemoveVault is a paid mutator transaction binding the contract method 0xb37c61cd. +// +// Solidity: function removeVault(address _vault, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4Session) RemoveVault(_vault common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.RemoveVault(&_YRegistryV4.TransactOpts, _vault, _index) +} + +// RemoveVault is a paid mutator transaction binding the contract method 0xb37c61cd. +// +// Solidity: function removeVault(address _vault, uint256 _index) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) RemoveVault(_vault common.Address, _index *big.Int) (*types.Transaction, error) { + return _YRegistryV4.Contract.RemoveVault(&_YRegistryV4.TransactOpts, _vault, _index) +} + +// TagVault is a paid mutator transaction binding the contract method 0x60bd68f8. +// +// Solidity: function tagVault(address _vault, string _tag) returns() +func (_YRegistryV4 *YRegistryV4Transactor) TagVault(opts *bind.TransactOpts, _vault common.Address, _tag string) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "tagVault", _vault, _tag) +} + +// TagVault is a paid mutator transaction binding the contract method 0x60bd68f8. +// +// Solidity: function tagVault(address _vault, string _tag) returns() +func (_YRegistryV4 *YRegistryV4Session) TagVault(_vault common.Address, _tag string) (*types.Transaction, error) { + return _YRegistryV4.Contract.TagVault(&_YRegistryV4.TransactOpts, _vault, _tag) +} + +// TagVault is a paid mutator transaction binding the contract method 0x60bd68f8. +// +// Solidity: function tagVault(address _vault, string _tag) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) TagVault(_vault common.Address, _tag string) (*types.Transaction, error) { + return _YRegistryV4.Contract.TagVault(&_YRegistryV4.TransactOpts, _vault, _tag) +} + +// TransferGovernance is a paid mutator transaction binding the contract method 0xd38bfff4. +// +// Solidity: function transferGovernance(address _newGovernance) returns() +func (_YRegistryV4 *YRegistryV4Transactor) TransferGovernance(opts *bind.TransactOpts, _newGovernance common.Address) (*types.Transaction, error) { + return _YRegistryV4.contract.Transact(opts, "transferGovernance", _newGovernance) +} + +// TransferGovernance is a paid mutator transaction binding the contract method 0xd38bfff4. +// +// Solidity: function transferGovernance(address _newGovernance) returns() +func (_YRegistryV4 *YRegistryV4Session) TransferGovernance(_newGovernance common.Address) (*types.Transaction, error) { + return _YRegistryV4.Contract.TransferGovernance(&_YRegistryV4.TransactOpts, _newGovernance) +} + +// TransferGovernance is a paid mutator transaction binding the contract method 0xd38bfff4. +// +// Solidity: function transferGovernance(address _newGovernance) returns() +func (_YRegistryV4 *YRegistryV4TransactorSession) TransferGovernance(_newGovernance common.Address) (*types.Transaction, error) { + return _YRegistryV4.Contract.TransferGovernance(&_YRegistryV4.TransactOpts, _newGovernance) +} + +// YRegistryV4GovernanceTransferredIterator is returned from FilterGovernanceTransferred and is used to iterate over the raw logs and unpacked data for GovernanceTransferred events raised by the YRegistryV4 contract. +type YRegistryV4GovernanceTransferredIterator struct { + Event *YRegistryV4GovernanceTransferred // 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 *YRegistryV4GovernanceTransferredIterator) 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(YRegistryV4GovernanceTransferred) + 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(YRegistryV4GovernanceTransferred) + 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 *YRegistryV4GovernanceTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *YRegistryV4GovernanceTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// YRegistryV4GovernanceTransferred represents a GovernanceTransferred event raised by the YRegistryV4 contract. +type YRegistryV4GovernanceTransferred struct { + PreviousGovernance common.Address + NewGovernance common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGovernanceTransferred is a free log retrieval operation binding the contract event 0x5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80. +// +// Solidity: event GovernanceTransferred(address indexed previousGovernance, address indexed newGovernance) +func (_YRegistryV4 *YRegistryV4Filterer) FilterGovernanceTransferred(opts *bind.FilterOpts, previousGovernance []common.Address, newGovernance []common.Address) (*YRegistryV4GovernanceTransferredIterator, error) { + + var previousGovernanceRule []interface{} + for _, previousGovernanceItem := range previousGovernance { + previousGovernanceRule = append(previousGovernanceRule, previousGovernanceItem) + } + var newGovernanceRule []interface{} + for _, newGovernanceItem := range newGovernance { + newGovernanceRule = append(newGovernanceRule, newGovernanceItem) + } + + logs, sub, err := _YRegistryV4.contract.FilterLogs(opts, "GovernanceTransferred", previousGovernanceRule, newGovernanceRule) + if err != nil { + return nil, err + } + return &YRegistryV4GovernanceTransferredIterator{contract: _YRegistryV4.contract, event: "GovernanceTransferred", logs: logs, sub: sub}, nil +} + +// WatchGovernanceTransferred is a free log subscription operation binding the contract event 0x5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80. +// +// Solidity: event GovernanceTransferred(address indexed previousGovernance, address indexed newGovernance) +func (_YRegistryV4 *YRegistryV4Filterer) WatchGovernanceTransferred(opts *bind.WatchOpts, sink chan<- *YRegistryV4GovernanceTransferred, previousGovernance []common.Address, newGovernance []common.Address) (event.Subscription, error) { + + var previousGovernanceRule []interface{} + for _, previousGovernanceItem := range previousGovernance { + previousGovernanceRule = append(previousGovernanceRule, previousGovernanceItem) + } + var newGovernanceRule []interface{} + for _, newGovernanceItem := range newGovernance { + newGovernanceRule = append(newGovernanceRule, newGovernanceItem) + } + + logs, sub, err := _YRegistryV4.contract.WatchLogs(opts, "GovernanceTransferred", previousGovernanceRule, newGovernanceRule) + 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(YRegistryV4GovernanceTransferred) + if err := _YRegistryV4.contract.UnpackLog(event, "GovernanceTransferred", 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 +} + +// ParseGovernanceTransferred is a log parse operation binding the contract event 0x5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce80. +// +// Solidity: event GovernanceTransferred(address indexed previousGovernance, address indexed newGovernance) +func (_YRegistryV4 *YRegistryV4Filterer) ParseGovernanceTransferred(log types.Log) (*YRegistryV4GovernanceTransferred, error) { + event := new(YRegistryV4GovernanceTransferred) + if err := _YRegistryV4.contract.UnpackLog(event, "GovernanceTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// YRegistryV4NewEndorsedStrategyIterator is returned from FilterNewEndorsedStrategy and is used to iterate over the raw logs and unpacked data for NewEndorsedStrategy events raised by the YRegistryV4 contract. +type YRegistryV4NewEndorsedStrategyIterator struct { + Event *YRegistryV4NewEndorsedStrategy // 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 *YRegistryV4NewEndorsedStrategyIterator) 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(YRegistryV4NewEndorsedStrategy) + 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(YRegistryV4NewEndorsedStrategy) + 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 *YRegistryV4NewEndorsedStrategyIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *YRegistryV4NewEndorsedStrategyIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// YRegistryV4NewEndorsedStrategy represents a NewEndorsedStrategy event raised by the YRegistryV4 contract. +type YRegistryV4NewEndorsedStrategy struct { + Strategy common.Address + Asset common.Address + ReleaseVersion *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewEndorsedStrategy is a free log retrieval operation binding the contract event 0x2ab8c6c9129a30daa2d2add32ab462e1b35dd8fc42a473ea04380a25b5cc9d3a. +// +// Solidity: event NewEndorsedStrategy(address indexed strategy, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) FilterNewEndorsedStrategy(opts *bind.FilterOpts, strategy []common.Address, asset []common.Address) (*YRegistryV4NewEndorsedStrategyIterator, error) { + + var strategyRule []interface{} + for _, strategyItem := range strategy { + strategyRule = append(strategyRule, strategyItem) + } + var assetRule []interface{} + for _, assetItem := range asset { + assetRule = append(assetRule, assetItem) + } + + logs, sub, err := _YRegistryV4.contract.FilterLogs(opts, "NewEndorsedStrategy", strategyRule, assetRule) + if err != nil { + return nil, err + } + return &YRegistryV4NewEndorsedStrategyIterator{contract: _YRegistryV4.contract, event: "NewEndorsedStrategy", logs: logs, sub: sub}, nil +} + +// WatchNewEndorsedStrategy is a free log subscription operation binding the contract event 0x2ab8c6c9129a30daa2d2add32ab462e1b35dd8fc42a473ea04380a25b5cc9d3a. +// +// Solidity: event NewEndorsedStrategy(address indexed strategy, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) WatchNewEndorsedStrategy(opts *bind.WatchOpts, sink chan<- *YRegistryV4NewEndorsedStrategy, strategy []common.Address, asset []common.Address) (event.Subscription, error) { + + var strategyRule []interface{} + for _, strategyItem := range strategy { + strategyRule = append(strategyRule, strategyItem) + } + var assetRule []interface{} + for _, assetItem := range asset { + assetRule = append(assetRule, assetItem) + } + + logs, sub, err := _YRegistryV4.contract.WatchLogs(opts, "NewEndorsedStrategy", strategyRule, assetRule) + 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(YRegistryV4NewEndorsedStrategy) + if err := _YRegistryV4.contract.UnpackLog(event, "NewEndorsedStrategy", 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 +} + +// ParseNewEndorsedStrategy is a log parse operation binding the contract event 0x2ab8c6c9129a30daa2d2add32ab462e1b35dd8fc42a473ea04380a25b5cc9d3a. +// +// Solidity: event NewEndorsedStrategy(address indexed strategy, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) ParseNewEndorsedStrategy(log types.Log) (*YRegistryV4NewEndorsedStrategy, error) { + event := new(YRegistryV4NewEndorsedStrategy) + if err := _YRegistryV4.contract.UnpackLog(event, "NewEndorsedStrategy", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// YRegistryV4NewEndorsedVaultIterator is returned from FilterNewEndorsedVault and is used to iterate over the raw logs and unpacked data for NewEndorsedVault events raised by the YRegistryV4 contract. +type YRegistryV4NewEndorsedVaultIterator struct { + Event *YRegistryV4NewEndorsedVault // 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 *YRegistryV4NewEndorsedVaultIterator) 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(YRegistryV4NewEndorsedVault) + 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(YRegistryV4NewEndorsedVault) + 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 *YRegistryV4NewEndorsedVaultIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *YRegistryV4NewEndorsedVaultIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// YRegistryV4NewEndorsedVault represents a NewEndorsedVault event raised by the YRegistryV4 contract. +type YRegistryV4NewEndorsedVault struct { + Vault common.Address + Asset common.Address + ReleaseVersion *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterNewEndorsedVault is a free log retrieval operation binding the contract event 0x5bf19cf6c9f6c9210bc8cfecb4fda8057ebe0c41e300b60c5efa3de7f98f2f35. +// +// Solidity: event NewEndorsedVault(address indexed vault, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) FilterNewEndorsedVault(opts *bind.FilterOpts, vault []common.Address, asset []common.Address) (*YRegistryV4NewEndorsedVaultIterator, error) { + + var vaultRule []interface{} + for _, vaultItem := range vault { + vaultRule = append(vaultRule, vaultItem) + } + var assetRule []interface{} + for _, assetItem := range asset { + assetRule = append(assetRule, assetItem) + } + + logs, sub, err := _YRegistryV4.contract.FilterLogs(opts, "NewEndorsedVault", vaultRule, assetRule) + if err != nil { + return nil, err + } + return &YRegistryV4NewEndorsedVaultIterator{contract: _YRegistryV4.contract, event: "NewEndorsedVault", logs: logs, sub: sub}, nil +} + +// WatchNewEndorsedVault is a free log subscription operation binding the contract event 0x5bf19cf6c9f6c9210bc8cfecb4fda8057ebe0c41e300b60c5efa3de7f98f2f35. +// +// Solidity: event NewEndorsedVault(address indexed vault, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) WatchNewEndorsedVault(opts *bind.WatchOpts, sink chan<- *YRegistryV4NewEndorsedVault, vault []common.Address, asset []common.Address) (event.Subscription, error) { + + var vaultRule []interface{} + for _, vaultItem := range vault { + vaultRule = append(vaultRule, vaultItem) + } + var assetRule []interface{} + for _, assetItem := range asset { + assetRule = append(assetRule, assetItem) + } + + logs, sub, err := _YRegistryV4.contract.WatchLogs(opts, "NewEndorsedVault", vaultRule, assetRule) + 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(YRegistryV4NewEndorsedVault) + if err := _YRegistryV4.contract.UnpackLog(event, "NewEndorsedVault", 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 +} + +// ParseNewEndorsedVault is a log parse operation binding the contract event 0x5bf19cf6c9f6c9210bc8cfecb4fda8057ebe0c41e300b60c5efa3de7f98f2f35. +// +// Solidity: event NewEndorsedVault(address indexed vault, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) ParseNewEndorsedVault(log types.Log) (*YRegistryV4NewEndorsedVault, error) { + event := new(YRegistryV4NewEndorsedVault) + if err := _YRegistryV4.contract.UnpackLog(event, "NewEndorsedVault", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// YRegistryV4RemovedStrategyIterator is returned from FilterRemovedStrategy and is used to iterate over the raw logs and unpacked data for RemovedStrategy events raised by the YRegistryV4 contract. +type YRegistryV4RemovedStrategyIterator struct { + Event *YRegistryV4RemovedStrategy // 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 *YRegistryV4RemovedStrategyIterator) 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(YRegistryV4RemovedStrategy) + 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(YRegistryV4RemovedStrategy) + 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 *YRegistryV4RemovedStrategyIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *YRegistryV4RemovedStrategyIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// YRegistryV4RemovedStrategy represents a RemovedStrategy event raised by the YRegistryV4 contract. +type YRegistryV4RemovedStrategy struct { + Strategy common.Address + Asset common.Address + ReleaseVersion *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemovedStrategy is a free log retrieval operation binding the contract event 0xd7cdfeb9ab09d32e715ad82cdf2440286c5d462f66b98170a579195945800953. +// +// Solidity: event RemovedStrategy(address indexed strategy, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) FilterRemovedStrategy(opts *bind.FilterOpts, strategy []common.Address, asset []common.Address) (*YRegistryV4RemovedStrategyIterator, error) { + + var strategyRule []interface{} + for _, strategyItem := range strategy { + strategyRule = append(strategyRule, strategyItem) + } + var assetRule []interface{} + for _, assetItem := range asset { + assetRule = append(assetRule, assetItem) + } + + logs, sub, err := _YRegistryV4.contract.FilterLogs(opts, "RemovedStrategy", strategyRule, assetRule) + if err != nil { + return nil, err + } + return &YRegistryV4RemovedStrategyIterator{contract: _YRegistryV4.contract, event: "RemovedStrategy", logs: logs, sub: sub}, nil +} + +// WatchRemovedStrategy is a free log subscription operation binding the contract event 0xd7cdfeb9ab09d32e715ad82cdf2440286c5d462f66b98170a579195945800953. +// +// Solidity: event RemovedStrategy(address indexed strategy, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) WatchRemovedStrategy(opts *bind.WatchOpts, sink chan<- *YRegistryV4RemovedStrategy, strategy []common.Address, asset []common.Address) (event.Subscription, error) { + + var strategyRule []interface{} + for _, strategyItem := range strategy { + strategyRule = append(strategyRule, strategyItem) + } + var assetRule []interface{} + for _, assetItem := range asset { + assetRule = append(assetRule, assetItem) + } + + logs, sub, err := _YRegistryV4.contract.WatchLogs(opts, "RemovedStrategy", strategyRule, assetRule) + 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(YRegistryV4RemovedStrategy) + if err := _YRegistryV4.contract.UnpackLog(event, "RemovedStrategy", 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 +} + +// ParseRemovedStrategy is a log parse operation binding the contract event 0xd7cdfeb9ab09d32e715ad82cdf2440286c5d462f66b98170a579195945800953. +// +// Solidity: event RemovedStrategy(address indexed strategy, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) ParseRemovedStrategy(log types.Log) (*YRegistryV4RemovedStrategy, error) { + event := new(YRegistryV4RemovedStrategy) + if err := _YRegistryV4.contract.UnpackLog(event, "RemovedStrategy", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// YRegistryV4RemovedVaultIterator is returned from FilterRemovedVault and is used to iterate over the raw logs and unpacked data for RemovedVault events raised by the YRegistryV4 contract. +type YRegistryV4RemovedVaultIterator struct { + Event *YRegistryV4RemovedVault // 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 *YRegistryV4RemovedVaultIterator) 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(YRegistryV4RemovedVault) + 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(YRegistryV4RemovedVault) + 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 *YRegistryV4RemovedVaultIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *YRegistryV4RemovedVaultIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// YRegistryV4RemovedVault represents a RemovedVault event raised by the YRegistryV4 contract. +type YRegistryV4RemovedVault struct { + Vault common.Address + Asset common.Address + ReleaseVersion *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemovedVault is a free log retrieval operation binding the contract event 0x90f0b136797e67e4987983b7f7326571b458a7fd5cb6fb3e1209fdea9483b4cf. +// +// Solidity: event RemovedVault(address indexed vault, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) FilterRemovedVault(opts *bind.FilterOpts, vault []common.Address, asset []common.Address) (*YRegistryV4RemovedVaultIterator, error) { + + var vaultRule []interface{} + for _, vaultItem := range vault { + vaultRule = append(vaultRule, vaultItem) + } + var assetRule []interface{} + for _, assetItem := range asset { + assetRule = append(assetRule, assetItem) + } + + logs, sub, err := _YRegistryV4.contract.FilterLogs(opts, "RemovedVault", vaultRule, assetRule) + if err != nil { + return nil, err + } + return &YRegistryV4RemovedVaultIterator{contract: _YRegistryV4.contract, event: "RemovedVault", logs: logs, sub: sub}, nil +} + +// WatchRemovedVault is a free log subscription operation binding the contract event 0x90f0b136797e67e4987983b7f7326571b458a7fd5cb6fb3e1209fdea9483b4cf. +// +// Solidity: event RemovedVault(address indexed vault, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) WatchRemovedVault(opts *bind.WatchOpts, sink chan<- *YRegistryV4RemovedVault, vault []common.Address, asset []common.Address) (event.Subscription, error) { + + var vaultRule []interface{} + for _, vaultItem := range vault { + vaultRule = append(vaultRule, vaultItem) + } + var assetRule []interface{} + for _, assetItem := range asset { + assetRule = append(assetRule, assetItem) + } + + logs, sub, err := _YRegistryV4.contract.WatchLogs(opts, "RemovedVault", vaultRule, assetRule) + 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(YRegistryV4RemovedVault) + if err := _YRegistryV4.contract.UnpackLog(event, "RemovedVault", 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 +} + +// ParseRemovedVault is a log parse operation binding the contract event 0x90f0b136797e67e4987983b7f7326571b458a7fd5cb6fb3e1209fdea9483b4cf. +// +// Solidity: event RemovedVault(address indexed vault, address indexed asset, uint256 releaseVersion) +func (_YRegistryV4 *YRegistryV4Filterer) ParseRemovedVault(log types.Log) (*YRegistryV4RemovedVault, error) { + event := new(YRegistryV4RemovedVault) + if err := _YRegistryV4.contract.UnpackLog(event, "RemovedVault", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/common/env/chain.arbitrum.go b/common/env/chain.arbitrum.go new file mode 100644 index 000000000..fcb7b0830 --- /dev/null +++ b/common/env/chain.arbitrum.go @@ -0,0 +1,76 @@ +package env + +import ( + "math" + "strconv" + + "github.com/ethereum/go-ethereum/common" + "github.com/yearn/ydaemon/internal/models" +) + +var ARBITRUM = TChain{ + ID: 42161, + RpcURI: `https://arbitrum.public-rpc.com`, + SubgraphURI: `https://api.thegraph.com/subgraphs/name/yearn/yearn-vaults-v2-arbitrum`, + MaxBlockRange: 100_000_000, + MaxBatchSize: math.MaxInt64, + LensContract: TContractData{ + Address: common.HexToAddress(`0x043518AB266485dC085a1DB095B8d9C2Fc78E9b9`), + Block: 2396321, + }, + MulticallContract: TContractData{ + Address: common.HexToAddress(`0x842eC2c7D803033Edf55E478F461FC547Bc54EB2`), + Block: 821923, + }, + PartnerContract: TContractData{ + Address: common.HexToAddress(`0x0e5b46E4b2a05fd53F5a4cD974eb98a9a613bcb7`), + Block: 30385403, + }, + Coin: models.TERC20Token{ + Address: DEFAULT_COIN_ADDRESS, + UnderlyingTokensAddresses: []common.Address{}, + Type: models.TokenTypeNative, + Name: `Arbitrum`, + Symbol: `ARB`, + DisplayName: `Arbitrum`, + DisplaySymbol: `ARB`, + Description: `Arbitrum is a Layer 2 scaling solution for Ethereum.`, + Icon: BASE_ASSET_URL + strconv.FormatUint(42161, 10) + `/` + DEFAULT_COIN_ADDRESS.Hex() + `/logo-128.png`, + Decimals: 18, + ChainID: 42161, + }, + Registries: []TContractData{ + { + Address: common.HexToAddress("0x3199437193625DCcD6F9C9e98BDf93582200Eb1f"), + Version: 2, + Block: 4841854, + }, + }, + ExtraVaults: []models.TVaultsFromRegistry{}, + BlacklistedVaults: []common.Address{ + common.HexToAddress("0x5796698A29F3626c9FE13C4d3d3dEE987c84EBB3"), // Test deployment - Nothing + common.HexToAddress("0x976a1C749cd8153909e0B04EebE931eF8957b15b"), // Test deployment - PHPTest + common.HexToAddress("0xFa247d0D55a324ca19985577a2cDcFC383D87953"), // Test deployment - PHP + }, + ExtraTokens: []common.Address{ + common.HexToAddress(`0x82e3A8F066a6989666b031d916c43672085b1582`), // YFI + common.HexToAddress(`0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978`), // CRV + }, + IgnoredTokens: []common.Address{ + common.HexToAddress("0x5796698A29F3626c9FE13C4d3d3dEE987c84EBB3"), // Test deployment - Nothing + common.HexToAddress("0x976a1C749cd8153909e0B04EebE931eF8957b15b"), // Test deployment - PHPTest + common.HexToAddress("0xFa247d0D55a324ca19985577a2cDcFC383D87953"), // Test deployment - PHP + }, + Curve: TChainCurve{ + RegistryAddress: common.HexToAddress(`0x0000000022d53366457f9d5e68ec105046fc4383`), + FactoryAddress: common.Address{}, + FactoryURIs: []string{ + `https://api.curve.fi/api/getPools/arbitrum/factory`, + }, + PoolsURIs: []string{ + `https://api.curve.fi/api/getPools/arbitrum/main`, + `https://api.curve.fi/api/getPools/arbitrum/crypto`, + `https://api.curve.fi/api/getPools/arbitrum/factory`, + }, + }, +} diff --git a/common/env/chain.base.go b/common/env/chain.base.go new file mode 100644 index 000000000..2d4eb8e67 --- /dev/null +++ b/common/env/chain.base.go @@ -0,0 +1,61 @@ +package env + +import ( + "math" + "strconv" + + "github.com/ethereum/go-ethereum/common" + "github.com/yearn/ydaemon/internal/models" +) + +var BASE = TChain{ + ID: 8453, + RpcURI: `https://developer-access-mainnet.base.org`, + SubgraphURI: `https://api.thegraph.com/subgraphs/name/rareweasel/yearn-vaults-v2-subgraph-base`, + MaxBlockRange: 100_000_000, + MaxBatchSize: math.MaxInt64, + LensContract: TContractData{ + Address: common.HexToAddress(`0xE0F3D78DB7bC111996864A32d22AB0F59Ca5Fa86`), + Block: 3318817, + }, + MulticallContract: TContractData{ + Address: common.HexToAddress(`0xca11bde05977b3631167028862be2a173976ca11`), + Block: 5022, + }, + Coin: models.TERC20Token{ + Address: DEFAULT_COIN_ADDRESS, + UnderlyingTokensAddresses: []common.Address{}, + Type: models.TokenTypeNative, + Name: `Ether`, + Symbol: `ETH`, + DisplayName: `Ether`, + DisplaySymbol: `ETH`, + Description: `Base is a Layer 2 scaling solution based on Optimism.`, + Icon: BASE_ASSET_URL + strconv.FormatUint(8453, 10) + `/` + DEFAULT_COIN_ADDRESS.Hex() + `/logo-128.png`, + Decimals: 18, + ChainID: 8453, + }, + Registries: []TContractData{ + { + Address: common.HexToAddress("0xF3885eDe00171997BFadAa98E01E167B53a78Ec5"), + Version: 3, + Block: 3263730, + }, + }, + ExtraVaults: []models.TVaultsFromRegistry{}, + BlacklistedVaults: []common.Address{}, + ExtraTokens: []common.Address{}, + IgnoredTokens: []common.Address{}, + Curve: TChainCurve{ + RegistryAddress: common.Address{}, + FactoryAddress: common.Address{}, + FactoryURIs: []string{ + `https://api.curve.fi/api/getPools/base/factory`, + }, + PoolsURIs: []string{ + `https://api.curve.fi/api/getPools/base/main`, + `https://api.curve.fi/api/getPools/base/crypto`, + `https://api.curve.fi/api/getPools/base/factory`, + }, + }, +} diff --git a/common/env/chain.ethereum.go b/common/env/chain.ethereum.go new file mode 100644 index 000000000..301f84715 --- /dev/null +++ b/common/env/chain.ethereum.go @@ -0,0 +1,130 @@ +package env + +import ( + "math" + "strconv" + + "github.com/ethereum/go-ethereum/common" + "github.com/yearn/ydaemon/internal/models" +) + +var ETHEREUM = TChain{ + ID: 1, + RpcURI: `https://eth.public-rpc.com`, + SubgraphURI: `https://api.thegraph.com/subgraphs/name/rareweasel/yearn-vaults-v2-subgraph-mainnet`, + MaxBlockRange: 100_000_000, + MaxBatchSize: math.MaxInt64, + YBribeV3Contract: TContractData{ + Address: common.HexToAddress(`0x03dFdBcD4056E2F92251c7B07423E1a33a7D3F6d`), + Block: 15878262, + }, + LensContract: TContractData{ + Address: common.HexToAddress(`0x83d95e0D5f402511dB06817Aff3f9eA88224B030`), + Block: 12242339, + }, + MulticallContract: TContractData{ + Address: common.HexToAddress(`0x5ba1e12693dc8f9c48aad8770482f4739beed696`), + Block: 12336033, + }, + PartnerContract: TContractData{ + Address: common.HexToAddress(`0x8ee392a4787397126C163Cb9844d7c447da419D8`), + Block: 14166636, + }, + Coin: models.TERC20Token{ + Address: DEFAULT_COIN_ADDRESS, + UnderlyingTokensAddresses: []common.Address{}, + Type: models.TokenTypeNative, + Name: `Ether`, + Symbol: `ETH`, + DisplayName: `Ether`, + DisplaySymbol: `ETH`, + Description: `Ether is the native cryptocurrency for the Ethereum blockchain.`, + Icon: BASE_ASSET_URL + strconv.FormatUint(1, 10) + `/` + DEFAULT_COIN_ADDRESS.Hex() + `/logo-128.png`, + Decimals: 18, + ChainID: 1, + }, + Registries: []TContractData{ + { + Address: common.HexToAddress("0xe15461b18ee31b7379019dc523231c57d1cbc18c"), + Version: 1, + Block: 11563389, + }, + { + Address: common.HexToAddress("0x50c1a2eA0a861A967D9d0FFE2AE4012c2E053804"), + Version: 2, + Block: 12045555, + }, + { + Address: common.HexToAddress("0xaF1f5e1c19cB68B30aAD73846eFfDf78a5863319"), + Version: 3, + Block: 16215519, + }, + }, + ExtraVaults: []models.TVaultsFromRegistry{}, + BlacklistedVaults: []common.Address{ + common.HexToAddress("0x662fBF2c1E4b04342EeBA6371ec1C7420042B86F"), // Test deployment - Nothing + common.HexToAddress("0x9C13e225AE007731caA49Fd17A41379ab1a489F4"), // Test deployment - Nothing + common.HexToAddress("0xBF7AA989192b020a8d3e1C65a558e123834325cA"), // HBTC yVault - Not Yearn - PPS 0 + common.HexToAddress("0x4Fdd1B06eF986238446be0F3EA163C1b6Fe28cC1"), // GUSD yVault - Not Yearn - PPS 100 + common.HexToAddress("0x8a0889d47f9Aa0Fac1cC718ba34E26b867437880"), // Old st-yCRV + common.HexToAddress("0x61f46C65E403429266e8b569F23f70dD75d9BeE7"), // Old lp-yCRV + // + common.HexToAddress("0x98E86Ed5b0E48734430BfBe92101156C75418cad"), // yearn BAL - Disabled for now + common.HexToAddress("0xc09cfb625e586B117282399433257a1C0841edf3"), // Staked Yearn BAL Vault - Disabled for now + common.HexToAddress("0xD725F5742047B4B4A3110D0b38284227fcaB041e"), // LP Yearn BAL Vault - Disabled for now + common.HexToAddress("0xD61e198e139369a40818FE05F5d5e6e045Cd6eaF"), // Balancer yBAL Stable Pool - Disabled for now + }, + ExtraTokens: []common.Address{ + common.HexToAddress("0x34fe2a45D8df28459d7705F37eD13d7aE4382009"), // yvWBTC + common.HexToAddress("0xD533a949740bb3306d119CC777fa900bA034cd52"), // CRV - used by yBribe UI + common.HexToAddress("0x090185f2135308BaD17527004364eBcC2D37e5F6"), // Spell - used by yBribe UI + common.HexToAddress("0xCdF7028ceAB81fA0C6971208e83fa7872994beE5"), // TNT - used by yBribe UI + common.HexToAddress("0xba100000625a3754423978a60c9317c58a424e3D"), // BAL - used by yBAL UI + common.HexToAddress("0x5c6Ee304399DBdB9C8Ef030aB642B10820DB8F56"), // BALWETH - used by yBAL UI + common.HexToAddress(`0x30D20208d987713f46DFD34EF128Bb16C404D10f`), // Stader + common.HexToAddress(`0xa2E3356610840701BDf5611a53974510Ae27E2e1`), // wBETH + common.HexToAddress(`0xac3E018457B222d93114458476f3E3416Abbe38F`), // Staked Frax Ether + common.HexToAddress(`0xf951E335afb289353dc249e82926178EaC7DEd78`), // Swell Network Ether + common.HexToAddress(`0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0`), // Wrapped liquid staked Ether 2.0 + common.HexToAddress(`0xA35b1B31Ce002FBF2058D22F30f95D405200A15b`), // Stader ETHx + common.HexToAddress(`0xBe9895146f7AF43049ca1c1AE358B0541Ea49704`), // Coinbase Wrapped Staked ETH + common.HexToAddress(`0x583019fF0f430721aDa9cfb4fac8F06cA104d0B4`), // st-yETH + }, + IgnoredTokens: []common.Address{ + common.HexToAddress(`0x7AB4a7BE740131BdE216521B54ADddD672F44A05`), // nothing + common.HexToAddress(`0x61f46C65E403429266e8b569F23f70dD75d9BeE7`), // Old lp-yCRV + common.HexToAddress(`0x8a0889d47f9Aa0Fac1cC718ba34E26b867437880`), // Old st-yCRV + common.HexToAddress(`0x4c1317326fD8EFDeBdBE5e1cd052010D97723bd6`), // Another old st-yCRV + common.HexToAddress(`0x2E919d27D515868f3D5Bc9110fa738f9449FC6ad`), // Old yvCurve-yveCRV pool + common.HexToAddress(`0x7E46fd8a30869aa9ed55af031067Df666EfE87da`), // Old yvecrv-f + common.HexToAddress(`0x5904BAcE7a9cCab585242e9d22f67C9f2F1BF7E2`), // nothing + common.HexToAddress(`0x0309A528bBa0394dC4A2Ce59123C52E317A54604`), // Old yCRV-f + common.HexToAddress(`0xBF7AA989192b020a8d3e1C65a558e123834325cA`), // Irrelevant HBTC yVault + common.HexToAddress(`0xe92AE2cF5b373c1713eB5855D4D3aF81D8a8aCAE`), // Curve Stax Frax/Temple xLP + LP yVault - Unlisted + common.HexToAddress(`0x3883f5e181fccaF8410FA61e12b59BAd963fb645`), // Theta: Old Token + common.HexToAddress(`0xC4C319E2D4d66CcA4464C0c2B32c9Bd23ebe784e`), // Hacked alETH + common.HexToAddress(`0x718AbE90777F5B778B52D553a5aBaa148DD0dc5D`), // Hacked vault + common.HexToAddress("0x662fBF2c1E4b04342EeBA6371ec1C7420042B86F"), // Test deployment - Nothing + common.HexToAddress("0x9C13e225AE007731caA49Fd17A41379ab1a489F4"), // Test deployment - Nothing + common.HexToAddress("0x4Fdd1B06eF986238446be0F3EA163C1b6Fe28cC1"), // GUSD yVault - Not Yearn - PPS 100 + // + common.HexToAddress("0x98E86Ed5b0E48734430BfBe92101156C75418cad"), // yearn BAL - Disabled for now + common.HexToAddress("0xc09cfb625e586B117282399433257a1C0841edf3"), // Staked Yearn BAL Vault - Disabled for now + common.HexToAddress("0xD725F5742047B4B4A3110D0b38284227fcaB041e"), // LP Yearn BAL Vault - Disabled for now + common.HexToAddress("0xD61e198e139369a40818FE05F5d5e6e045Cd6eaF"), // Balancer yBAL Stable Pool - Disabled for now + }, + Curve: TChainCurve{ + RegistryAddress: common.HexToAddress(`0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5`), + FactoryAddress: common.HexToAddress(`0xF18056Bbd320E96A48e3Fbf8bC061322531aac99`), + FactoryURIs: []string{ + `https://api.curve.fi/api/getPools/ethereum/factory`, + `https://api.curve.fi/api/getPools/ethereum/factory-crypto`, + }, + PoolsURIs: []string{ + `https://api.curve.fi/api/getPools/ethereum/main`, + `https://api.curve.fi/api/getPools/ethereum/crypto`, + `https://api.curve.fi/api/getPools/ethereum/factory`, + `https://api.curve.fi/api/getPools/ethereum/factory-crypto`, + }, + }, +} diff --git a/common/env/chain.fantom.go b/common/env/chain.fantom.go new file mode 100644 index 000000000..981367513 --- /dev/null +++ b/common/env/chain.fantom.go @@ -0,0 +1,85 @@ +package env + +import ( + "math" + "strconv" + + "github.com/ethereum/go-ethereum/common" + "github.com/yearn/ydaemon/internal/models" +) + +var FANTOM = TChain{ + ID: 250, + RpcURI: `https://rpc.ftm.tools`, + SubgraphURI: `https://api.thegraph.com/subgraphs/name/yearn/yearn-vaults-v2-fantom`, + MaxBlockRange: 100_000_000, + MaxBatchSize: math.MaxInt64, + LensContract: TContractData{ + Address: common.HexToAddress(`0x57AA88A0810dfe3f9b71a9b179Dd8bF5F956C46A`), + Block: 17091856, + }, + MulticallContract: TContractData{ + Address: common.HexToAddress(`0x470ADB45f5a9ac3550bcFFaD9D990Bf7e2e941c9`), + Block: 19328162, + }, + PartnerContract: TContractData{ + Address: common.HexToAddress(`0x086865B2983320b36C42E48086DaDc786c9Ac73B`), + Block: 40499061, + }, + Coin: models.TERC20Token{ + Address: DEFAULT_COIN_ADDRESS, + UnderlyingTokensAddresses: []common.Address{}, + Type: models.TokenTypeNative, + Name: `Fantom`, + Symbol: `FTM`, + DisplayName: `Fantom`, + DisplaySymbol: `FTM`, + Description: `Fantom is a Layer 2 scaling solution for Ethereum.`, + Icon: BASE_ASSET_URL + strconv.FormatUint(250, 10) + `/` + DEFAULT_COIN_ADDRESS.Hex() + `/logo-128.png`, + Decimals: 18, + ChainID: 250, + }, + Registries: []TContractData{ + { + Address: common.HexToAddress("0x727fe1759430df13655ddb0731dE0D0FDE929b04"), + Version: 2, + Block: 18455565, + }, + }, + ExtraVaults: []models.TVaultsFromRegistry{ + { + //yvMIM, alone in it's own registry, not work registering and listening to it + ChainID: 250, + Address: common.HexToAddress(`0x0A0b23D9786963DE69CB2447dC125c49929419d8`), + RegistryAddress: common.HexToAddress(`0x265F7b1413F6B06654746cf2485082182389A5d0`), + TokenAddress: common.HexToAddress(`0x82f0b8b456c1a451378467398982d4834b6829c1`), + APIVersion: `0.4.3`, + BlockNumber: 18309707, + Activation: 18302860, + ManagementFee: 200, + BlockHash: common.HexToHash(`0x00009ee300000d281b4c0169bb3320b32f435e3fd830fe1625adcfd4cf6410cb`), + TxIndex: 0, + LogIndex: 0, + Type: models.TokenTypeStandardVault, + }, + }, + BlacklistedVaults: []common.Address{ + common.HexToAddress("0x03B82e4070cA32FF63A03F2EcfC16c0165689a9d"), // Test deployment - AVAX + }, + ExtraTokens: []common.Address{}, + IgnoredTokens: []common.Address{ + common.HexToAddress("0x03B82e4070cA32FF63A03F2EcfC16c0165689a9d"), // Test deployment - AVAX + }, + Curve: TChainCurve{ + RegistryAddress: common.HexToAddress(`0x0000000022d53366457f9d5e68ec105046fc4383`), + FactoryAddress: common.Address{}, + FactoryURIs: []string{ + `https://api.curve.fi/api/getPools/fantom/factory`, + }, + PoolsURIs: []string{ + `https://api.curve.fi/api/getPools/fantom/main`, + `https://api.curve.fi/api/getPools/fantom/crypto`, + `https://api.curve.fi/api/getPools/fantom/factory`, + }, + }, +} diff --git a/common/env/chain.optimism.go b/common/env/chain.optimism.go new file mode 100644 index 000000000..7ebe3df82 --- /dev/null +++ b/common/env/chain.optimism.go @@ -0,0 +1,84 @@ +package env + +import ( + "math" + "strconv" + + "github.com/ethereum/go-ethereum/common" + "github.com/yearn/ydaemon/internal/models" +) + +var OPTIMISM = TChain{ + ID: 10, + RpcURI: `https://mainnet.optimism.io`, + SubgraphURI: `https://api.thegraph.com/subgraphs/name/yearn/yearn-vaults-v2-optimism`, + MaxBlockRange: 100_000_000, + MaxBatchSize: math.MaxInt64, + LensContract: TContractData{ + Address: common.HexToAddress(`0xB082d9f4734c535D9d80536F7E87a6f4F471bF65`), + Block: 18109291, + }, + MulticallContract: TContractData{ + Address: common.HexToAddress(`0xca11bde05977b3631167028862be2a173976ca11`), + Block: 4286263, + }, + StackingRewardContract: TContractData{ + Address: common.HexToAddress(`0x8ed9f6343f057870f1def47aae7cd88dfaa049a8`), + Block: 85969070, + }, + PartnerContract: TContractData{ + Address: common.HexToAddress(`0x7E08735690028cdF3D81e7165493F1C34065AbA2`), + Block: 29675215, + }, + Coin: models.TERC20Token{ + Address: DEFAULT_COIN_ADDRESS, + UnderlyingTokensAddresses: []common.Address{}, + Type: models.TokenTypeNative, + Name: `Ether`, + Symbol: `ETH`, + DisplayName: `Ether`, + DisplaySymbol: `ETH`, + Description: `Optimism is a Layer 2 scaling solution for Ethereum.`, + Icon: BASE_ASSET_URL + strconv.FormatUint(10, 10) + `/` + DEFAULT_COIN_ADDRESS.Hex() + `/logo-128.png`, + Decimals: 18, + ChainID: 10, + }, + Registries: []TContractData{ + { + Address: common.HexToAddress("0x81291ceb9bB265185A9D07b91B5b50Df94f005BF"), + Version: 3, + Block: 22450349, + }, + { + Address: common.HexToAddress("0x79286Dd38C9017E5423073bAc11F53357Fc5C128"), + Version: 3, + Block: 22451152, + }, + }, + ExtraVaults: []models.TVaultsFromRegistry{}, + BlacklistedVaults: []common.Address{ + common.HexToAddress("0x6884bd538Db61A626Da0a05E10807BFC5Aea2b32"), // Test deployment - Nothing + common.HexToAddress("0xDB8bBF2b0e28721F9BAc603e687E39bcF52201f8"), // Test deployment - Nothing + common.HexToAddress("0xed5D83bB6Af23bcb05C144DC816f45A389d622a0"), // Test deployment - Nothing + }, + ExtraTokens: []common.Address{ + common.HexToAddress("0x4200000000000000000000000000000000000042"), // Opt + }, + IgnoredTokens: []common.Address{ + common.HexToAddress("0x6884bd538Db61A626Da0a05E10807BFC5Aea2b32"), // Test deployment - Nothing + common.HexToAddress("0xDB8bBF2b0e28721F9BAc603e687E39bcF52201f8"), // Test deployment - Nothing + common.HexToAddress("0xed5D83bB6Af23bcb05C144DC816f45A389d622a0"), // Test deployment - Nothing + }, + Curve: TChainCurve{ + RegistryAddress: common.HexToAddress(`0x0000000022d53366457f9d5e68ec105046fc4383`), + FactoryAddress: common.Address{}, + FactoryURIs: []string{ + `https://api.curve.fi/api/getPools/optimism/factory`, + }, + PoolsURIs: []string{ + `https://api.curve.fi/api/getPools/optimism/main`, + `https://api.curve.fi/api/getPools/optimism/crypto`, + `https://api.curve.fi/api/getPools/optimism/factory`, + }, + }, +} diff --git a/common/env/chain.polygon.go b/common/env/chain.polygon.go new file mode 100644 index 000000000..2ea78d690 --- /dev/null +++ b/common/env/chain.polygon.go @@ -0,0 +1,58 @@ +package env + +import ( + "math" + "strconv" + + "github.com/ethereum/go-ethereum/common" + "github.com/yearn/ydaemon/internal/models" +) + +var POLYGON = TChain{ + ID: 137, + RpcURI: `https://polygon.llamarpc.com`, + SubgraphURI: ``, //TODO: not deployed + MaxBlockRange: 100_000_000, + MaxBatchSize: math.MaxInt64, + LensContract: TContractData{}, //TODO: not deployed + MulticallContract: TContractData{ + Address: common.HexToAddress(`0xca11bde05977b3631167028862be2a173976ca11`), + Block: 25770160, + }, + Coin: models.TERC20Token{ + Address: DEFAULT_COIN_ADDRESS, + UnderlyingTokensAddresses: []common.Address{}, + Type: models.TokenTypeNative, + Name: `Matic`, + Symbol: `Matic`, + DisplayName: `Matic`, + DisplaySymbol: `Matic`, + Description: `Matic is the Value Layer of the Internet`, + Icon: BASE_ASSET_URL + strconv.FormatUint(137, 10) + `/` + DEFAULT_COIN_ADDRESS.Hex() + `/logo-128.png`, + Decimals: 18, + ChainID: 137, + }, + Registries: []TContractData{ + { + Address: common.HexToAddress("0xFBB087B456a656Ab815EB2D0f3f21Aa409Cec33F"), + Version: 4, + Block: 47462833, + }, + }, + ExtraVaults: []models.TVaultsFromRegistry{}, + BlacklistedVaults: []common.Address{}, + ExtraTokens: []common.Address{}, + IgnoredTokens: []common.Address{}, + Curve: TChainCurve{ + RegistryAddress: common.HexToAddress(`0x0000000022d53366457f9d5e68ec105046fc4383`), + FactoryAddress: common.Address{}, + FactoryURIs: []string{ + `https://api.curve.fi/api/getPools/polygon/factory`, + }, + PoolsURIs: []string{ + `https://api.curve.fi/api/getPools/polygon/main`, + `https://api.curve.fi/api/getPools/polygon/crypto`, + `https://api.curve.fi/api/getPools/polygon/factory`, + }, + }, +} diff --git a/common/env/chains.go b/common/env/chains.go new file mode 100644 index 000000000..097ac386b --- /dev/null +++ b/common/env/chains.go @@ -0,0 +1,52 @@ +package env + +import ( + "github.com/ethereum/go-ethereum/common" + "github.com/yearn/ydaemon/internal/models" +) + +type TChainCurve struct { + RegistryAddress common.Address + FactoryAddress common.Address + FactoryURIs []string + PoolsURIs []string +} +type TChain struct { + ID uint64 + RpcURI string + SubgraphURI string + MaxBlockRange uint64 + MaxBatchSize int + LensContract TContractData + MulticallContract TContractData + StackingRewardContract TContractData + YBribeV3Contract TContractData + PartnerContract TContractData + Coin models.TERC20Token + Registries []TContractData + ExtraVaults []models.TVaultsFromRegistry + BlacklistedVaults []common.Address + ExtraTokens []common.Address + IgnoredTokens []common.Address + Curve TChainCurve +} + +var DEFAULT_COIN_ADDRESS = common.HexToAddress(`0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`) + +// CHAINS is the list of supported chains +var CHAINS = map[uint64]TChain{ + 1: ETHEREUM, + 10: OPTIMISM, + 137: POLYGON, + 250: FANTOM, + 8453: BASE, + 42161: ARBITRUM, +} + +var SUPPORTED_CHAIN_IDS = []uint64{} + +func init() { + for k := range CHAINS { + SUPPORTED_CHAIN_IDS = append(SUPPORTED_CHAIN_IDS, k) + } +} diff --git a/common/env/constants.go b/common/env/constants.go index 15213b04e..8f963d7eb 100755 --- a/common/env/constants.go +++ b/common/env/constants.go @@ -1,13 +1,11 @@ package env import ( - "math" "path" "path/filepath" "runtime" "github.com/ethereum/go-ethereum/common" - "github.com/yearn/ydaemon/internal/models" ) type TContractData struct { @@ -37,273 +35,3 @@ var LLAMA_PRICE_URL = `https://coins.llama.fi/prices/current/` // API_V1_BASE_URL is the base URL to access query the legacy Yearn's api var API_V1_BASE_URL = `https://api.yexporter.io/v1/chains/` - -// SUPPORTED_CHAIN_IDS is the list of supported chain IDs -var SUPPORTED_CHAIN_IDS = []uint64{1, 10, 250, 8453, 42161} - -// MAX_BLOCK_RANGE is the maximum number of blocks we can query in a single request -var MAX_BLOCK_RANGE = map[uint64]uint64{ - 1: 100_000_000, - 10: 100_000_000, - 250: 100_000_000, - 8453: 100_000_000, - 42161: 100_000_000, -} - -// MAX_BATCH_SIZE is the maximum size request for a multicall -var MAX_BATCH_SIZE = map[uint64]int{ - 1: math.MaxInt64, - 10: math.MaxInt64, - 250: math.MaxInt64, - 8453: math.MaxInt64, - 42161: math.MaxInt64, -} - -// BLACKLISTED_VAULTS contains the vault we should not work with -var BLACKLISTED_VAULTS = map[uint64][]common.Address{ - 1: { - common.HexToAddress("0x662fBF2c1E4b04342EeBA6371ec1C7420042B86F"), // Test deployment - Nothing - common.HexToAddress("0x9C13e225AE007731caA49Fd17A41379ab1a489F4"), // Test deployment - Nothing - common.HexToAddress("0xBF7AA989192b020a8d3e1C65a558e123834325cA"), // HBTC yVault - Not Yearn - PPS 0 - common.HexToAddress("0x4Fdd1B06eF986238446be0F3EA163C1b6Fe28cC1"), // GUSD yVault - Not Yearn - PPS 100 - common.HexToAddress("0x8a0889d47f9Aa0Fac1cC718ba34E26b867437880"), // Old st-yCRV - common.HexToAddress("0x61f46C65E403429266e8b569F23f70dD75d9BeE7"), // Old lp-yCRV - - }, - 10: { - common.HexToAddress("0x6884bd538Db61A626Da0a05E10807BFC5Aea2b32"), // Test deployment - Nothing - common.HexToAddress("0xDB8bBF2b0e28721F9BAc603e687E39bcF52201f8"), // Test deployment - Nothing - common.HexToAddress("0xed5D83bB6Af23bcb05C144DC816f45A389d622a0"), // Test deployment - Nothing - }, - 250: { - common.HexToAddress("0x03B82e4070cA32FF63A03F2EcfC16c0165689a9d"), // Test deployment - AVAX - }, - 8453: { - //TODO: ADD IGNORED VAULTS FOR BASE - }, - 42161: { - common.HexToAddress("0x5796698A29F3626c9FE13C4d3d3dEE987c84EBB3"), // Test deployment - Nothing - common.HexToAddress("0x976a1C749cd8153909e0B04EebE931eF8957b15b"), // Test deployment - PHPTest - common.HexToAddress("0xFa247d0D55a324ca19985577a2cDcFC383D87953"), // Test deployment - PHP - }, -} - -// CURVE_FACTORY_URI contains the URI of the Curve Factory to use -var CURVE_FACTORY_URI = map[uint64][]string{ - 1: { - `https://api.curve.fi/api/getPools/ethereum/factory`, - `https://api.curve.fi/api/getPools/ethereum/factory-crypto`, - }, - 10: { - `https://api.curve.fi/api/getPools/optimism/factory`, - }, - 250: { - `https://api.curve.fi/api/getPools/fantom/factory`, - }, - 8453: { - `https://api.curve.fi/api/getPools/base/factory`, - }, - 42161: { - `https://api.curve.fi/api/getPools/arbitrum/factory`, - }, -} - -// CURVE_POOLS_URI contains the URI of the Curve pools to use -var CURVE_POOLS_URI = map[uint64][]string{ - 1: { - `https://api.curve.fi/api/getPools/ethereum/main`, - `https://api.curve.fi/api/getPools/ethereum/crypto`, - `https://api.curve.fi/api/getPools/ethereum/factory`, - `https://api.curve.fi/api/getPools/ethereum/factory-crypto`, - }, - 10: { - `https://api.curve.fi/api/getPools/optimism/main`, - `https://api.curve.fi/api/getPools/optimism/crypto`, - `https://api.curve.fi/api/getPools/optimism/factory`, - }, - 250: { - `https://api.curve.fi/api/getPools/fantom/main`, - `https://api.curve.fi/api/getPools/fantom/crypto`, - `https://api.curve.fi/api/getPools/fantom/factory`, - }, - 8453: { - `https://api.curve.fi/api/getPools/base/main`, - `https://api.curve.fi/api/getPools/base/crypto`, - `https://api.curve.fi/api/getPools/base/factory`, - }, - 42161: { - `https://api.curve.fi/api/getPools/arbitrum/main`, - `https://api.curve.fi/api/getPools/arbitrum/crypto`, - `https://api.curve.fi/api/getPools/arbitrum/factory`, - }, -} - -// RPC_ENDPOINTS contains the node endpoints to connect the blockchains -// Can be overwritten by env variables -var RPC_ENDPOINTS = map[uint64]string{ - 1: `https://eth.public-rpc.com`, - 10: `https://mainnet.optimism.io`, - 56: `https://bsc.rpc.blxrbdn.com`, - 137: `https://polygon.llamarpc.com`, - 250: `https://rpc.ftm.tools`, - 8453: `https://developer-access-mainnet.base.org`, - 42161: `https://arbitrum.public-rpc.com`, -} - -// THEGRAPH_ENDPOINTS contains the URI of the GraphQL provider to use -var THEGRAPH_ENDPOINTS = map[uint64]string{ - 1: `https://api.thegraph.com/subgraphs/name/rareweasel/yearn-vaults-v2-subgraph-mainnet`, - 10: `https://api.thegraph.com/subgraphs/name/yearn/yearn-vaults-v2-optimism`, - 250: `https://api.thegraph.com/subgraphs/name/yearn/yearn-vaults-v2-fantom`, - 8453: `https://api.thegraph.com/subgraphs/name/rareweasel/yearn-vaults-v2-subgraph-base`, - 42161: `https://api.thegraph.com/subgraphs/name/yearn/yearn-vaults-v2-arbitrum`, -} - -// YEARN_REGISTRIES is the list of registries used by Yearn across all the supported chains, with the version and the activation block -var YEARN_REGISTRIES = map[uint64][]TContractData{ - 1: { - {Address: common.HexToAddress("0xe15461b18ee31b7379019dc523231c57d1cbc18c"), Version: 1, Block: 11563389}, - {Address: common.HexToAddress("0x50c1a2eA0a861A967D9d0FFE2AE4012c2E053804"), Version: 2, Block: 12045555}, - {Address: common.HexToAddress("0xaF1f5e1c19cB68B30aAD73846eFfDf78a5863319"), Version: 3, Block: 16215519}, - }, - 10: { - {Address: common.HexToAddress("0x81291ceb9bB265185A9D07b91B5b50Df94f005BF"), Version: 3, Block: 22450349}, - {Address: common.HexToAddress("0x79286Dd38C9017E5423073bAc11F53357Fc5C128"), Version: 3, Block: 22451152}, - }, - 250: { - {Address: common.HexToAddress("0x727fe1759430df13655ddb0731dE0D0FDE929b04"), Version: 2, Block: 18455565}, - }, - 8453: { - {Address: common.HexToAddress("0xF3885eDe00171997BFadAa98E01E167B53a78Ec5"), Version: 3, Block: 3263730}, - }, - 42161: { - {Address: common.HexToAddress("0x3199437193625DCcD6F9C9e98BDf93582200Eb1f"), Version: 2, Block: 4841854}, - }, -} - -// EXTRA_VAULTS is a list of vaults that are not registered in the registries, but are still used by Yearn -var EXTRA_VAULTS = map[uint64][]models.TVaultsFromRegistry{ - 1: {}, - 10: {}, - 250: { - { - //yvMIM, alone in it's own registry, not work registering and listening to it - ChainID: 250, - Address: common.HexToAddress(`0x0A0b23D9786963DE69CB2447dC125c49929419d8`), - RegistryAddress: common.HexToAddress(`0x265F7b1413F6B06654746cf2485082182389A5d0`), - TokenAddress: common.HexToAddress(`0x82f0b8b456c1a451378467398982d4834b6829c1`), - APIVersion: `0.4.3`, - BlockNumber: 18309707, - Activation: 18302860, - ManagementFee: 200, - BlockHash: common.HexToHash(`0x00009ee300000d281b4c0169bb3320b32f435e3fd830fe1625adcfd4cf6410cb`), - TxIndex: 0, - LogIndex: 0, - Type: models.VaultTypeStandard, - }, - }, - 8453: { - //TODO: ADD EXTRA_VAULTS FOR BASE - }, - 42161: {}, -} - -// LENS_ADDRESSES contains the address of the Lens oracle for a specific chainID -var LENS_ADDRESSES = map[uint64]common.Address{ - 1: common.HexToAddress(`0x83d95e0D5f402511dB06817Aff3f9eA88224B030`), - 10: common.HexToAddress(`0xB082d9f4734c535D9d80536F7E87a6f4F471bF65`), - 250: common.HexToAddress(`0x57AA88A0810dfe3f9b71a9b179Dd8bF5F956C46A`), - 8453: common.HexToAddress(`0xE0F3D78DB7bC111996864A32d22AB0F59Ca5Fa86`), - 42161: common.HexToAddress(`0x043518AB266485dC085a1DB095B8d9C2Fc78E9b9`), -} - -// MULTICALL_ADDRESSES contains the address of the multicall2 contract for a specific chainID -var MULTICALL_ADDRESSES = map[uint64]common.Address{ - 1: common.HexToAddress(`0x5ba1e12693dc8f9c48aad8770482f4739beed696`), - 10: common.HexToAddress(`0xca11bde05977b3631167028862be2a173976ca11`), - 56: common.HexToAddress(`0xca11bde05977b3631167028862be2a173976ca11`), - 137: common.HexToAddress(`0xca11bde05977b3631167028862be2a173976ca11`), - 250: common.HexToAddress(`0x470ADB45f5a9ac3550bcFFaD9D990Bf7e2e941c9`), - 8453: common.HexToAddress(`0xca11bde05977b3631167028862be2a173976ca11`), - 42161: common.HexToAddress(`0x842eC2c7D803033Edf55E478F461FC547Bc54EB2`), -} - -// CURVE_REGISTRY_ADDRESSES contains the address of the Curve Registry contract -var CURVE_REGISTRY_ADDRESSES = map[uint64]common.Address{ - 1: common.HexToAddress(`0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5`), - 10: common.HexToAddress(`0x0000000022d53366457f9d5e68ec105046fc4383`), - 250: common.HexToAddress(`0x0000000022d53366457f9d5e68ec105046fc4383`), - 8453: { - //TODO: ADD CURVE_REGISTRY_ADDRESSES FOR BASE - }, - 42161: common.HexToAddress(`0x0000000022d53366457f9d5e68ec105046fc4383`), -} - -// CURVE_FACTORIES_ADDRESSES contains the address of the Curve Registry contract -var CURVE_FACTORIES_ADDRESSES = map[uint64]common.Address{ - 1: common.HexToAddress(`0xF18056Bbd320E96A48e3Fbf8bC061322531aac99`), - 10: {}, - 250: {}, - 8453: {}, - 42161: {}, -} - -// STACKING_REWARD_ADDRESSES contains the address of the stacking reward contract -var STACKING_REWARD_ADDRESSES = map[uint64]TContractData{ - 1: {}, - 10: { - Address: common.HexToAddress(`0x8ed9f6343f057870f1def47aae7cd88dfaa049a8`), - Block: uint64(85969070), - }, - 250: {}, - 8453: { - //TODO: ADD STACKING_REWARD_ADDRESSES FOR BASE - }, - 42161: {}, -} - -// YBRIBE_V3_ADDRESSES contains the address of the yBribe contract -var YBRIBE_V3_ADDRESSES = map[uint64]TContractData{ - 1: { - Address: common.HexToAddress(`0x03dFdBcD4056E2F92251c7B07423E1a33a7D3F6d`), - Block: uint64(15878262), - }, - 10: {}, - 250: {}, - 8453: {}, - 42161: {}, -} - -// PARTNER_TRACKERS_ADDRESSES contains the address of the yBribe contract -var PARTNER_TRACKERS_ADDRESSES = map[uint64]TContractData{ - 1: { - Address: common.HexToAddress(`0x8ee392a4787397126C163Cb9844d7c447da419D8`), - Block: uint64(14166636), - }, - 10: { - Address: common.HexToAddress(`0x7E08735690028cdF3D81e7165493F1C34065AbA2`), - Block: uint64(29675215), - }, - 250: { - Address: common.HexToAddress(`0x086865B2983320b36C42E48086DaDc786c9Ac73B`), - Block: uint64(40499061), - }, - 8453: { - //TODO: ADD PARTNER_TRACKERS_ADDRESSES FOR BASE - }, - 42161: { - Address: common.HexToAddress(`0x0e5b46E4b2a05fd53F5a4cD974eb98a9a613bcb7`), - Block: uint64(30385403), - }, -} - -var KnownRefferers = map[uint64]map[common.Address]string{ - 1: { - common.HexToAddress(`0x558247e365be655f9144e1a0140D793984372Ef3`): `Ledger`, - common.HexToAddress(`0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52`): `Yearn.finance`, - }, - 10: {}, - 250: {}, - 8453: {}, - 42161: {}, -} diff --git a/common/env/environment.go b/common/env/environment.go index 983245328..3ecef9e47 100755 --- a/common/env/environment.go +++ b/common/env/environment.go @@ -15,42 +15,54 @@ func SetEnv(path string) { if !exists { logs.Debug("RPC_URI_FOR_1 not set, using default value: [https://eth.public-rpc.com]") } else { - RPC_ENDPOINTS[1] = RPCURIFor1 + chain := CHAINS[1] + chain.RpcURI = RPCURIFor1 + CHAINS[1] = chain } RPCURIFor10, exists := os.LookupEnv("RPC_URI_FOR_10") if !exists { logs.Debug("RPC_URI_FOR_10 not set, using default value: [https://mainnet.optimism.io]") } else { - RPC_ENDPOINTS[10] = RPCURIFor10 + chain := CHAINS[10] + chain.RpcURI = RPCURIFor10 + CHAINS[10] = chain + } + + RPCURIFor137, exists := os.LookupEnv("RPC_URI_FOR_137") + if !exists { + logs.Debug("RPC_URI_FOR_137 not set, using default value: [https://polygon.llamarpc.com]") + } else { + chain := CHAINS[137] + chain.RpcURI = RPCURIFor137 + CHAINS[137] = chain } RPCURIFor250, exists := os.LookupEnv("RPC_URI_FOR_250") if !exists { logs.Debug("RPC_URI_FOR_250 not set, using default value: [https://rpc.ftm.tools]") } else { - RPC_ENDPOINTS[250] = RPCURIFor250 + chain := CHAINS[250] + chain.RpcURI = RPCURIFor250 + CHAINS[250] = chain } RPCURIFor8453, exists := os.LookupEnv("RPC_URI_FOR_8453") if !exists { logs.Debug("RPC_URI_FOR_8453 not set, using default value: [https://developer-access-mainnet.base.org]") } else { - RPC_ENDPOINTS[8453] = RPCURIFor8453 + chain := CHAINS[8453] + chain.RpcURI = RPCURIFor8453 + CHAINS[8453] = chain } RPCURIFor42161, exists := os.LookupEnv("RPC_URI_FOR_42161") if !exists { logs.Debug("RPC_URI_FOR_42161 not set, using default value: [https://arbitrum.public-rpc.com]") } else { - RPC_ENDPOINTS[42161] = RPCURIFor42161 - } - - GraphAPIURI, exists := os.LookupEnv("GRAPH_API_URI") - if !exists { - logs.Debug("GRAPH_API_URI not set, using default value: [https://api.thegraph.com/subgraphs/name/rareweasel/yearn-vaults-v2-subgraph-mainnet]") - } else { - THEGRAPH_ENDPOINTS[1] = GraphAPIURI + chain := CHAINS[42161] + chain.RpcURI = RPCURIFor42161 + CHAINS[42161] = chain } ApiV1BaseUrl, exists := os.LookupEnv("API_V1_BASE_URL") diff --git a/common/ethereum/initializer.go b/common/ethereum/initializer.go index c191e4330..00fd23440 100755 --- a/common/ethereum/initializer.go +++ b/common/ethereum/initializer.go @@ -16,17 +16,20 @@ import ( ***************************************************************************************************/ func init() { // Create the RPC client for all the chains supported by yDaemon - for _, chainID := range env.SUPPORTED_CHAIN_IDS { - client, err := ethclient.Dial(GetRPCURI(chainID)) + for _, chain := range env.CHAINS { + client, err := ethclient.Dial(GetRPCURI(chain.ID)) if err != nil { logs.Error(err, "Failed to connect to node") continue } - RPC[chainID] = client + RPC[chain.ID] = client } // Create the multicall client for all the chains supported by yDaemon - for _, chainID := range env.SUPPORTED_CHAIN_IDS { - MulticallClientForChainID[chainID] = NewMulticall(GetRPCURI(chainID), env.MULTICALL_ADDRESSES[chainID]) + for _, chain := range env.CHAINS { + MulticallClientForChainID[chain.ID] = NewMulticall( + GetRPCURI(chain.ID), + chain.MulticallContract.Address, + ) } } diff --git a/common/ethereum/utils.go b/common/ethereum/utils.go index cf19d69e2..2c8060856 100755 --- a/common/ethereum/utils.go +++ b/common/ethereum/utils.go @@ -26,17 +26,16 @@ func GetRPC(chainID uint64) *ethclient.Client { // GetRPCURI returns the URI to use to connect to the node for a specific chainID func GetRPCURI(chainID uint64) string { - return env.RPC_ENDPOINTS[chainID] + return env.CHAINS[chainID].RpcURI } // GetWSEnvURI returns the URI to use to connect to the node for a specific chainID func GetWSEnvURI(chainID uint64) string { wsFromEnv, exists := os.LookupEnv("WS_URI_FOR_" + strconv.FormatUint(chainID, 10)) if !exists { - return env.RPC_ENDPOINTS[chainID] - } else { - return wsFromEnv + return env.CHAINS[chainID].RpcURI } + return wsFromEnv } // MulticallClientForChainID holds the multicall client for a specific chainID diff --git a/common/helpers/helpers.go b/common/helpers/helpers.go index ef8088609..629602e8d 100755 --- a/common/helpers/helpers.go +++ b/common/helpers/helpers.go @@ -137,7 +137,7 @@ func AssertChainID(chainIDStr string) (uint64, bool) { if chainID == 1337 { return 1, true } - if !Contains(env.SUPPORTED_CHAIN_IDS, chainID) { + if _, ok := env.CHAINS[chainID]; !ok { return 0, false } return chainID, true @@ -148,7 +148,7 @@ func AssertAddress(addressStr string, chainID uint64) (common.Address, bool) { return common.Address{}, false } address := common.HexToAddress(addressStr) - if chainID > 0 && Contains(env.BLACKLISTED_VAULTS[chainID], address) { + if chainID > 0 && Contains(env.CHAINS[chainID].BlacklistedVaults, address) { return common.Address{}, false } return address, true @@ -158,7 +158,7 @@ func AddressIsValid(address common.Address, chainID uint64) bool { if (address == common.Address{} || addresses.Equals(address, "0x0000000000000000000000000000000000000000")) { return false } - if chainID > 0 && Contains(env.BLACKLISTED_VAULTS[chainID], address) { + if chainID > 0 && Contains(env.CHAINS[chainID].BlacklistedVaults, address) { return false } return true @@ -236,6 +236,13 @@ func DecodeAddress(something []interface{}) common.Address { return something[0].(common.Address) } +func ToRawAmount(amount *bigNumber.Int, decimals uint64) *bigNumber.Int { + return bigNumber.NewInt(0).Mul( + amount, + bigNumber.NewInt(0).Exp(bigNumber.NewInt(10), bigNumber.NewInt(int64(decimals)), nil), + ) +} + func ToNormalizedAmount(amount *bigNumber.Int, decimals uint64) *bigNumber.Float { return bigNumber.NewFloat(0).Quo( bigNumber.NewFloat(0).SetInt(amount), diff --git a/common/store/db.badger.go b/common/store/db.badger.go index bb0c3d24d..535b890ed 100755 --- a/common/store/db.badger.go +++ b/common/store/db.badger.go @@ -33,7 +33,7 @@ func _assertMap() { badgerDBMutex = make(map[uint64]map[string]*sync.Mutex) } - for _, chainID := range env.SUPPORTED_CHAIN_IDS { + for chainID := range env.CHAINS { if badgerDB[chainID] == nil { badgerDB[chainID] = make(map[string]*badger.DB) } diff --git a/common/store/initializer.go b/common/store/initializer.go index e26c8b73c..6dd966f39 100644 --- a/common/store/initializer.go +++ b/common/store/initializer.go @@ -27,7 +27,7 @@ func init() { _dbType = DBBadger } - for _, chainID := range env.SUPPORTED_CHAIN_IDS { + for chainID := range env.CHAINS { _blockTimeSyncMap[chainID] = &sync.Map{} _timeBlockSyncMap[chainID] = &sync.Map{} _historicalPriceSyncMap[chainID] = &sync.Map{} @@ -41,7 +41,7 @@ func init() { } wg := &sync.WaitGroup{} - for _, chainID := range env.SUPPORTED_CHAIN_IDS { + for chainID := range env.CHAINS { wg.Add(5) go LoadBlockTime(chainID, nil) // go LoadHistoricalPrice(chainID, nil) diff --git a/common/store/models.go b/common/store/models.go index 829d51f16..5de53933b 100644 --- a/common/store/models.go +++ b/common/store/models.go @@ -52,7 +52,7 @@ type DBNewVaultsFromRegistry struct { ManagementFee uint64 // ManagementFee is the management fee of the vault TxIndex uint // TxIndex is the index of the transaction in the block LogIndex uint // LogIndex is the index of the log in the transaction - Type models.TVaultType // Type of vault, can be Experimental, Standard or Automated + Type models.TTokenType // Type of vault, can be Experimental, Standard or Automated } /************************************************************************************************** @@ -68,7 +68,7 @@ type DBVault struct { Guardian string // Guardian is the guardian address Rewards string // Rewards is the rewards address Token string // Token is the underlying token address - Type models.TVaultType // Type of vault, can be Experimental, Standard or Automated + Type models.TTokenType // Type of vault, can be Experimental, Standard or Automated Symbol string // Symbol of the vault DisplaySymbol string // DisplaySymbol is an overwrite symbol for display purpose FormatedSymbol string // FormatedSymbol is an overwrite symbol yv + symbol diff --git a/common/store/store.tokens.go b/common/store/store.tokens.go index 902659556..c454d9021 100644 --- a/common/store/store.tokens.go +++ b/common/store/store.tokens.go @@ -222,7 +222,31 @@ func ListERC20Addresses(chainID uint64) []common.Address { ** If the token type matches with "Yearn Vault", it returns true. Otherwise, it returns false. **********************************************************************************************/ func IsVaultLike(t models.TERC20Token) bool { - return t.Type == models.TokenTypeVault + return IsStandardVault(t) || IsExperimentalVault(t) || IsAutomatedVault(t) +} + +/** 🔵 - Yearn ************************************************************************************* +** This function checks if the provided token is of the "Standard Vault" type. +** It takes a TERC20Token as input and returns a boolean value. +**************************************************************************************************/ +func IsStandardVault(t models.TERC20Token) bool { + return t.Type == models.TokenTypeStandardVault || t.Type == models.TokenTypeLegagyStandardVault +} + +/** 🔵 - Yearn ************************************************************************************* +** This function checks if the provided token is of the "Experimental Vault" type. +** It takes a TERC20Token as input and returns a boolean value. +**************************************************************************************************/ +func IsExperimentalVault(t models.TERC20Token) bool { + return t.Type == models.TokenTypeExperimentalVault || t.Type == models.TokenTypeLegacyExperimentalVault +} + +/** 🔵 - Yearn ************************************************************************************* +** This function checks if the provided token is of the "Automated Vault" type. +** It takes a TERC20Token as input and returns a boolean value. +**************************************************************************************************/ +func IsAutomatedVault(t models.TERC20Token) bool { + return t.Type == models.TokenTypeAutomatedVault || t.Type == models.TokenTypeLegacyAutomatedVault } /** 🔵 - Yearn ************************************************************************************* diff --git a/common/store/store.vaultsFromRegistry.go b/common/store/store.vaultsFromRegistry.go index 8abb5468a..af0016467 100644 --- a/common/store/store.vaultsFromRegistry.go +++ b/common/store/store.vaultsFromRegistry.go @@ -171,3 +171,39 @@ func ListVaultsFromRegistry(chainID uint64) (asMap map[common.Address]models.TVa return asMap, asSlice } + +/************************************************************************************************** +** GetVaultFromRegistry +**************************************************************************************************/ +func GetVaultFromRegistry(chainID uint64, vaultAddress common.Address) (models.TVaultsFromRegistry, bool) { + /********************************************************************************************** + ** We first retrieve the syncMap. This syncMap should be initialized first via the `LoadNewVaultsFromRegistry` + ** function which take the data from the database/badger and store it in it. + **********************************************************************************************/ + syncMap := _newVaultsFromRegistrySyncMap[chainID] + if syncMap == nil { + syncMap = &sync.Map{} + _newVaultsFromRegistrySyncMap[chainID] = syncMap + } + + /********************************************************************************************** + ** Here we are trying to load the vault from the syncMap using the vaultAddress. The loaded + ** vault is then type asserted to models.TVaultsFromRegistry. If the vault is not found in the + ** syncMap, we return an empty models.TVaultsFromRegistry and false. + **********************************************************************************************/ + vault := models.TVaultsFromRegistry{} + found := false + syncMap.Range(func(key, value interface{}) bool { + element := value.(models.TVaultsFromRegistry) + if element.Address == vaultAddress { + found = true + vault = element + return false + } + return true + }) + if !found { + return models.TVaultsFromRegistry{}, false + } + return vault, true +} diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 26dc00c74..f0118dea8 100755 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -11,6 +11,7 @@ services: environment: - RPC_URI_FOR_1 - RPC_URI_FOR_10 + - RPC_URI_FOR_137 - RPC_URI_FOR_250 - RPC_URI_FOR_8453 - RPC_URI_FOR_42161 diff --git a/docker-compose.yml b/docker-compose.yml index 66e7481ba..f1ee9f60d 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: environment: - RPC_URI_FOR_1 - RPC_URI_FOR_10 + - RPC_URI_FOR_137 - RPC_URI_FOR_250 - RPC_URI_FOR_8453 - RPC_URI_FOR_42161 diff --git a/docs/.editorconfig b/docs/.editorconfig deleted file mode 100755 index 0e311ce1d..000000000 --- a/docs/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*] -indent_style = tab -indent_size = 4 \ No newline at end of file diff --git a/docs/.eslintrc.js b/docs/.eslintrc.js deleted file mode 100755 index a36dc4a0c..000000000 --- a/docs/.eslintrc.js +++ /dev/null @@ -1,133 +0,0 @@ -module.exports = { - 'env': { - 'node': true, - 'browser': true, - 'es2021': true - }, - 'extends': [ - 'eslint:recommended', - 'plugin:import/recommended', - 'plugin:react/recommended', - 'plugin:react-hooks/recommended', - 'plugin:tailwindcss/recommended', - 'plugin:@typescript-eslint/recommended', - 'next/core-web-vitals' - ], - 'parser': '@typescript-eslint/parser', - 'parserOptions': { - 'ecmaFeatures': { - 'jsx': true - }, - 'ecmaVersion': 2022, - 'sourceType': 'module', - 'tsconfigRootDir': __dirname, - 'project': ['./tsconfig.json'] - }, - 'plugins': [ - '@typescript-eslint', - 'react', - 'tailwindcss', - 'unused-imports' - ], - 'settings': { - 'react': { - 'version': 'detect' - }, - 'import/resolver': { - 'typescript': {} - } - }, - 'rules': { - 'indent': [2, 'tab'], - 'no-mixed-spaces-and-tabs': 2, - 'react/prop-types': 0, - 'no-async-promise-executor': 0, - 'import/no-unresolved': 0, //Issue with package exports - 'quotes': [2, 'single', {'avoidEscape': true}], - 'object-curly-spacing': [2, 'never'], - 'array-bracket-spacing': [2, 'never'], - 'semi': 'error', - 'import/no-named-as-default-member': 2, - 'tailwindcss/no-custom-classname': 0, - 'object-property-newline': ['error', {'allowMultiplePropertiesPerLine': true}], - 'array-bracket-newline': ['error', {'multiline': true}], - 'react/jsx-curly-brace-presence': ['error', {'props': 'always', 'children': 'always'}], - 'react/jsx-first-prop-new-line': ['error', 'multiline'], - 'react/jsx-max-props-per-line': ['error', {'maximum': {'single': 2, 'multi': 1}}], - 'react/jsx-closing-tag-location': 2, - 'unused-imports/no-unused-imports': 'error', - 'unused-imports/no-unused-vars': [ - 'warn', { - 'vars': 'all', - 'varsIgnorePattern': '^_', - 'args': 'after-used', - 'argsIgnorePattern': '^_' - } - ], - 'sort-imports': [ - 'error', { - 'ignoreDeclarationSort': true - } - ], - '@typescript-eslint/no-var-requires': 0, - '@typescript-eslint/no-unused-vars': 2, - '@typescript-eslint/array-type': ['error', {'default': 'array'}], - '@typescript-eslint/consistent-type-assertions': ['error', {'assertionStyle': 'as', 'objectLiteralTypeAssertions': 'never'}], - '@typescript-eslint/consistent-type-definitions': ['error', 'type'], - '@typescript-eslint/consistent-indexed-object-style': ['error', 'index-signature'], - '@typescript-eslint/explicit-function-return-type': [ - 'error', { - 'allowExpressions': false, - 'allowTypedFunctionExpressions': false, - 'allowHigherOrderFunctions': false, - 'allowDirectConstAssertionInArrowFunctions': false, - 'allowConciseArrowFunctionExpressionsStartingWithVoid': false, - 'allowedNames': [] - } - ], - '@typescript-eslint/naming-convention': [ - 'error', - {'selector': 'default', 'format': ['camelCase']}, - {'selector': 'function', 'format': ['camelCase', 'PascalCase']}, - - {'selector': 'variableLike', 'format': ['camelCase', 'PascalCase', 'UPPER_CASE'], 'leadingUnderscore': 'allow'}, - {'selector': 'variable', 'types': ['boolean'], 'format': ['PascalCase'], 'prefix': ['is', 'should', 'has', 'can', 'did', 'will']}, - {'selector': 'default', 'format': null, 'filter': {'regex': '^(0-9)$', 'match': false}}, - { - 'selector': 'variableLike', - 'filter': {'regex': '^(set)', 'match': true}, - 'format': ['camelCase'], - 'prefix': ['set_'] - }, - {'selector': 'variableLike', 'format': ['PascalCase'], 'filter': {'regex': '(Context)$|(ContextApp)$|^Component$', 'match': true}}, - {'selector': ['typeParameter', 'typeAlias'], 'format': ['PascalCase'], 'prefix': ['T']}, - {'selector': 'interface', 'format': ['PascalCase'], 'prefix': ['I']}, - {'selector': ['default', 'variableLike', 'parameter'], 'format': null, 'filter': {'regex': '^(__html|_css)$', 'match': true}} - ], - '@typescript-eslint/no-misused-promises': ['error', {'checksConditionals': true, 'checksVoidReturn': false}], - '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', - '@typescript-eslint/no-unnecessary-qualifier': 'error', - '@typescript-eslint/no-unnecessary-type-arguments': 'error', - '@typescript-eslint/no-unnecessary-boolean-literal-compare': [ - 'error', { - 'allowComparingNullableBooleansToTrue': false, - 'allowComparingNullableBooleansToFalse': false - } - ], - '@typescript-eslint/prefer-for-of': 'error', - '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-includes': 'error', - '@typescript-eslint/prefer-optional-chain': 'error', - '@typescript-eslint/promise-function-async': 'error', - '@typescript-eslint/require-array-sort-compare': 'error', - '@typescript-eslint/type-annotation-spacing': ['error', {'before': true, 'after': true, 'overrides': {'colon': {'before': false, 'after': true}}}], - 'brace-style': 'off', - '@typescript-eslint/brace-style': ['error', '1tbs'], - 'comma-dangle': 'off', - '@typescript-eslint/comma-dangle': ['error'], - 'comma-spacing': 'off', - '@typescript-eslint/comma-spacing': ['error'], - 'dot-notation': 'off', - '@typescript-eslint/dot-notation': ['error'] - } -}; diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100755 index 113f2f085..000000000 --- a/docs/.gitignore +++ /dev/null @@ -1,50 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -cmd/cmd -cmd/api - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -.idea -.DS_Store -/env*.list -coverage.html -assert.sh - -# Elastic Beanstalk Files -.elasticbeanstalk/* -!.elasticbeanstalk/*.cfg.yml -!.elasticbeanstalk/*.global.yml - -# delve binary -__debug_bin - -# Docker windows err -hs_err* -.vscode/ - -coverage.txt -docs/validated-postman.json -docs/validated-swagger.yaml.env - -.env -*/.env.env -*/node_modules -*/build - -vendor -ystore - -# build -yDaemon -.next -.swc -.turbo \ No newline at end of file diff --git a/docs/components/Dropdown.tsx b/docs/components/Dropdown.tsx deleted file mode 100755 index 0c7c154d6..000000000 --- a/docs/components/Dropdown.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React, {ReactElement, ReactNode} from 'react'; - -export default function Dropdown({title, children}: {title: string, children: ReactNode}): ReactElement { - return ( -
- {title} -
- {children} -
-
- ); -} diff --git a/docs/components/GET.tsx b/docs/components/GET.tsx deleted file mode 100755 index 94bd66501..000000000 --- a/docs/components/GET.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React, {ReactElement} from 'react'; - -export default function GET({path}: {path: string}): ReactElement { - return ( -
-
- {'GET'} -
- - {path} - -
- ); -} diff --git a/docs/components/Header.tsx b/docs/components/Header.tsx deleted file mode 100755 index 9bb1a7fc8..000000000 --- a/docs/components/Header.tsx +++ /dev/null @@ -1,62 +0,0 @@ -/* eslint-disable @next/next/no-img-element */ -import React, {ReactElement} from 'react'; - -export function Header(): ReactElement { - return ( -
-
-

{'yDaemon'}

- - - - - -
- -

- {'yDaemon'} -

- -
- - {''} - - - - {''} - - - - {''} - -
-
- ); -} diff --git a/docs/components/POST.tsx b/docs/components/POST.tsx deleted file mode 100755 index 4826ec3f3..000000000 --- a/docs/components/POST.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React, {ReactElement} from 'react'; - -export default function POST({path}: {path: string}): ReactElement { - return ( -
-
- {'POST'} -
- - {path} - -
- ); -} diff --git a/docs/components/QueryArgumentBox.tsx b/docs/components/QueryArgumentBox.tsx deleted file mode 100755 index f436f1541..000000000 --- a/docs/components/QueryArgumentBox.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React, {ReactElement} from 'react'; - -type TQueryArgumentBoxProps = { - title: string; - description: string; - children: ReactElement; -} -function QueryArgumentBox({title, description, children}: TQueryArgumentBoxProps): ReactElement { - return ( - - ); -} - -export default QueryArgumentBox; \ No newline at end of file diff --git a/docs/middleware.ts b/docs/middleware.ts deleted file mode 100755 index 4edd31ebb..000000000 --- a/docs/middleware.ts +++ /dev/null @@ -1,29 +0,0 @@ -// eslint-disable-next-line @next/next/no-server-import-in-page -import {NextRequest, NextResponse} from 'next/server'; - -export const config = { - matcher: [ - '/docs', - '/docs/install/:path*', - '/docs/hooks/:path*' - ] -}; - -export async function middleware(request: NextRequest): Promise { - if (request.nextUrl.pathname === ('/docs')) { - const url = request.nextUrl.clone(); - url.pathname = url.pathname.replace('docs', ''); - return NextResponse.redirect(url); - } - if (request.nextUrl.pathname.startsWith('/docs/install')) { - const url = request.nextUrl.clone(); - url.pathname = url.pathname.replace('install', '1-install'); - return NextResponse.redirect(url); - } - if (request.nextUrl.pathname.startsWith('/docs/hooks')) { - const url = request.nextUrl.clone(); - url.pathname = url.pathname.replace('hooks', '3-web3Hooks'); - return NextResponse.redirect(url); - } - return NextResponse.next(); -} diff --git a/docs/next-env.d.ts b/docs/next-env.d.ts deleted file mode 100755 index 4f11a03dc..000000000 --- a/docs/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/docs/next.config.js b/docs/next.config.js deleted file mode 100755 index 7605a2123..000000000 --- a/docs/next.config.js +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-disable @typescript-eslint/explicit-function-return-type */ -/* eslint-disable no-undef */ -const withNextra = require('nextra')({ - theme: 'nextra-theme-docs', - themeConfig: './theme.config.js', - unstable_contentDump: true, - unstable_flexsearch: true, - unstable_staticImage: true -}); - -/** @type {import('next').NextConfig} */ -const config = { - reactStrictMode: true, - typescript: { - // Disable type checking since eslint handles this - ignoreBuildErrors: true - } -}; - -if (process.env.NODE_ENV === 'development') { - const withPreconstruct = require('@preconstruct/next'); - module.exports = withPreconstruct(withNextra(config)); -} else { - const withBundleAnalyzer = require('@next/bundle-analyzer')({ - enabled: process.env.ANALYZE === 'true' - }); - module.exports = withBundleAnalyzer(withNextra(config)); -} diff --git a/docs/package.json b/docs/package.json deleted file mode 100755 index fcd2887c3..000000000 --- a/docs/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "@yearn-finance/ydaemon-doc", - "version": "0.0.1", - "private": true, - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "lint": "next lint" - }, - "dependencies": { - "@reach/skip-nav": "^0.18.0", - "@yearn-finance/web-lib": "^0.13.28", - "ethers": "^5.7.1", - "next": "^12.3.1", - "next-themes": "^0.2.1", - "next-pwa": "5.6.0", - "next-seo": "^5.6.0", - "nextra": "2.0.0-alpha.56", - "nextra-theme-docs": "2.0.0-alpha.59", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "tailwindcss": "^3.1.8" - }, - "devDependencies": { - "@next/bundle-analyzer": "^12.3.1", - "@next/eslint-plugin-next": "^12.3.1", - "@preconstruct/next": "^4.0.0", - "@types/node": "^18.11.0", - "@types/nprogress": "^0.2.0", - "@types/react": "^18.0.21", - "@types/react-dom": "^18.0.6", - "@typescript-eslint/eslint-plugin": "^5.40.1", - "@typescript-eslint/parser": "^5.40.1", - "autoprefixer": "^10.4.12", - "babel-loader": "^8.2.5", - "eslint": "^8.25.0", - "eslint-config-next": "^12.3.1", - "eslint-import-resolver-typescript": "^3.5.1", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-react": "^7.31.10", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-tailwindcss": "^3.6.2", - "eslint-plugin-unused-imports": "^2.0.0", - "postcss": "^8.4.18", - "postcss-import": "^15.0.0", - "postcss-nesting": "^10.2.0", - "sass": "^1.55.0", - "sharp": "^0.31.1", - "ts-loader": "^9.4.1", - "typescript": "^4.8.4" - } -} diff --git a/docs/pages/_app.tsx b/docs/pages/_app.tsx deleted file mode 100755 index 5331183cf..000000000 --- a/docs/pages/_app.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from 'react'; -import {useTheme} from 'next-themes'; -import {useClientEffect} from '@yearn-finance/web-lib'; -import type {AppProps} from 'next/app'; -import '../style.css'; - -function WrappedApp({Component, pageProps}: AppProps): React.ReactElement { - const {theme} = useTheme(); - - useClientEffect((): void => { - document.body.dataset.theme = theme; - }, [theme]); - - return ( - - ); -} - -function App(props: AppProps): React.ReactElement { - const getLayout = (props.Component as any).getLayout || ((page: React.ReactElement): React.ReactElement => page); // eslint-disable-line - - return (getLayout()); -} - -export default App; diff --git a/docs/pages/_document.tsx b/docs/pages/_document.tsx deleted file mode 100755 index de35ec5d5..000000000 --- a/docs/pages/_document.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React, {ReactElement} from 'react'; -import Document, {DocumentContext, DocumentInitialProps, Head, Html, Main, NextScript} from 'next/document'; -import {SkipNavLink} from '@reach/skip-nav'; - -const modeScript = ` - let darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)') - - updateMode() - darkModeMediaQuery.addEventListener('change', updateModeWithoutTransitions) - window.addEventListener('storage', updateModeWithoutTransitions) - - function updateMode() { - let isSystemDarkMode = darkModeMediaQuery.matches - let isDarkMode = true - - if (isDarkMode) { - document.documentElement.classList.add('dark') - } else { - document.documentElement.classList.remove('dark') - } - - if (isDarkMode === isSystemDarkMode) { - delete window.localStorage.isDarkMode - } - } - - function updateModeWithoutTransitions() { - updateMode() - } -`; - -class MyDocument extends Document { - static async getInitialProps(ctx: DocumentContext): Promise { - const initialProps = await Document.getInitialProps(ctx); - return {...initialProps}; - } - - render(): ReactElement { - return ( - - - - -