github.com/klaytn/klaytn@v1.12.1/contracts/reward/contract/KlaytnReward.go (about) 1 // Code generated - DO NOT EDIT. 2 // This file is a generated binding and any manual changes will be lost. 3 4 package contract 5 6 import ( 7 "errors" 8 "math/big" 9 "strings" 10 11 "github.com/klaytn/klaytn" 12 "github.com/klaytn/klaytn/accounts/abi" 13 "github.com/klaytn/klaytn/accounts/abi/bind" 14 "github.com/klaytn/klaytn/blockchain/types" 15 "github.com/klaytn/klaytn/common" 16 "github.com/klaytn/klaytn/event" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var ( 21 _ = errors.New 22 _ = big.NewInt 23 _ = strings.NewReader 24 _ = klaytn.NotFound 25 _ = bind.Bind 26 _ = common.Big1 27 _ = types.BloomLookup 28 _ = event.NewSubscription 29 _ = abi.ConvertType 30 ) 31 32 // KlaytnRewardMetaData contains all meta data concerning the KlaytnReward contract. 33 var KlaytnRewardMetaData = &bind.MetaData{ 34 ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"totalAmount\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"reward\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"safeWithdrawal\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"}]", 35 Sigs: map[string]string{ 36 "70a08231": "balanceOf(address)", 37 "6353586b": "reward(address)", 38 "fd6b7ef8": "safeWithdrawal()", 39 "1a39d8ef": "totalAmount()", 40 }, 41 Bin: "0x608060405234801561001057600080fd5b506101de806100206000396000f3006080604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631a39d8ef81146100805780636353586b146100a757806370a08231146100ca578063fd6b7ef8146100f8575b3360009081526001602052604081208054349081019091558154019055005b34801561008c57600080fd5b5061009561010d565b60408051918252519081900360200190f35b6100c873ffffffffffffffffffffffffffffffffffffffff60043516610113565b005b3480156100d657600080fd5b5061009573ffffffffffffffffffffffffffffffffffffffff60043516610147565b34801561010457600080fd5b506100c8610159565b60005481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604081208054349081019091558154019055565b60016020526000908152604090205481565b336000908152600160205260408120805490829055908111156101af57604051339082156108fc029083906000818181858888f193505050501561019c576101af565b3360009081526001602052604090208190555b505600a165627a7a72305820587c8f20321a5567dea480a720b073b09facf4c38a4ee685bc23ecebc1bcde810029", 42 } 43 44 // KlaytnRewardABI is the input ABI used to generate the binding from. 45 // Deprecated: Use KlaytnRewardMetaData.ABI instead. 46 var KlaytnRewardABI = KlaytnRewardMetaData.ABI 47 48 // KlaytnRewardBinRuntime is the compiled bytecode used for adding genesis block without deploying code. 49 const KlaytnRewardBinRuntime = `6080604052600436106100615763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631a39d8ef81146100805780636353586b146100a757806370a08231146100ca578063fd6b7ef8146100f8575b3360009081526001602052604081208054349081019091558154019055005b34801561008c57600080fd5b5061009561010d565b60408051918252519081900360200190f35b6100c873ffffffffffffffffffffffffffffffffffffffff60043516610113565b005b3480156100d657600080fd5b5061009573ffffffffffffffffffffffffffffffffffffffff60043516610147565b34801561010457600080fd5b506100c8610159565b60005481565b73ffffffffffffffffffffffffffffffffffffffff1660009081526001602052604081208054349081019091558154019055565b60016020526000908152604090205481565b336000908152600160205260408120805490829055908111156101af57604051339082156108fc029083906000818181858888f193505050501561019c576101af565b3360009081526001602052604090208190555b505600a165627a7a72305820587c8f20321a5567dea480a720b073b09facf4c38a4ee685bc23ecebc1bcde810029` 50 51 // KlaytnRewardFuncSigs maps the 4-byte function signature to its string representation. 52 // Deprecated: Use KlaytnRewardMetaData.Sigs instead. 53 var KlaytnRewardFuncSigs = KlaytnRewardMetaData.Sigs 54 55 // KlaytnRewardBin is the compiled bytecode used for deploying new contracts. 56 // Deprecated: Use KlaytnRewardMetaData.Bin instead. 57 var KlaytnRewardBin = KlaytnRewardMetaData.Bin 58 59 // DeployKlaytnReward deploys a new Klaytn contract, binding an instance of KlaytnReward to it. 60 func DeployKlaytnReward(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *KlaytnReward, error) { 61 parsed, err := KlaytnRewardMetaData.GetAbi() 62 if err != nil { 63 return common.Address{}, nil, nil, err 64 } 65 if parsed == nil { 66 return common.Address{}, nil, nil, errors.New("GetABI returned nil") 67 } 68 69 address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(KlaytnRewardBin), backend) 70 if err != nil { 71 return common.Address{}, nil, nil, err 72 } 73 return address, tx, &KlaytnReward{KlaytnRewardCaller: KlaytnRewardCaller{contract: contract}, KlaytnRewardTransactor: KlaytnRewardTransactor{contract: contract}, KlaytnRewardFilterer: KlaytnRewardFilterer{contract: contract}}, nil 74 } 75 76 // KlaytnReward is an auto generated Go binding around a Klaytn contract. 77 type KlaytnReward struct { 78 KlaytnRewardCaller // Read-only binding to the contract 79 KlaytnRewardTransactor // Write-only binding to the contract 80 KlaytnRewardFilterer // Log filterer for contract events 81 } 82 83 // KlaytnRewardCaller is an auto generated read-only Go binding around a Klaytn contract. 84 type KlaytnRewardCaller struct { 85 contract *bind.BoundContract // Generic contract wrapper for the low level calls 86 } 87 88 // KlaytnRewardTransactor is an auto generated write-only Go binding around a Klaytn contract. 89 type KlaytnRewardTransactor struct { 90 contract *bind.BoundContract // Generic contract wrapper for the low level calls 91 } 92 93 // KlaytnRewardFilterer is an auto generated log filtering Go binding around a Klaytn contract events. 94 type KlaytnRewardFilterer struct { 95 contract *bind.BoundContract // Generic contract wrapper for the low level calls 96 } 97 98 // KlaytnRewardSession is an auto generated Go binding around a Klaytn contract, 99 // with pre-set call and transact options. 100 type KlaytnRewardSession struct { 101 Contract *KlaytnReward // Generic contract binding to set the session for 102 CallOpts bind.CallOpts // Call options to use throughout this session 103 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 104 } 105 106 // KlaytnRewardCallerSession is an auto generated read-only Go binding around a Klaytn contract, 107 // with pre-set call options. 108 type KlaytnRewardCallerSession struct { 109 Contract *KlaytnRewardCaller // Generic contract caller binding to set the session for 110 CallOpts bind.CallOpts // Call options to use throughout this session 111 } 112 113 // KlaytnRewardTransactorSession is an auto generated write-only Go binding around a Klaytn contract, 114 // with pre-set transact options. 115 type KlaytnRewardTransactorSession struct { 116 Contract *KlaytnRewardTransactor // Generic contract transactor binding to set the session for 117 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 118 } 119 120 // KlaytnRewardRaw is an auto generated low-level Go binding around a Klaytn contract. 121 type KlaytnRewardRaw struct { 122 Contract *KlaytnReward // Generic contract binding to access the raw methods on 123 } 124 125 // KlaytnRewardCallerRaw is an auto generated low-level read-only Go binding around a Klaytn contract. 126 type KlaytnRewardCallerRaw struct { 127 Contract *KlaytnRewardCaller // Generic read-only contract binding to access the raw methods on 128 } 129 130 // KlaytnRewardTransactorRaw is an auto generated low-level write-only Go binding around a Klaytn contract. 131 type KlaytnRewardTransactorRaw struct { 132 Contract *KlaytnRewardTransactor // Generic write-only contract binding to access the raw methods on 133 } 134 135 // NewKlaytnReward creates a new instance of KlaytnReward, bound to a specific deployed contract. 136 func NewKlaytnReward(address common.Address, backend bind.ContractBackend) (*KlaytnReward, error) { 137 contract, err := bindKlaytnReward(address, backend, backend, backend) 138 if err != nil { 139 return nil, err 140 } 141 return &KlaytnReward{KlaytnRewardCaller: KlaytnRewardCaller{contract: contract}, KlaytnRewardTransactor: KlaytnRewardTransactor{contract: contract}, KlaytnRewardFilterer: KlaytnRewardFilterer{contract: contract}}, nil 142 } 143 144 // NewKlaytnRewardCaller creates a new read-only instance of KlaytnReward, bound to a specific deployed contract. 145 func NewKlaytnRewardCaller(address common.Address, caller bind.ContractCaller) (*KlaytnRewardCaller, error) { 146 contract, err := bindKlaytnReward(address, caller, nil, nil) 147 if err != nil { 148 return nil, err 149 } 150 return &KlaytnRewardCaller{contract: contract}, nil 151 } 152 153 // NewKlaytnRewardTransactor creates a new write-only instance of KlaytnReward, bound to a specific deployed contract. 154 func NewKlaytnRewardTransactor(address common.Address, transactor bind.ContractTransactor) (*KlaytnRewardTransactor, error) { 155 contract, err := bindKlaytnReward(address, nil, transactor, nil) 156 if err != nil { 157 return nil, err 158 } 159 return &KlaytnRewardTransactor{contract: contract}, nil 160 } 161 162 // NewKlaytnRewardFilterer creates a new log filterer instance of KlaytnReward, bound to a specific deployed contract. 163 func NewKlaytnRewardFilterer(address common.Address, filterer bind.ContractFilterer) (*KlaytnRewardFilterer, error) { 164 contract, err := bindKlaytnReward(address, nil, nil, filterer) 165 if err != nil { 166 return nil, err 167 } 168 return &KlaytnRewardFilterer{contract: contract}, nil 169 } 170 171 // bindKlaytnReward binds a generic wrapper to an already deployed contract. 172 func bindKlaytnReward(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { 173 parsed, err := KlaytnRewardMetaData.GetAbi() 174 if err != nil { 175 return nil, err 176 } 177 return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil 178 } 179 180 // Call invokes the (constant) contract method with params as input values and 181 // sets the output to result. The result type might be a single field for simple 182 // returns, a slice of interfaces for anonymous returns and a struct for named 183 // returns. 184 func (_KlaytnReward *KlaytnRewardRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 185 return _KlaytnReward.Contract.KlaytnRewardCaller.contract.Call(opts, result, method, params...) 186 } 187 188 // Transfer initiates a plain transaction to move funds to the contract, calling 189 // its default method if one is available. 190 func (_KlaytnReward *KlaytnRewardRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 191 return _KlaytnReward.Contract.KlaytnRewardTransactor.contract.Transfer(opts) 192 } 193 194 // Transact invokes the (paid) contract method with params as input values. 195 func (_KlaytnReward *KlaytnRewardRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 196 return _KlaytnReward.Contract.KlaytnRewardTransactor.contract.Transact(opts, method, params...) 197 } 198 199 // Call invokes the (constant) contract method with params as input values and 200 // sets the output to result. The result type might be a single field for simple 201 // returns, a slice of interfaces for anonymous returns and a struct for named 202 // returns. 203 func (_KlaytnReward *KlaytnRewardCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { 204 return _KlaytnReward.Contract.contract.Call(opts, result, method, params...) 205 } 206 207 // Transfer initiates a plain transaction to move funds to the contract, calling 208 // its default method if one is available. 209 func (_KlaytnReward *KlaytnRewardTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 210 return _KlaytnReward.Contract.contract.Transfer(opts) 211 } 212 213 // Transact invokes the (paid) contract method with params as input values. 214 func (_KlaytnReward *KlaytnRewardTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 215 return _KlaytnReward.Contract.contract.Transact(opts, method, params...) 216 } 217 218 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 219 // 220 // Solidity: function balanceOf(address ) view returns(uint256) 221 func (_KlaytnReward *KlaytnRewardCaller) BalanceOf(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { 222 var out []interface{} 223 err := _KlaytnReward.contract.Call(opts, &out, "balanceOf", arg0) 224 225 if err != nil { 226 return *new(*big.Int), err 227 } 228 229 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 230 231 return out0, err 232 233 } 234 235 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 236 // 237 // Solidity: function balanceOf(address ) view returns(uint256) 238 func (_KlaytnReward *KlaytnRewardSession) BalanceOf(arg0 common.Address) (*big.Int, error) { 239 return _KlaytnReward.Contract.BalanceOf(&_KlaytnReward.CallOpts, arg0) 240 } 241 242 // BalanceOf is a free data retrieval call binding the contract method 0x70a08231. 243 // 244 // Solidity: function balanceOf(address ) view returns(uint256) 245 func (_KlaytnReward *KlaytnRewardCallerSession) BalanceOf(arg0 common.Address) (*big.Int, error) { 246 return _KlaytnReward.Contract.BalanceOf(&_KlaytnReward.CallOpts, arg0) 247 } 248 249 // TotalAmount is a free data retrieval call binding the contract method 0x1a39d8ef. 250 // 251 // Solidity: function totalAmount() view returns(uint256) 252 func (_KlaytnReward *KlaytnRewardCaller) TotalAmount(opts *bind.CallOpts) (*big.Int, error) { 253 var out []interface{} 254 err := _KlaytnReward.contract.Call(opts, &out, "totalAmount") 255 256 if err != nil { 257 return *new(*big.Int), err 258 } 259 260 out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) 261 262 return out0, err 263 264 } 265 266 // TotalAmount is a free data retrieval call binding the contract method 0x1a39d8ef. 267 // 268 // Solidity: function totalAmount() view returns(uint256) 269 func (_KlaytnReward *KlaytnRewardSession) TotalAmount() (*big.Int, error) { 270 return _KlaytnReward.Contract.TotalAmount(&_KlaytnReward.CallOpts) 271 } 272 273 // TotalAmount is a free data retrieval call binding the contract method 0x1a39d8ef. 274 // 275 // Solidity: function totalAmount() view returns(uint256) 276 func (_KlaytnReward *KlaytnRewardCallerSession) TotalAmount() (*big.Int, error) { 277 return _KlaytnReward.Contract.TotalAmount(&_KlaytnReward.CallOpts) 278 } 279 280 // Reward is a paid mutator transaction binding the contract method 0x6353586b. 281 // 282 // Solidity: function reward(address receiver) payable returns() 283 func (_KlaytnReward *KlaytnRewardTransactor) Reward(opts *bind.TransactOpts, receiver common.Address) (*types.Transaction, error) { 284 return _KlaytnReward.contract.Transact(opts, "reward", receiver) 285 } 286 287 // Reward is a paid mutator transaction binding the contract method 0x6353586b. 288 // 289 // Solidity: function reward(address receiver) payable returns() 290 func (_KlaytnReward *KlaytnRewardSession) Reward(receiver common.Address) (*types.Transaction, error) { 291 return _KlaytnReward.Contract.Reward(&_KlaytnReward.TransactOpts, receiver) 292 } 293 294 // Reward is a paid mutator transaction binding the contract method 0x6353586b. 295 // 296 // Solidity: function reward(address receiver) payable returns() 297 func (_KlaytnReward *KlaytnRewardTransactorSession) Reward(receiver common.Address) (*types.Transaction, error) { 298 return _KlaytnReward.Contract.Reward(&_KlaytnReward.TransactOpts, receiver) 299 } 300 301 // SafeWithdrawal is a paid mutator transaction binding the contract method 0xfd6b7ef8. 302 // 303 // Solidity: function safeWithdrawal() returns() 304 func (_KlaytnReward *KlaytnRewardTransactor) SafeWithdrawal(opts *bind.TransactOpts) (*types.Transaction, error) { 305 return _KlaytnReward.contract.Transact(opts, "safeWithdrawal") 306 } 307 308 // SafeWithdrawal is a paid mutator transaction binding the contract method 0xfd6b7ef8. 309 // 310 // Solidity: function safeWithdrawal() returns() 311 func (_KlaytnReward *KlaytnRewardSession) SafeWithdrawal() (*types.Transaction, error) { 312 return _KlaytnReward.Contract.SafeWithdrawal(&_KlaytnReward.TransactOpts) 313 } 314 315 // SafeWithdrawal is a paid mutator transaction binding the contract method 0xfd6b7ef8. 316 // 317 // Solidity: function safeWithdrawal() returns() 318 func (_KlaytnReward *KlaytnRewardTransactorSession) SafeWithdrawal() (*types.Transaction, error) { 319 return _KlaytnReward.Contract.SafeWithdrawal(&_KlaytnReward.TransactOpts) 320 } 321 322 // Fallback is a paid mutator transaction binding the contract fallback function. 323 // 324 // Solidity: fallback() payable returns() 325 func (_KlaytnReward *KlaytnRewardTransactor) Fallback(opts *bind.TransactOpts, calldata []byte) (*types.Transaction, error) { 326 return _KlaytnReward.contract.RawTransact(opts, calldata) 327 } 328 329 // Fallback is a paid mutator transaction binding the contract fallback function. 330 // 331 // Solidity: fallback() payable returns() 332 func (_KlaytnReward *KlaytnRewardSession) Fallback(calldata []byte) (*types.Transaction, error) { 333 return _KlaytnReward.Contract.Fallback(&_KlaytnReward.TransactOpts, calldata) 334 } 335 336 // Fallback is a paid mutator transaction binding the contract fallback function. 337 // 338 // Solidity: fallback() payable returns() 339 func (_KlaytnReward *KlaytnRewardTransactorSession) Fallback(calldata []byte) (*types.Transaction, error) { 340 return _KlaytnReward.Contract.Fallback(&_KlaytnReward.TransactOpts, calldata) 341 }