From aff086bf7b08cea438bd0da75b9ea5550dcd9432 Mon Sep 17 00:00:00 2001 From: MiniFrenchBread <103425574+MiniFrenchBread@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:23:01 +0800 Subject: [PATCH] feat: wrapped-a0gi-base skeleton --- app/app.go | 21 +- .../interfaces/contracts/IWrappedA0GIBase.sol | 10 +- .../wrapped-a0gi-base/IWrappedA0GIBase.json | 74 + precompiles/wrapped-a0gi-base/contract.go | 253 +++ precompiles/wrapped-a0gi-base/types.go | 8 + .../wrapped-a0gi-base/wrapped_a0gi_base.go | 65 + proto/zgc/dasigners/v1/dasigners.proto | 2 +- proto/zgc/wrappeda0gibase/genesis.proto | 15 + proto/zgc/wrappeda0gibase/query.proto | 27 + proto/zgc/wrappeda0gibase/tx.proto | 47 + x/wrapped-a0gi-base/cli/query.go | 23 + x/wrapped-a0gi-base/cli/tx.go | 22 + x/wrapped-a0gi-base/genesis.go | 22 + x/wrapped-a0gi-base/keeper/abci.go | 8 + x/wrapped-a0gi-base/keeper/grpc_query.go | 14 + x/wrapped-a0gi-base/keeper/keeper.go | 26 + x/wrapped-a0gi-base/keeper/msg_server.go | 38 + x/wrapped-a0gi-base/module.go | 168 ++ x/wrapped-a0gi-base/types/codec.go | 45 + x/wrapped-a0gi-base/types/errors.go | 7 + x/wrapped-a0gi-base/types/genesis.go | 18 + x/wrapped-a0gi-base/types/genesis.pb.go | 326 +++ x/wrapped-a0gi-base/types/keys.go | 12 + x/wrapped-a0gi-base/types/msg.go | 92 + x/wrapped-a0gi-base/types/query.pb.go | 616 ++++++ x/wrapped-a0gi-base/types/query.pb.gw.go | 171 ++ x/wrapped-a0gi-base/types/tx.pb.go | 1750 +++++++++++++++++ 27 files changed, 3872 insertions(+), 8 deletions(-) create mode 100644 precompiles/wrapped-a0gi-base/IWrappedA0GIBase.json create mode 100644 precompiles/wrapped-a0gi-base/contract.go create mode 100644 precompiles/wrapped-a0gi-base/types.go create mode 100644 precompiles/wrapped-a0gi-base/wrapped_a0gi_base.go create mode 100644 proto/zgc/wrappeda0gibase/genesis.proto create mode 100644 proto/zgc/wrappeda0gibase/query.proto create mode 100644 proto/zgc/wrappeda0gibase/tx.proto create mode 100644 x/wrapped-a0gi-base/cli/query.go create mode 100644 x/wrapped-a0gi-base/cli/tx.go create mode 100644 x/wrapped-a0gi-base/genesis.go create mode 100644 x/wrapped-a0gi-base/keeper/abci.go create mode 100644 x/wrapped-a0gi-base/keeper/grpc_query.go create mode 100644 x/wrapped-a0gi-base/keeper/keeper.go create mode 100644 x/wrapped-a0gi-base/keeper/msg_server.go create mode 100644 x/wrapped-a0gi-base/module.go create mode 100644 x/wrapped-a0gi-base/types/codec.go create mode 100644 x/wrapped-a0gi-base/types/errors.go create mode 100644 x/wrapped-a0gi-base/types/genesis.go create mode 100644 x/wrapped-a0gi-base/types/genesis.pb.go create mode 100644 x/wrapped-a0gi-base/types/keys.go create mode 100644 x/wrapped-a0gi-base/types/msg.go create mode 100644 x/wrapped-a0gi-base/types/query.pb.go create mode 100644 x/wrapped-a0gi-base/types/query.pb.gw.go create mode 100644 x/wrapped-a0gi-base/types/tx.pb.go diff --git a/app/app.go b/app/app.go index 0879f353..e558b416 100644 --- a/app/app.go +++ b/app/app.go @@ -111,6 +111,7 @@ import ( "github.com/0glabs/0g-chain/chaincfg" dasignersprecompile "github.com/0glabs/0g-chain/precompiles/dasigners" stakingprecompile "github.com/0glabs/0g-chain/precompiles/staking" + wrappeda0gibaseprecompile "github.com/0glabs/0g-chain/precompiles/wrapped-a0gi-base" "github.com/0glabs/0g-chain/x/bep3" bep3keeper "github.com/0glabs/0g-chain/x/bep3/keeper" @@ -140,6 +141,9 @@ import ( validatorvesting "github.com/0glabs/0g-chain/x/validator-vesting" validatorvestingrest "github.com/0glabs/0g-chain/x/validator-vesting/client/rest" validatorvestingtypes "github.com/0glabs/0g-chain/x/validator-vesting/types" + wrappeda0gibase "github.com/0glabs/0g-chain/x/wrapped-a0gi-base" + wrappeda0gibasekeeper "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/keeper" + wrappeda0gibasetypes "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types" "github.com/ethereum/go-ethereum/common" ) @@ -187,6 +191,7 @@ var ( dasigners.AppModuleBasic{}, consensus.AppModuleBasic{}, ibcwasm.AppModuleBasic{}, + wrappeda0gibase.AppModuleBasic{}, ) // module account permissions @@ -275,6 +280,7 @@ type App struct { dasignersKeeper dasignerskeeper.Keeper consensusParamsKeeper consensusparamkeeper.Keeper precisebankKeeper precisebankkeeper.Keeper + wrappeda0gibaseKeeper wrappeda0gibasekeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -327,6 +333,7 @@ func NewApp( vestingtypes.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, precisebanktypes.StoreKey, ibcwasmtypes.StoreKey, + wrappeda0gibasetypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -496,11 +503,10 @@ func NewApp( app.accountKeeper, ) - // dasigners keeper - app.dasignersKeeper = dasignerskeeper.NewKeeper(keys[dasignerstypes.StoreKey], appCodec, app.stakingKeeper, govAuthAddrStr) // precopmiles precompiles := make(map[common.Address]vm.PrecompiledContract) // dasigners + app.dasignersKeeper = dasignerskeeper.NewKeeper(keys[dasignerstypes.StoreKey], appCodec, app.stakingKeeper, govAuthAddrStr) daSignersPrecompile, err := dasignersprecompile.NewDASignersPrecompile(app.dasignersKeeper) if err != nil { panic(fmt.Sprintf("initialize dasigners precompile failed: %v", err)) @@ -512,6 +518,13 @@ func NewApp( panic(fmt.Sprintf("initialize staking precompile failed: %v", err)) } precompiles[stakingPrecompile.Address()] = stakingPrecompile + // wrapped wrapped a0gi base + app.wrappeda0gibaseKeeper = wrappeda0gibasekeeper.NewKeeper(keys[wrappeda0gibasetypes.StoreKey], appCodec, govAuthAddrStr) + wrappeda0gibasePrecompile, err := wrappeda0gibaseprecompile.NewWrappedA0giBasePrecompile(app.wrappeda0gibaseKeeper) + if err != nil { + panic(fmt.Sprintf("initialize wrapped a0gi base precompile failed: %v", err)) + } + precompiles[wrappeda0gibasePrecompile.Address()] = wrappeda0gibasePrecompile app.evmKeeper = evmkeeper.NewKeeper( appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], @@ -695,6 +708,7 @@ func NewApp( council.NewAppModule(app.CouncilKeeper), ibcwasm.NewAppModule(app.ibcWasmClientKeeper), dasigners.NewAppModule(app.dasignersKeeper, *app.stakingKeeper), + wrappeda0gibase.NewAppModule(app.wrappeda0gibaseKeeper), ) // Warning: Some begin blockers must run before others. Ensure the dependencies are understood before modifying this list. @@ -742,6 +756,7 @@ func NewApp( precisebanktypes.ModuleName, ibcwasmtypes.ModuleName, dasignerstypes.ModuleName, + wrappeda0gibasetypes.ModuleName, ) // Warning: Some end blockers must run before others. Ensure the dependencies are understood before modifying this list. @@ -779,6 +794,7 @@ func NewApp( precisebanktypes.ModuleName, ibcwasmtypes.ModuleName, dasignerstypes.ModuleName, + wrappeda0gibasetypes.ModuleName, ) // Warning: Some init genesis methods must run before others. Ensure the dependencies are understood before modifying this list @@ -815,6 +831,7 @@ func NewApp( crisistypes.ModuleName, // runs the invariants at genesis, should run after other modules ibcwasmtypes.ModuleName, dasignerstypes.ModuleName, + wrappeda0gibasetypes.ModuleName, ) app.mm.RegisterInvariants(&app.crisisKeeper) diff --git a/precompiles/interfaces/contracts/IWrappedA0GIBase.sol b/precompiles/interfaces/contracts/IWrappedA0GIBase.sol index e5a9aa7a..eaf5a246 100644 --- a/precompiles/interfaces/contracts/IWrappedA0GIBase.sol +++ b/precompiles/interfaces/contracts/IWrappedA0GIBase.sol @@ -1,15 +1,15 @@ // SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.8.0; +struct Supply { + uint256 cap; + uint256 total; +} + /** * @title WrappedA0GIBase is a precompile for wrapped a0gi(wA0GI), it enables wA0GI mint/burn native 0g token directly. */ interface IWrappedA0GIBase { - struct Supply { - uint256 cap; - uint256 total; - } - /** * @dev set the wA0GI address. * It is designed to be called by governance module only so it's not implemented at EVM precompile side. diff --git a/precompiles/wrapped-a0gi-base/IWrappedA0GIBase.json b/precompiles/wrapped-a0gi-base/IWrappedA0GIBase.json new file mode 100644 index 00000000..2d051720 --- /dev/null +++ b/precompiles/wrapped-a0gi-base/IWrappedA0GIBase.json @@ -0,0 +1,74 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "minterSupply", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "cap", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "total", + "type": "uint256" + } + ], + "internalType": "struct Supply", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/precompiles/wrapped-a0gi-base/contract.go b/precompiles/wrapped-a0gi-base/contract.go new file mode 100644 index 00000000..9eccaf96 --- /dev/null +++ b/precompiles/wrapped-a0gi-base/contract.go @@ -0,0 +1,253 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package wrappeda0gibase + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// Wrappeda0gibaseMetaData contains all meta data concerning the Wrappeda0gibase contract. +var Wrappeda0gibaseMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"minter\",\"type\":\"address\"}],\"name\":\"minterSupply\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"cap\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"total\",\"type\":\"uint256\"}],\"internalType\":\"structSupply\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// Wrappeda0gibaseABI is the input ABI used to generate the binding from. +// Deprecated: Use Wrappeda0gibaseMetaData.ABI instead. +var Wrappeda0gibaseABI = Wrappeda0gibaseMetaData.ABI + +// Wrappeda0gibase is an auto generated Go binding around an Ethereum contract. +type Wrappeda0gibase struct { + Wrappeda0gibaseCaller // Read-only binding to the contract + Wrappeda0gibaseTransactor // Write-only binding to the contract + Wrappeda0gibaseFilterer // Log filterer for contract events +} + +// Wrappeda0gibaseCaller is an auto generated read-only Go binding around an Ethereum contract. +type Wrappeda0gibaseCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Wrappeda0gibaseTransactor is an auto generated write-only Go binding around an Ethereum contract. +type Wrappeda0gibaseTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Wrappeda0gibaseFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type Wrappeda0gibaseFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// Wrappeda0gibaseSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type Wrappeda0gibaseSession struct { + Contract *Wrappeda0gibase // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Wrappeda0gibaseCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type Wrappeda0gibaseCallerSession struct { + Contract *Wrappeda0gibaseCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// Wrappeda0gibaseTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type Wrappeda0gibaseTransactorSession struct { + Contract *Wrappeda0gibaseTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// Wrappeda0gibaseRaw is an auto generated low-level Go binding around an Ethereum contract. +type Wrappeda0gibaseRaw struct { + Contract *Wrappeda0gibase // Generic contract binding to access the raw methods on +} + +// Wrappeda0gibaseCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type Wrappeda0gibaseCallerRaw struct { + Contract *Wrappeda0gibaseCaller // Generic read-only contract binding to access the raw methods on +} + +// Wrappeda0gibaseTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type Wrappeda0gibaseTransactorRaw struct { + Contract *Wrappeda0gibaseTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewWrappeda0gibase creates a new instance of Wrappeda0gibase, bound to a specific deployed contract. +func NewWrappeda0gibase(address common.Address, backend bind.ContractBackend) (*Wrappeda0gibase, error) { + contract, err := bindWrappeda0gibase(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Wrappeda0gibase{Wrappeda0gibaseCaller: Wrappeda0gibaseCaller{contract: contract}, Wrappeda0gibaseTransactor: Wrappeda0gibaseTransactor{contract: contract}, Wrappeda0gibaseFilterer: Wrappeda0gibaseFilterer{contract: contract}}, nil +} + +// NewWrappeda0gibaseCaller creates a new read-only instance of Wrappeda0gibase, bound to a specific deployed contract. +func NewWrappeda0gibaseCaller(address common.Address, caller bind.ContractCaller) (*Wrappeda0gibaseCaller, error) { + contract, err := bindWrappeda0gibase(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &Wrappeda0gibaseCaller{contract: contract}, nil +} + +// NewWrappeda0gibaseTransactor creates a new write-only instance of Wrappeda0gibase, bound to a specific deployed contract. +func NewWrappeda0gibaseTransactor(address common.Address, transactor bind.ContractTransactor) (*Wrappeda0gibaseTransactor, error) { + contract, err := bindWrappeda0gibase(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &Wrappeda0gibaseTransactor{contract: contract}, nil +} + +// NewWrappeda0gibaseFilterer creates a new log filterer instance of Wrappeda0gibase, bound to a specific deployed contract. +func NewWrappeda0gibaseFilterer(address common.Address, filterer bind.ContractFilterer) (*Wrappeda0gibaseFilterer, error) { + contract, err := bindWrappeda0gibase(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &Wrappeda0gibaseFilterer{contract: contract}, nil +} + +// bindWrappeda0gibase binds a generic wrapper to an already deployed contract. +func bindWrappeda0gibase(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(Wrappeda0gibaseABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Wrappeda0gibase *Wrappeda0gibaseRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Wrappeda0gibase.Contract.Wrappeda0gibaseCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Wrappeda0gibase *Wrappeda0gibaseRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Wrappeda0gibaseTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Wrappeda0gibase *Wrappeda0gibaseRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Wrappeda0gibaseTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_Wrappeda0gibase *Wrappeda0gibaseCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Wrappeda0gibase.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.contract.Transact(opts, method, params...) +} + +// MinterSupply is a free data retrieval call binding the contract method 0x95609212. +// +// Solidity: function minterSupply(address minter) view returns((uint256,uint256)) +func (_Wrappeda0gibase *Wrappeda0gibaseCaller) MinterSupply(opts *bind.CallOpts, minter common.Address) (Supply, error) { + var out []interface{} + err := _Wrappeda0gibase.contract.Call(opts, &out, "minterSupply", minter) + + if err != nil { + return *new(Supply), err + } + + out0 := *abi.ConvertType(out[0], new(Supply)).(*Supply) + + return out0, err + +} + +// MinterSupply is a free data retrieval call binding the contract method 0x95609212. +// +// Solidity: function minterSupply(address minter) view returns((uint256,uint256)) +func (_Wrappeda0gibase *Wrappeda0gibaseSession) MinterSupply(minter common.Address) (Supply, error) { + return _Wrappeda0gibase.Contract.MinterSupply(&_Wrappeda0gibase.CallOpts, minter) +} + +// MinterSupply is a free data retrieval call binding the contract method 0x95609212. +// +// Solidity: function minterSupply(address minter) view returns((uint256,uint256)) +func (_Wrappeda0gibase *Wrappeda0gibaseCallerSession) MinterSupply(minter common.Address) (Supply, error) { + return _Wrappeda0gibase.Contract.MinterSupply(&_Wrappeda0gibase.CallOpts, minter) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactor) Burn(opts *bind.TransactOpts, minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.contract.Transact(opts, "burn", minter, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseSession) Burn(minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Burn(&_Wrappeda0gibase.TransactOpts, minter, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address minter, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorSession) Burn(minter common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Burn(&_Wrappeda0gibase.TransactOpts, minter, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0xc6c3bbe6. +// +// Solidity: function mint(address minter, address to, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactor) Mint(opts *bind.TransactOpts, minter common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.contract.Transact(opts, "mint", minter, to, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0xc6c3bbe6. +// +// Solidity: function mint(address minter, address to, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseSession) Mint(minter common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Mint(&_Wrappeda0gibase.TransactOpts, minter, to, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0xc6c3bbe6. +// +// Solidity: function mint(address minter, address to, uint256 amount) returns() +func (_Wrappeda0gibase *Wrappeda0gibaseTransactorSession) Mint(minter common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _Wrappeda0gibase.Contract.Mint(&_Wrappeda0gibase.TransactOpts, minter, to, amount) +} diff --git a/precompiles/wrapped-a0gi-base/types.go b/precompiles/wrapped-a0gi-base/types.go new file mode 100644 index 00000000..95e427bd --- /dev/null +++ b/precompiles/wrapped-a0gi-base/types.go @@ -0,0 +1,8 @@ +package wrappeda0gibase + +import "math/big" + +type Supply = struct { + Cap *big.Int "json:\"cap\"" + Total *big.Int "json:\"total\"" +} diff --git a/precompiles/wrapped-a0gi-base/wrapped_a0gi_base.go b/precompiles/wrapped-a0gi-base/wrapped_a0gi_base.go new file mode 100644 index 00000000..088ecf40 --- /dev/null +++ b/precompiles/wrapped-a0gi-base/wrapped_a0gi_base.go @@ -0,0 +1,65 @@ +package wrappeda0gibase + +import ( + "strings" + + precompiles_common "github.com/0glabs/0g-chain/precompiles/common" + wrappeda0gibasekeeper "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/keeper" + "github.com/cosmos/cosmos-sdk/store/types" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/vm" +) + +const ( + PrecompileAddress = "0x0000000000000000000000000000000000001002" +) + +var _ vm.PrecompiledContract = &WrappedA0giBasePrecompile{} +var _ precompiles_common.PrecompileCommon = &WrappedA0giBasePrecompile{} + +type WrappedA0giBasePrecompile struct { + abi abi.ABI + wrappeda0gibaseKeeper wrappeda0gibasekeeper.Keeper +} + +// Abi implements common.PrecompileCommon. +func (w *WrappedA0giBasePrecompile) Abi() *abi.ABI { + panic("unimplemented") +} + +// IsTx implements common.PrecompileCommon. +func (w *WrappedA0giBasePrecompile) IsTx(string) bool { + panic("unimplemented") +} + +// KVGasConfig implements common.PrecompileCommon. +func (w *WrappedA0giBasePrecompile) KVGasConfig() types.GasConfig { + panic("unimplemented") +} + +// Address implements vm.PrecompiledContract. +func (w *WrappedA0giBasePrecompile) Address() common.Address { + return common.HexToAddress(PrecompileAddress) +} + +// RequiredGas implements vm.PrecompiledContract. +func (w *WrappedA0giBasePrecompile) RequiredGas(input []byte) uint64 { + panic("unimplemented") +} + +func NewWrappedA0giBasePrecompile(wrappeda0gibaseKeeper wrappeda0gibasekeeper.Keeper) (*WrappedA0giBasePrecompile, error) { + abi, err := abi.JSON(strings.NewReader(Wrappeda0gibaseABI)) + if err != nil { + return nil, err + } + return &WrappedA0giBasePrecompile{ + abi: abi, + wrappeda0gibaseKeeper: wrappeda0gibaseKeeper, + }, nil +} + +// Run implements vm.PrecompiledContract. +func (w *WrappedA0giBasePrecompile) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ([]byte, error) { + panic("unimplemented") +} diff --git a/proto/zgc/dasigners/v1/dasigners.proto b/proto/zgc/dasigners/v1/dasigners.proto index ee32ed3b..c390e5f3 100644 --- a/proto/zgc/dasigners/v1/dasigners.proto +++ b/proto/zgc/dasigners/v1/dasigners.proto @@ -25,5 +25,5 @@ message Quorum { } message Quorums { - repeated Quorum quorums = 1; + repeated Quorum quorums = 1; } diff --git a/proto/zgc/wrappeda0gibase/genesis.proto b/proto/zgc/wrappeda0gibase/genesis.proto new file mode 100644 index 00000000..66fd833a --- /dev/null +++ b/proto/zgc/wrappeda0gibase/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package zgc.wrappeda0gibase; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types"; + +// GenesisState defines the wrapped a0gi base module's genesis state. +message GenesisState { + // address of wrapped a0gi contract + string wrapped_a0gi_address = 1; +} diff --git a/proto/zgc/wrappeda0gibase/query.proto b/proto/zgc/wrappeda0gibase/query.proto new file mode 100644 index 00000000..97958902 --- /dev/null +++ b/proto/zgc/wrappeda0gibase/query.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package zgc.wrappeda0gibase; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types"; +option (gogoproto.goproto_getters_all) = false; + +// Query defines the gRPC querier service for the wrapped a0gi base module +service Query { + rpc MinterSupply(MinterSupplyRequest) returns (MinterSupplyResponse) { + option (google.api.http).get = "/0g/wrapped-a0gi-base/minter-supply"; + } +} + +message MinterSupplyRequest { + string address = 1; +} + +message MinterSupplyResponse { + string cap = 1; + string supply = 2; +} diff --git a/proto/zgc/wrappeda0gibase/tx.proto b/proto/zgc/wrappeda0gibase/tx.proto new file mode 100644 index 00000000..6f247d93 --- /dev/null +++ b/proto/zgc/wrappeda0gibase/tx.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; +package zgc.wrappeda0gibase; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types"; +option (gogoproto.goproto_getters_all) = false; + +// Msg defines the wrapped a0gi base Msg service +service Msg { + rpc SetWA0GI(MsgSetWA0GI) returns (MsgSetWA0GIResponse); + rpc SetMinterCap(MsgSetMintCap) returns (MsgSetMintCapResponse); + rpc Mint(MsgMint) returns (MsgMintResponse); + rpc Burn(MsgBurn) returns (MsgBurnResponse); +} + +message MsgSetWA0GI { + string authority = 1; + string address = 2; +} + +message MsgSetWA0GIResponse {} + +message MsgSetMintCap { + string authority = 1; + string minter = 2; + string cap = 3; +} + +message MsgSetMintCapResponse {} + +message MsgMint { + string minter = 1; + string to = 2; + string amount = 3; +} + +message MsgMintResponse {} + +message MsgBurn { + string minter = 1; + string amount = 2; +} + +message MsgBurnResponse {} diff --git a/x/wrapped-a0gi-base/cli/query.go b/x/wrapped-a0gi-base/cli/query.go new file mode 100644 index 00000000..52e4eaca --- /dev/null +++ b/x/wrapped-a0gi-base/cli/query.go @@ -0,0 +1,23 @@ +package cli + +import ( + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types" + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" +) + +// GetQueryCmd returns the cli query commands for the inflation module. +func GetQueryCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the dasigners module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand() + + return cmd +} diff --git a/x/wrapped-a0gi-base/cli/tx.go b/x/wrapped-a0gi-base/cli/tx.go new file mode 100644 index 00000000..1fd09826 --- /dev/null +++ b/x/wrapped-a0gi-base/cli/tx.go @@ -0,0 +1,22 @@ +package cli + +import ( + "fmt" + + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + cmd.AddCommand() + return cmd +} diff --git a/x/wrapped-a0gi-base/genesis.go b/x/wrapped-a0gi-base/genesis.go new file mode 100644 index 00000000..4029ed65 --- /dev/null +++ b/x/wrapped-a0gi-base/genesis.go @@ -0,0 +1,22 @@ +package wrappeda0gibase + +import ( + "fmt" + + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/keeper" + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// InitGenesis initializes the store state from a genesis state. +func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, gs types.GenesisState) { + if err := gs.Validate(); err != nil { + panic(fmt.Sprintf("failed to validate %s genesis state: %s", types.ModuleName, err)) + } + panic("unimplemented") +} + +// ExportGenesis returns a GenesisState for a given context and keeper. +func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { + panic("unimplemented") +} diff --git a/x/wrapped-a0gi-base/keeper/abci.go b/x/wrapped-a0gi-base/keeper/abci.go new file mode 100644 index 00000000..4abc1524 --- /dev/null +++ b/x/wrapped-a0gi-base/keeper/abci.go @@ -0,0 +1,8 @@ +package keeper + +import ( + abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (k Keeper) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {} diff --git a/x/wrapped-a0gi-base/keeper/grpc_query.go b/x/wrapped-a0gi-base/keeper/grpc_query.go new file mode 100644 index 00000000..cd144ac2 --- /dev/null +++ b/x/wrapped-a0gi-base/keeper/grpc_query.go @@ -0,0 +1,14 @@ +package keeper + +import ( + "context" + + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types" +) + +var _ types.QueryServer = Keeper{} + +// MinterSupply implements types.QueryServer. +func (k Keeper) MinterSupply(c context.Context, request *types.MinterSupplyRequest) (*types.MinterSupplyResponse, error) { + panic("unimplemented") +} diff --git a/x/wrapped-a0gi-base/keeper/keeper.go b/x/wrapped-a0gi-base/keeper/keeper.go new file mode 100644 index 00000000..b20e7e0b --- /dev/null +++ b/x/wrapped-a0gi-base/keeper/keeper.go @@ -0,0 +1,26 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/codec" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" +) + +type Keeper struct { + storeKey storetypes.StoreKey + cdc codec.BinaryCodec + authority string // the address capable of changing signers params. Should be the gov module account +} + +// NewKeeper creates a new wrapped a0gi base keeper instance +func NewKeeper( + storeKey storetypes.StoreKey, + cdc codec.BinaryCodec, + authority string, +) Keeper { + return Keeper{ + storeKey: storeKey, + cdc: cdc, + authority: authority, + } +} diff --git a/x/wrapped-a0gi-base/keeper/msg_server.go b/x/wrapped-a0gi-base/keeper/msg_server.go new file mode 100644 index 00000000..e01fa164 --- /dev/null +++ b/x/wrapped-a0gi-base/keeper/msg_server.go @@ -0,0 +1,38 @@ +package keeper + +import ( + "context" + + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types" +) + +/* + errorsmod "cosmossdk.io/errors" + "github.com/0glabs/0g-chain/crypto/bn254util" + sdk "github.com/cosmos/cosmos-sdk/types" + gov "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/ethereum/go-ethereum/common" + etherminttypes "github.com/evmos/ethermint/types" +*/ + +var _ types.MsgServer = &Keeper{} + +// Burn implements types.MsgServer. +func (k Keeper) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error) { + panic("unimplemented") +} + +// Mint implements types.MsgServer. +func (k Keeper) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMintResponse, error) { + panic("unimplemented") +} + +// SetMinterCap implements types.MsgServer. +func (k Keeper) SetMinterCap(goCtx context.Context, msg *types.MsgSetMintCap) (*types.MsgSetMintCapResponse, error) { + panic("unimplemented") +} + +// SetWA0GI implements types.MsgServer. +func (k Keeper) SetWA0GI(goCtx context.Context, msg *types.MsgSetWA0GI) (*types.MsgSetWA0GIResponse, error) { + panic("unimplemented") +} diff --git a/x/wrapped-a0gi-base/module.go b/x/wrapped-a0gi-base/module.go new file mode 100644 index 00000000..2055f509 --- /dev/null +++ b/x/wrapped-a0gi-base/module.go @@ -0,0 +1,168 @@ +package wrappeda0gibase + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/cli" + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/keeper" + "github.com/0glabs/0g-chain/x/wrapped-a0gi-base/types" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" +) + +// consensusVersion defines the current x/council module consensus version. +const consensusVersion = 1 + +// type check to ensure the interface is properly implemented +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// app module Basics object +type AppModuleBasic struct{} + +// Name returns the inflation module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterLegacyAminoCodec registers the inflation module's types on the given LegacyAmino codec. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} + +// ConsensusVersion returns the consensus state-breaking version for the module. +func (AppModuleBasic) ConsensusVersion() uint64 { + return consensusVersion +} + +// RegisterInterfaces registers interfaces and implementations of the incentives +// module. +func (AppModuleBasic) RegisterInterfaces(interfaceRegistry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(interfaceRegistry) +} + +// DefaultGenesis returns default genesis state as raw bytes for the incentives +// module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the inflation module. +func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { + var genesisState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genesisState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return genesisState.Validate() +} + +// RegisterRESTRoutes performs a no-op as the inflation module doesn't expose REST +// endpoints +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the inflation module. +func (b AppModuleBasic) RegisterGRPCGatewayRoutes(c client.Context, serveMux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), serveMux, types.NewQueryClient(c)); err != nil { + panic(err) + } +} + +// GetTxCmd returns the root tx command for the inflation module. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns no root query command for the inflation module. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +// ___________________________________________________________________________ + +// AppModule implements an application module for the inflation module. +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper +} + +// NewAppModule creates a new AppModule Object +func NewAppModule( + k keeper.Keeper, +) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{}, + keeper: k, + } +} + +// Name returns the inflation module's name. +func (AppModule) Name() string { + return types.ModuleName +} + +// QuerierRoute returns wrapped a0gi base module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// RegisterInvariants registers the inflation module invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// RegisterServices registers a gRPC query service to respond to the +// module-specific gRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), am.keeper) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { + am.keeper.BeginBlock(ctx, req) +} + +func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { + // am.keeper.EndBlock(ctx, req) + return []abci.ValidatorUpdate{} +} + +// InitGenesis performs genesis initialization for the inflation module. It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + + cdc.MustUnmarshalJSON(data, &genesisState) + InitGenesis(ctx, am.keeper, genesisState) + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the inflation +// module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(gs) +} + +// ___________________________________________________________________________ + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the inflation module. +func (am AppModule) GenerateGenesisState(_ *module.SimulationState) { +} + +// RegisterStoreDecoder registers a decoder for inflation module's types. +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { +} + +// WeightedOperations doesn't return any inflation module operation. +func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { + return []simtypes.WeightedOperation{} +} diff --git a/x/wrapped-a0gi-base/types/codec.go b/x/wrapped-a0gi-base/types/codec.go new file mode 100644 index 00000000..7af6a480 --- /dev/null +++ b/x/wrapped-a0gi-base/types/codec.go @@ -0,0 +1,45 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +var ( + amino = codec.NewLegacyAmino() + // ModuleCdc references the global evm module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding. + ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) + + // AminoCdc is a amino codec created to support amino JSON compatible msgs. + AminoCdc = codec.NewAminoCodec(amino) +) + +const ( +// Amino names +) + +// NOTE: This is required for the GetSignBytes function +func init() { + RegisterLegacyAminoCodec(amino) + amino.Seal() +} + +// RegisterInterfaces register implementations +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgSetWA0GI{}, + &MsgSetMintCap{}, + &MsgMint{}, + &MsgBurn{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +// RegisterLegacyAminoCodec required for EIP-712 +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { +} diff --git a/x/wrapped-a0gi-base/types/errors.go b/x/wrapped-a0gi-base/types/errors.go new file mode 100644 index 00000000..f77409c1 --- /dev/null +++ b/x/wrapped-a0gi-base/types/errors.go @@ -0,0 +1,7 @@ +package types + +import errorsmod "cosmossdk.io/errors" + +var ( + ErrTxForbidden = errorsmod.Register(ModuleName, 1, "cosmos tx forbidden") +) diff --git a/x/wrapped-a0gi-base/types/genesis.go b/x/wrapped-a0gi-base/types/genesis.go new file mode 100644 index 00000000..75265bac --- /dev/null +++ b/x/wrapped-a0gi-base/types/genesis.go @@ -0,0 +1,18 @@ +package types + +// NewGenesisState returns a new genesis state object for the module. +func NewGenesisState(addr string) *GenesisState { + return &GenesisState{ + WrappedA0GiAddress: addr, + } +} + +// DefaultGenesisState returns the default genesis state for the module. +func DefaultGenesisState() *GenesisState { + return NewGenesisState("0000000000000000000000000000000000000000") +} + +// Validate performs basic validation of genesis data. +func (gs GenesisState) Validate() error { + return ValidateHexAddress(gs.WrappedA0GiAddress) +} diff --git a/x/wrapped-a0gi-base/types/genesis.pb.go b/x/wrapped-a0gi-base/types/genesis.pb.go new file mode 100644 index 00000000..dd6a07da --- /dev/null +++ b/x/wrapped-a0gi-base/types/genesis.pb.go @@ -0,0 +1,326 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: zgc/wrappeda0gibase/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the wrapped a0gi base module's genesis state. +type GenesisState struct { + // address of wrapped a0gi contract + WrappedA0GiAddress string `protobuf:"bytes,1,opt,name=wrapped_a0gi_address,json=wrappedA0giAddress,proto3" json:"wrapped_a0gi_address,omitempty"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_7e056019f61fd820, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetWrappedA0GiAddress() string { + if m != nil { + return m.WrappedA0GiAddress + } + return "" +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "zgc.wrappeda0gibase.GenesisState") +} + +func init() { proto.RegisterFile("zgc/wrappeda0gibase/genesis.proto", fileDescriptor_7e056019f61fd820) } + +var fileDescriptor_7e056019f61fd820 = []byte{ + // 246 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xbd, 0x4e, 0xc3, 0x30, + 0x10, 0x80, 0xe3, 0x05, 0x89, 0x88, 0x29, 0x74, 0xa0, 0x1d, 0xcc, 0xcf, 0xc4, 0x92, 0xd8, 0x12, + 0x3c, 0x00, 0x65, 0x61, 0x63, 0x80, 0x8d, 0x25, 0xb2, 0x1d, 0x73, 0xb5, 0xd4, 0xe4, 0xac, 0x9c, + 0x2b, 0x68, 0x9f, 0x82, 0xc7, 0x62, 0xec, 0xc8, 0x88, 0x92, 0x17, 0x41, 0x89, 0xc3, 0x92, 0xcd, + 0x77, 0xdf, 0x27, 0xf9, 0xd3, 0xa5, 0xd7, 0x07, 0x30, 0xe2, 0xa3, 0x55, 0xde, 0xdb, 0x4a, 0x49, + 0x70, 0x5a, 0x91, 0x15, 0x60, 0x1b, 0x4b, 0x8e, 0x0a, 0xdf, 0x62, 0xc0, 0xec, 0xfc, 0x00, 0xa6, + 0x98, 0x29, 0xab, 0xa5, 0x41, 0xaa, 0x91, 0xca, 0x51, 0x11, 0x71, 0x88, 0xfe, 0x6a, 0x01, 0x08, + 0x18, 0xf7, 0xc3, 0x6b, 0xda, 0x2e, 0x01, 0x11, 0xb6, 0x56, 0x8c, 0x93, 0xde, 0xbd, 0x0b, 0xd5, + 0xec, 0x27, 0x74, 0x39, 0x47, 0xc1, 0xd5, 0x96, 0x82, 0xaa, 0x7d, 0x14, 0x6e, 0x1e, 0xd2, 0xb3, + 0xa7, 0x98, 0xf4, 0x1a, 0x54, 0xb0, 0x99, 0x4c, 0x17, 0x53, 0x4f, 0x39, 0x04, 0x95, 0xaa, 0xaa, + 0x5a, 0x4b, 0x74, 0xc1, 0xae, 0xd8, 0xed, 0xe9, 0x4b, 0x36, 0xb1, 0xb5, 0x04, 0xb7, 0x8e, 0xe4, + 0xf1, 0xf9, 0xbb, 0xe3, 0xec, 0xd8, 0x71, 0xf6, 0xdb, 0x71, 0xf6, 0xd5, 0xf3, 0xe4, 0xd8, 0xf3, + 0xe4, 0xa7, 0xe7, 0xc9, 0xdb, 0x3d, 0xb8, 0xb0, 0xd9, 0xe9, 0xc2, 0x60, 0x2d, 0x24, 0x6c, 0x95, + 0x26, 0x21, 0x21, 0x37, 0x1b, 0xe5, 0x1a, 0xf1, 0xf9, 0x7f, 0x99, 0x7c, 0xf8, 0x26, 0x1f, 0x6f, + 0x13, 0xf6, 0xde, 0x92, 0x3e, 0x19, 0xc3, 0xee, 0xfe, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe8, 0xe8, + 0x6b, 0x2a, 0x3f, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WrappedA0GiAddress) > 0 { + i -= len(m.WrappedA0GiAddress) + copy(dAtA[i:], m.WrappedA0GiAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.WrappedA0GiAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.WrappedA0GiAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WrappedA0GiAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WrappedA0GiAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/wrapped-a0gi-base/types/keys.go b/x/wrapped-a0gi-base/types/keys.go new file mode 100644 index 00000000..29578c19 --- /dev/null +++ b/x/wrapped-a0gi-base/types/keys.go @@ -0,0 +1,12 @@ +package types + +const ( + // ModuleName The name that will be used throughout the module + ModuleName = "wrapped-a0gi-base" + + // StoreKey Top level store key where all module items will be stored + StoreKey = ModuleName + + // QuerierRoute Top level query string + QuerierRoute = ModuleName +) diff --git a/x/wrapped-a0gi-base/types/msg.go b/x/wrapped-a0gi-base/types/msg.go new file mode 100644 index 00000000..cc634912 --- /dev/null +++ b/x/wrapped-a0gi-base/types/msg.go @@ -0,0 +1,92 @@ +package types + +import ( + "encoding/hex" + fmt "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _, _, _, _ sdk.Msg = &MsgSetWA0GI{}, &MsgSetMintCap{}, &MsgMint{}, &MsgBurn{} + +func ValidateHexAddress(account string) error { + addr, err := hex.DecodeString(account) + if err != nil { + return err + } + if len(addr) != 20 { + return fmt.Errorf("invalid address length") + } + return nil +} + +func (msg *MsgSetWA0GI) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +func (msg *MsgSetWA0GI) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority") + } + + if err := ValidateHexAddress(msg.Address); err != nil { + return errorsmod.Wrap(err, "address") + } + + return nil +} + +func (msg MsgSetWA0GI) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +func (msg *MsgSetMintCap) GetSigners() []sdk.AccAddress { + addr, _ := sdk.AccAddressFromBech32(msg.Authority) + return []sdk.AccAddress{addr} +} + +func (msg *MsgSetMintCap) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Authority); err != nil { + return errorsmod.Wrap(err, "authority") + } + + if err := ValidateHexAddress(msg.Minter); err != nil { + return errorsmod.Wrap(err, "minter") + } + + return nil +} + +func (msg MsgSetMintCap) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +func (msg *MsgMint) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{} +} + +func (msg *MsgMint) ValidateBasic() error { + // forbid mint from cosmos tx + // it can only be called by wrapped a0gi from EVM + return ErrTxForbidden +} + +func (msg MsgMint) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} + +func (msg *MsgBurn) GetSigners() []sdk.AccAddress { + return []sdk.AccAddress{} +} + +func (msg *MsgBurn) ValidateBasic() error { + // forbid burn from cosmos tx + // it can only be called by wrapped a0gi from EVM + return ErrTxForbidden +} + +func (msg MsgBurn) GetSignBytes() []byte { + return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) +} diff --git a/x/wrapped-a0gi-base/types/query.pb.go b/x/wrapped-a0gi-base/types/query.pb.go new file mode 100644 index 00000000..bcba92eb --- /dev/null +++ b/x/wrapped-a0gi-base/types/query.pb.go @@ -0,0 +1,616 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: zgc/wrappeda0gibase/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MinterSupplyRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MinterSupplyRequest) Reset() { *m = MinterSupplyRequest{} } +func (m *MinterSupplyRequest) String() string { return proto.CompactTextString(m) } +func (*MinterSupplyRequest) ProtoMessage() {} +func (*MinterSupplyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_19911faa2ec12c75, []int{0} +} +func (m *MinterSupplyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MinterSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MinterSupplyRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MinterSupplyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MinterSupplyRequest.Merge(m, src) +} +func (m *MinterSupplyRequest) XXX_Size() int { + return m.Size() +} +func (m *MinterSupplyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MinterSupplyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MinterSupplyRequest proto.InternalMessageInfo + +type MinterSupplyResponse struct { + Cap string `protobuf:"bytes,1,opt,name=cap,proto3" json:"cap,omitempty"` + Supply string `protobuf:"bytes,2,opt,name=supply,proto3" json:"supply,omitempty"` +} + +func (m *MinterSupplyResponse) Reset() { *m = MinterSupplyResponse{} } +func (m *MinterSupplyResponse) String() string { return proto.CompactTextString(m) } +func (*MinterSupplyResponse) ProtoMessage() {} +func (*MinterSupplyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_19911faa2ec12c75, []int{1} +} +func (m *MinterSupplyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MinterSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MinterSupplyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MinterSupplyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MinterSupplyResponse.Merge(m, src) +} +func (m *MinterSupplyResponse) XXX_Size() int { + return m.Size() +} +func (m *MinterSupplyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MinterSupplyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MinterSupplyResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MinterSupplyRequest)(nil), "zgc.wrappeda0gibase.MinterSupplyRequest") + proto.RegisterType((*MinterSupplyResponse)(nil), "zgc.wrappeda0gibase.MinterSupplyResponse") +} + +func init() { proto.RegisterFile("zgc/wrappeda0gibase/query.proto", fileDescriptor_19911faa2ec12c75) } + +var fileDescriptor_19911faa2ec12c75 = []byte{ + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0xc1, 0x4a, 0x2b, 0x31, + 0x14, 0x86, 0x27, 0xbd, 0xdc, 0x5e, 0x6e, 0x70, 0x21, 0x69, 0x91, 0x76, 0x90, 0x54, 0x2a, 0x42, + 0x45, 0x66, 0x32, 0xa8, 0x0f, 0x20, 0xee, 0x5d, 0x58, 0x77, 0x6e, 0x24, 0x33, 0x8d, 0x69, 0xa0, + 0x93, 0xa4, 0x93, 0x0c, 0xda, 0x2e, 0x7d, 0x82, 0x82, 0x3b, 0x9f, 0xa8, 0xcb, 0x82, 0x1b, 0x97, + 0xda, 0xfa, 0x20, 0x32, 0x99, 0x29, 0x68, 0xe9, 0xc2, 0x5d, 0xfe, 0x73, 0xbe, 0xff, 0xe4, 0xf0, + 0x1f, 0xd8, 0x99, 0xf2, 0x84, 0x3c, 0x64, 0x54, 0x6b, 0x36, 0xa0, 0x11, 0x17, 0x31, 0x35, 0x8c, + 0x8c, 0x73, 0x96, 0x4d, 0x42, 0x9d, 0x29, 0xab, 0x50, 0x63, 0xca, 0x93, 0x70, 0x03, 0xf0, 0xdb, + 0x89, 0x32, 0xa9, 0x32, 0x77, 0x0e, 0x21, 0xa5, 0x28, 0x79, 0xbf, 0xc9, 0x15, 0x57, 0x65, 0xbd, + 0x78, 0x55, 0xd5, 0x7d, 0xae, 0x14, 0x1f, 0x31, 0x42, 0xb5, 0x20, 0x54, 0x4a, 0x65, 0xa9, 0x15, + 0x4a, 0xae, 0x3d, 0xed, 0xaa, 0xeb, 0x54, 0x9c, 0xdf, 0x13, 0x2a, 0xab, 0xef, 0xfd, 0xce, 0x66, + 0xcb, 0x8a, 0x94, 0x19, 0x4b, 0x53, 0x5d, 0x02, 0x5d, 0x02, 0x1b, 0x57, 0x42, 0x5a, 0x96, 0xdd, + 0xe4, 0x5a, 0x8f, 0x26, 0x7d, 0x36, 0xce, 0x99, 0xb1, 0xa8, 0x05, 0xff, 0xd1, 0xc1, 0x20, 0x63, + 0xc6, 0xb4, 0xc0, 0x01, 0xe8, 0xfd, 0xef, 0xaf, 0x65, 0xf7, 0x02, 0x36, 0x7f, 0x1a, 0x8c, 0x56, + 0xd2, 0x30, 0xb4, 0x0b, 0xff, 0x24, 0x54, 0x57, 0x74, 0xf1, 0x44, 0x7b, 0xb0, 0x6e, 0x1c, 0xd3, + 0xaa, 0xb9, 0x62, 0xa5, 0x4e, 0x5f, 0x00, 0xfc, 0x7b, 0x5d, 0x44, 0x84, 0x66, 0x00, 0xee, 0x7c, + 0x1f, 0x86, 0x7a, 0xe1, 0x96, 0xb8, 0xc2, 0x2d, 0x0b, 0xfa, 0xc7, 0xbf, 0x20, 0xcb, 0xcd, 0xba, + 0x27, 0x4f, 0xaf, 0x9f, 0xcf, 0xb5, 0x23, 0x74, 0x48, 0x22, 0xbe, 0xbe, 0x55, 0x50, 0x58, 0x02, + 0x77, 0xad, 0xd4, 0x79, 0x82, 0x72, 0xb9, 0xcb, 0xfe, 0xfc, 0x03, 0x7b, 0xf3, 0x25, 0x06, 0x8b, + 0x25, 0x06, 0xef, 0x4b, 0x0c, 0x66, 0x2b, 0xec, 0x2d, 0x56, 0xd8, 0x7b, 0x5b, 0x61, 0xef, 0xf6, + 0x9c, 0x0b, 0x3b, 0xcc, 0xe3, 0x30, 0x51, 0x29, 0x89, 0xf8, 0x88, 0xc6, 0x86, 0x44, 0x3c, 0x48, + 0x86, 0x54, 0x48, 0xf2, 0xb8, 0x65, 0xb6, 0x9d, 0x68, 0x66, 0xe2, 0xba, 0x8b, 0xfa, 0xec, 0x2b, + 0x00, 0x00, 0xff, 0xff, 0x26, 0x34, 0x94, 0xac, 0x2d, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + MinterSupply(ctx context.Context, in *MinterSupplyRequest, opts ...grpc.CallOption) (*MinterSupplyResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) MinterSupply(ctx context.Context, in *MinterSupplyRequest, opts ...grpc.CallOption) (*MinterSupplyResponse, error) { + out := new(MinterSupplyResponse) + err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Query/MinterSupply", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + MinterSupply(context.Context, *MinterSupplyRequest) (*MinterSupplyResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) MinterSupply(ctx context.Context, req *MinterSupplyRequest) (*MinterSupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method MinterSupply not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_MinterSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MinterSupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).MinterSupply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zgc.wrappeda0gibase.Query/MinterSupply", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).MinterSupply(ctx, req.(*MinterSupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "zgc.wrappeda0gibase.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "MinterSupply", + Handler: _Query_MinterSupply_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "zgc/wrappeda0gibase/query.proto", +} + +func (m *MinterSupplyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MinterSupplyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MinterSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MinterSupplyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MinterSupplyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MinterSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Supply) > 0 { + i -= len(m.Supply) + copy(dAtA[i:], m.Supply) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Supply))) + i-- + dAtA[i] = 0x12 + } + if len(m.Cap) > 0 { + i -= len(m.Cap) + copy(dAtA[i:], m.Cap) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Cap))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MinterSupplyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *MinterSupplyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cap) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Supply) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MinterSupplyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MinterSupplyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MinterSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MinterSupplyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MinterSupplyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MinterSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cap = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Supply = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/wrapped-a0gi-base/types/query.pb.gw.go b/x/wrapped-a0gi-base/types/query.pb.gw.go new file mode 100644 index 00000000..a4bbda75 --- /dev/null +++ b/x/wrapped-a0gi-base/types/query.pb.gw.go @@ -0,0 +1,171 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: zgc/wrappeda0gibase/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +var ( + filter_Query_MinterSupply_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_MinterSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MinterSupplyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MinterSupply_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.MinterSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_MinterSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq MinterSupplyRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_MinterSupply_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.MinterSupply(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_MinterSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_MinterSupply_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_MinterSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_MinterSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_MinterSupply_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_MinterSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_MinterSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"0g", "wrapped-a0gi-base", "minter-supply"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_MinterSupply_0 = runtime.ForwardResponseMessage +) diff --git a/x/wrapped-a0gi-base/types/tx.pb.go b/x/wrapped-a0gi-base/types/tx.pb.go new file mode 100644 index 00000000..78de5739 --- /dev/null +++ b/x/wrapped-a0gi-base/types/tx.pb.go @@ -0,0 +1,1750 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: zgc/wrappeda0gibase/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgSetWA0GI struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgSetWA0GI) Reset() { *m = MsgSetWA0GI{} } +func (m *MsgSetWA0GI) String() string { return proto.CompactTextString(m) } +func (*MsgSetWA0GI) ProtoMessage() {} +func (*MsgSetWA0GI) Descriptor() ([]byte, []int) { + return fileDescriptor_f80bf93a1fc022d3, []int{0} +} +func (m *MsgSetWA0GI) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetWA0GI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetWA0GI.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetWA0GI) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetWA0GI.Merge(m, src) +} +func (m *MsgSetWA0GI) XXX_Size() int { + return m.Size() +} +func (m *MsgSetWA0GI) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetWA0GI.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetWA0GI proto.InternalMessageInfo + +type MsgSetWA0GIResponse struct { +} + +func (m *MsgSetWA0GIResponse) Reset() { *m = MsgSetWA0GIResponse{} } +func (m *MsgSetWA0GIResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetWA0GIResponse) ProtoMessage() {} +func (*MsgSetWA0GIResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f80bf93a1fc022d3, []int{1} +} +func (m *MsgSetWA0GIResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetWA0GIResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetWA0GIResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetWA0GIResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetWA0GIResponse.Merge(m, src) +} +func (m *MsgSetWA0GIResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetWA0GIResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetWA0GIResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetWA0GIResponse proto.InternalMessageInfo + +type MsgSetMintCap struct { + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + Minter string `protobuf:"bytes,2,opt,name=minter,proto3" json:"minter,omitempty"` + Cap string `protobuf:"bytes,3,opt,name=cap,proto3" json:"cap,omitempty"` +} + +func (m *MsgSetMintCap) Reset() { *m = MsgSetMintCap{} } +func (m *MsgSetMintCap) String() string { return proto.CompactTextString(m) } +func (*MsgSetMintCap) ProtoMessage() {} +func (*MsgSetMintCap) Descriptor() ([]byte, []int) { + return fileDescriptor_f80bf93a1fc022d3, []int{2} +} +func (m *MsgSetMintCap) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetMintCap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetMintCap.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetMintCap) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetMintCap.Merge(m, src) +} +func (m *MsgSetMintCap) XXX_Size() int { + return m.Size() +} +func (m *MsgSetMintCap) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetMintCap.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetMintCap proto.InternalMessageInfo + +type MsgSetMintCapResponse struct { +} + +func (m *MsgSetMintCapResponse) Reset() { *m = MsgSetMintCapResponse{} } +func (m *MsgSetMintCapResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetMintCapResponse) ProtoMessage() {} +func (*MsgSetMintCapResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f80bf93a1fc022d3, []int{3} +} +func (m *MsgSetMintCapResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetMintCapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetMintCapResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetMintCapResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetMintCapResponse.Merge(m, src) +} +func (m *MsgSetMintCapResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetMintCapResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetMintCapResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetMintCapResponse proto.InternalMessageInfo + +type MsgMint struct { + Minter string `protobuf:"bytes,1,opt,name=minter,proto3" json:"minter,omitempty"` + To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + Amount string `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgMint) Reset() { *m = MsgMint{} } +func (m *MsgMint) String() string { return proto.CompactTextString(m) } +func (*MsgMint) ProtoMessage() {} +func (*MsgMint) Descriptor() ([]byte, []int) { + return fileDescriptor_f80bf93a1fc022d3, []int{4} +} +func (m *MsgMint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMint.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgMint) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMint.Merge(m, src) +} +func (m *MsgMint) XXX_Size() int { + return m.Size() +} +func (m *MsgMint) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMint.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMint proto.InternalMessageInfo + +type MsgMintResponse struct { +} + +func (m *MsgMintResponse) Reset() { *m = MsgMintResponse{} } +func (m *MsgMintResponse) String() string { return proto.CompactTextString(m) } +func (*MsgMintResponse) ProtoMessage() {} +func (*MsgMintResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f80bf93a1fc022d3, []int{5} +} +func (m *MsgMintResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgMintResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgMintResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgMintResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgMintResponse.Merge(m, src) +} +func (m *MsgMintResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgMintResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgMintResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgMintResponse proto.InternalMessageInfo + +type MsgBurn struct { + Minter string `protobuf:"bytes,1,opt,name=minter,proto3" json:"minter,omitempty"` + Amount string `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount,omitempty"` +} + +func (m *MsgBurn) Reset() { *m = MsgBurn{} } +func (m *MsgBurn) String() string { return proto.CompactTextString(m) } +func (*MsgBurn) ProtoMessage() {} +func (*MsgBurn) Descriptor() ([]byte, []int) { + return fileDescriptor_f80bf93a1fc022d3, []int{6} +} +func (m *MsgBurn) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurn.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBurn) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurn.Merge(m, src) +} +func (m *MsgBurn) XXX_Size() int { + return m.Size() +} +func (m *MsgBurn) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurn.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurn proto.InternalMessageInfo + +type MsgBurnResponse struct { +} + +func (m *MsgBurnResponse) Reset() { *m = MsgBurnResponse{} } +func (m *MsgBurnResponse) String() string { return proto.CompactTextString(m) } +func (*MsgBurnResponse) ProtoMessage() {} +func (*MsgBurnResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f80bf93a1fc022d3, []int{7} +} +func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgBurnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgBurnResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgBurnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgBurnResponse.Merge(m, src) +} +func (m *MsgBurnResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgBurnResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgBurnResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgBurnResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgSetWA0GI)(nil), "zgc.wrappeda0gibase.MsgSetWA0GI") + proto.RegisterType((*MsgSetWA0GIResponse)(nil), "zgc.wrappeda0gibase.MsgSetWA0GIResponse") + proto.RegisterType((*MsgSetMintCap)(nil), "zgc.wrappeda0gibase.MsgSetMintCap") + proto.RegisterType((*MsgSetMintCapResponse)(nil), "zgc.wrappeda0gibase.MsgSetMintCapResponse") + proto.RegisterType((*MsgMint)(nil), "zgc.wrappeda0gibase.MsgMint") + proto.RegisterType((*MsgMintResponse)(nil), "zgc.wrappeda0gibase.MsgMintResponse") + proto.RegisterType((*MsgBurn)(nil), "zgc.wrappeda0gibase.MsgBurn") + proto.RegisterType((*MsgBurnResponse)(nil), "zgc.wrappeda0gibase.MsgBurnResponse") +} + +func init() { proto.RegisterFile("zgc/wrappeda0gibase/tx.proto", fileDescriptor_f80bf93a1fc022d3) } + +var fileDescriptor_f80bf93a1fc022d3 = []byte{ + // 433 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xcf, 0x6b, 0xd4, 0x40, + 0x14, 0xc7, 0x93, 0xac, 0xb4, 0xf6, 0xf9, 0x3b, 0xb5, 0x9a, 0x86, 0x25, 0x94, 0xe0, 0xa1, 0x08, + 0x9b, 0x09, 0xea, 0xc5, 0xa3, 0x15, 0x91, 0x0a, 0xb9, 0xac, 0x60, 0xc1, 0x83, 0x32, 0xc9, 0x8e, + 0xb3, 0x81, 0x26, 0x13, 0x32, 0x13, 0xec, 0xf6, 0xaf, 0xf0, 0xcf, 0xea, 0x71, 0x2f, 0x82, 0x47, + 0xdd, 0xfd, 0x47, 0x64, 0x26, 0x93, 0x6c, 0xb6, 0x6c, 0x76, 0x6f, 0xf3, 0xbe, 0xdf, 0xf7, 0x3e, + 0x0f, 0xbe, 0xc3, 0x83, 0xe1, 0x35, 0x4d, 0xd0, 0xcf, 0x12, 0x17, 0x05, 0x99, 0xe0, 0x90, 0xa6, + 0x31, 0xe6, 0x04, 0x89, 0xab, 0xa0, 0x28, 0x99, 0x60, 0xf6, 0xe1, 0x35, 0x4d, 0x82, 0x5b, 0xae, + 0x7b, 0x9c, 0x30, 0x9e, 0x31, 0xfe, 0x5d, 0xb5, 0xa0, 0xba, 0xa8, 0xfb, 0xdd, 0xa7, 0x94, 0x51, + 0x56, 0xeb, 0xf2, 0xa5, 0xd5, 0x63, 0xca, 0x18, 0xbd, 0x24, 0x48, 0x55, 0x71, 0xf5, 0x03, 0xe1, + 0x7c, 0x56, 0x5b, 0xfe, 0x07, 0xb8, 0x17, 0x71, 0xfa, 0x99, 0x88, 0x8b, 0x77, 0xe1, 0xc7, 0x73, + 0x7b, 0x08, 0x07, 0xb8, 0x12, 0x53, 0x56, 0xa6, 0x62, 0xe6, 0x98, 0x27, 0xe6, 0xe9, 0xc1, 0x78, + 0x25, 0xd8, 0x0e, 0xec, 0xe3, 0xc9, 0xa4, 0x24, 0x9c, 0x3b, 0x96, 0xf2, 0x9a, 0xd2, 0x3f, 0x82, + 0xc3, 0x0e, 0x66, 0x4c, 0x78, 0xc1, 0x72, 0x4e, 0xfc, 0x0b, 0x78, 0x50, 0xcb, 0x51, 0x9a, 0x8b, + 0xf7, 0xb8, 0xd8, 0xc1, 0x7f, 0x06, 0x7b, 0x59, 0x9a, 0x0b, 0x52, 0x6a, 0xbc, 0xae, 0xec, 0xc7, + 0x30, 0x48, 0x70, 0xe1, 0x0c, 0x94, 0x28, 0x9f, 0xfe, 0x73, 0x38, 0x5a, 0x03, 0xb7, 0x1b, 0xcf, + 0x61, 0x3f, 0xe2, 0x54, 0xaa, 0x1d, 0x9a, 0xb9, 0x46, 0x7b, 0x08, 0x96, 0x60, 0x7a, 0x83, 0x25, + 0x98, 0xec, 0xc3, 0x19, 0xab, 0x72, 0xa1, 0x17, 0xe8, 0xca, 0x7f, 0x02, 0x8f, 0x34, 0xaa, 0xa5, + 0xbf, 0x55, 0xf4, 0xb3, 0xaa, 0xcc, 0x7b, 0xe9, 0x2b, 0x9a, 0xb5, 0x81, 0x26, 0x47, 0x1b, 0xda, + 0xab, 0xdf, 0x16, 0x0c, 0x22, 0x4e, 0xed, 0x2f, 0x70, 0xb7, 0xfd, 0x80, 0x93, 0x60, 0xc3, 0x8f, + 0x07, 0x9d, 0x6c, 0xdd, 0xd3, 0x5d, 0x1d, 0x0d, 0xdf, 0xfe, 0x06, 0xf7, 0x75, 0x42, 0xa4, 0x94, + 0xe1, 0xfb, 0x5b, 0x26, 0x75, 0x8e, 0xee, 0xcb, 0xdd, 0x3d, 0x2d, 0xff, 0x13, 0xdc, 0x51, 0x41, + 0x0f, 0xfb, 0x66, 0xa4, 0xeb, 0xbe, 0xd8, 0xe6, 0x76, 0x59, 0x2a, 0xd6, 0x5e, 0x96, 0x74, 0xfb, + 0x59, 0xdd, 0x5c, 0xcf, 0xc6, 0x37, 0xff, 0x3c, 0xe3, 0x66, 0xe1, 0x99, 0xf3, 0x85, 0x67, 0xfe, + 0x5d, 0x78, 0xe6, 0xaf, 0xa5, 0x67, 0xcc, 0x97, 0x9e, 0xf1, 0x67, 0xe9, 0x19, 0x5f, 0xdf, 0xd0, + 0x54, 0x4c, 0xab, 0x38, 0x48, 0x58, 0x86, 0x42, 0x7a, 0x89, 0x63, 0x8e, 0x42, 0x3a, 0x4a, 0xa6, + 0x38, 0xcd, 0xd1, 0x55, 0x73, 0x89, 0x23, 0x09, 0x1f, 0xd5, 0xb7, 0x38, 0x2b, 0x08, 0x8f, 0xf7, + 0xd4, 0xb9, 0xbc, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xd8, 0x1c, 0xf0, 0xaf, 0x03, 0x00, + 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + SetWA0GI(ctx context.Context, in *MsgSetWA0GI, opts ...grpc.CallOption) (*MsgSetWA0GIResponse, error) + SetMinterCap(ctx context.Context, in *MsgSetMintCap, opts ...grpc.CallOption) (*MsgSetMintCapResponse, error) + Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) + Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SetWA0GI(ctx context.Context, in *MsgSetWA0GI, opts ...grpc.CallOption) (*MsgSetWA0GIResponse, error) { + out := new(MsgSetWA0GIResponse) + err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Msg/SetWA0GI", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetMinterCap(ctx context.Context, in *MsgSetMintCap, opts ...grpc.CallOption) (*MsgSetMintCapResponse, error) { + out := new(MsgSetMintCapResponse) + err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Msg/SetMinterCap", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) { + out := new(MsgMintResponse) + err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Msg/Mint", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) { + out := new(MsgBurnResponse) + err := c.cc.Invoke(ctx, "/zgc.wrappeda0gibase.Msg/Burn", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + SetWA0GI(context.Context, *MsgSetWA0GI) (*MsgSetWA0GIResponse, error) + SetMinterCap(context.Context, *MsgSetMintCap) (*MsgSetMintCapResponse, error) + Mint(context.Context, *MsgMint) (*MsgMintResponse, error) + Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SetWA0GI(ctx context.Context, req *MsgSetWA0GI) (*MsgSetWA0GIResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetWA0GI not implemented") +} +func (*UnimplementedMsgServer) SetMinterCap(ctx context.Context, req *MsgSetMintCap) (*MsgSetMintCapResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetMinterCap not implemented") +} +func (*UnimplementedMsgServer) Mint(ctx context.Context, req *MsgMint) (*MsgMintResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Mint not implemented") +} +func (*UnimplementedMsgServer) Burn(ctx context.Context, req *MsgBurn) (*MsgBurnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Burn not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SetWA0GI_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetWA0GI) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetWA0GI(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zgc.wrappeda0gibase.Msg/SetWA0GI", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetWA0GI(ctx, req.(*MsgSetWA0GI)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetMinterCap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetMintCap) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetMinterCap(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zgc.wrappeda0gibase.Msg/SetMinterCap", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetMinterCap(ctx, req.(*MsgSetMintCap)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Mint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgMint) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Mint(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zgc.wrappeda0gibase.Msg/Mint", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Mint(ctx, req.(*MsgMint)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgBurn) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Burn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zgc.wrappeda0gibase.Msg/Burn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Burn(ctx, req.(*MsgBurn)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "zgc.wrappeda0gibase.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetWA0GI", + Handler: _Msg_SetWA0GI_Handler, + }, + { + MethodName: "SetMinterCap", + Handler: _Msg_SetMinterCap_Handler, + }, + { + MethodName: "Mint", + Handler: _Msg_Mint_Handler, + }, + { + MethodName: "Burn", + Handler: _Msg_Burn_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "zgc/wrappeda0gibase/tx.proto", +} + +func (m *MsgSetWA0GI) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetWA0GI) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetWA0GI) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetWA0GIResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetWA0GIResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetWA0GIResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSetMintCap) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetMintCap) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetMintCap) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cap) > 0 { + i -= len(m.Cap) + copy(dAtA[i:], m.Cap) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cap))) + i-- + dAtA[i] = 0x1a + } + if len(m.Minter) > 0 { + i -= len(m.Minter) + copy(dAtA[i:], m.Minter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Minter))) + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetMintCapResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetMintCapResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetMintCapResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgMint) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgMint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintTx(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x1a + } + if len(m.To) > 0 { + i -= len(m.To) + copy(dAtA[i:], m.To) + i = encodeVarintTx(dAtA, i, uint64(len(m.To))) + i-- + dAtA[i] = 0x12 + } + if len(m.Minter) > 0 { + i -= len(m.Minter) + copy(dAtA[i:], m.Minter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Minter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgMintResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgMintResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgMintResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgBurn) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurn) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurn) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Amount) > 0 { + i -= len(m.Amount) + copy(dAtA[i:], m.Amount) + i = encodeVarintTx(dAtA, i, uint64(len(m.Amount))) + i-- + dAtA[i] = 0x12 + } + if len(m.Minter) > 0 { + i -= len(m.Minter) + copy(dAtA[i:], m.Minter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Minter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgBurnResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgBurnResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgBurnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSetWA0GI) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetWA0GIResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetMintCap) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Minter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Cap) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetMintCapResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgMint) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Minter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.To) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgMintResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgBurn) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Minter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Amount) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgBurnResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSetWA0GI) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetWA0GI: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetWA0GI: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetWA0GIResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetWA0GIResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetWA0GIResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetMintCap) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetMintCap: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetMintCap: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Minter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cap", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cap = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetMintCapResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetMintCapResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetMintCapResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgMint) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgMint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMint: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Minter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgMintResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgMintResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgMintResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBurn) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBurn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurn: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Minter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Minter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Amount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgBurnResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgBurnResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgBurnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +)