github.com/kivutar/go-ethereum@v1.7.4-0.20180117074026-6fdb126e9630/contracts/ens/contract/ens.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 "strings" 8 9 "github.com/ethereum/go-ethereum/accounts/abi" 10 "github.com/ethereum/go-ethereum/accounts/abi/bind" 11 "github.com/ethereum/go-ethereum/common" 12 "github.com/ethereum/go-ethereum/core/types" 13 ) 14 15 // ENSABI is the input ABI used to generate the binding from. 16 const ENSABI = "[{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"resolver\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"owner\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"label\",\"type\":\"bytes32\"},{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setSubnodeOwner\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"ttl\",\"type\":\"uint64\"}],\"name\":\"setTTL\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"}],\"name\":\"ttl\",\"outputs\":[{\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"setResolver\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"node\",\"type\":\"bytes32\"},{\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"setOwner\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":true,\"name\":\"label\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"NewOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"resolver\",\"type\":\"address\"}],\"name\":\"NewResolver\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"node\",\"type\":\"bytes32\"},{\"indexed\":false,\"name\":\"ttl\",\"type\":\"uint64\"}],\"name\":\"NewTTL\",\"type\":\"event\"}]" 17 18 // ENSBin is the compiled bytecode used for deploying new contracts. 19 const ENSBin = `0x6060604052341561000f57600080fd5b60008080526020527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb58054600160a060020a033316600160a060020a0319909116179055610503806100626000396000f3006060604052600436106100825763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630178b8bf811461008757806302571be3146100b957806306ab5923146100cf57806314ab9038146100f657806316a25cbd146101195780631896f70a1461014c5780635b0fc9c31461016e575b600080fd5b341561009257600080fd5b61009d600435610190565b604051600160a060020a03909116815260200160405180910390f35b34156100c457600080fd5b61009d6004356101ae565b34156100da57600080fd5b6100f4600435602435600160a060020a03604435166101c9565b005b341561010157600080fd5b6100f460043567ffffffffffffffff6024351661028b565b341561012457600080fd5b61012f600435610357565b60405167ffffffffffffffff909116815260200160405180910390f35b341561015757600080fd5b6100f4600435600160a060020a036024351661038e565b341561017957600080fd5b6100f4600435600160a060020a0360243516610434565b600090815260208190526040902060010154600160a060020a031690565b600090815260208190526040902054600160a060020a031690565b600083815260208190526040812054849033600160a060020a039081169116146101f257600080fd5b8484604051918252602082015260409081019051908190039020915083857fce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e8285604051600160a060020a03909116815260200160405180910390a3506000908152602081905260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555050565b600082815260208190526040902054829033600160a060020a039081169116146102b457600080fd5b827f1d4f9bbfc9cab89d66e1a1562f2233ccbf1308cb4f63de2ead5787adddb8fa688360405167ffffffffffffffff909116815260200160405180910390a250600091825260208290526040909120600101805467ffffffffffffffff90921674010000000000000000000000000000000000000000027fffffffff0000000000000000ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60009081526020819052604090206001015474010000000000000000000000000000000000000000900467ffffffffffffffff1690565b600082815260208190526040902054829033600160a060020a039081169116146103b757600080fd5b827f335721b01866dc23fbee8b6b2c7b1e14d6f05c28cd35a2c934239f94095602a083604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120600101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b600082815260208190526040902054829033600160a060020a0390811691161461045d57600080fd5b827fd4735d920b0f87494915f556dd9b54c8f309026070caea5c737245152564d26683604051600160a060020a03909116815260200160405180910390a250600091825260208290526040909120805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555600a165627a7a7230582087c335a130f7bd19015451f7e1dc0e44cdeb5b64393f51a105ee00160711fcff0029` 20 21 // DeployENS deploys a new Ethereum contract, binding an instance of ENS to it. 22 func DeployENS(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *ENS, error) { 23 parsed, err := abi.JSON(strings.NewReader(ENSABI)) 24 if err != nil { 25 return common.Address{}, nil, nil, err 26 } 27 address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(ENSBin), backend) 28 if err != nil { 29 return common.Address{}, nil, nil, err 30 } 31 return address, tx, &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}}, nil 32 } 33 34 // ENS is an auto generated Go binding around an Ethereum contract. 35 type ENS struct { 36 ENSCaller // Read-only binding to the contract 37 ENSTransactor // Write-only binding to the contract 38 } 39 40 // ENSCaller is an auto generated read-only Go binding around an Ethereum contract. 41 type ENSCaller struct { 42 contract *bind.BoundContract // Generic contract wrapper for the low level calls 43 } 44 45 // ENSTransactor is an auto generated write-only Go binding around an Ethereum contract. 46 type ENSTransactor struct { 47 contract *bind.BoundContract // Generic contract wrapper for the low level calls 48 } 49 50 // ENSSession is an auto generated Go binding around an Ethereum contract, 51 // with pre-set call and transact options. 52 type ENSSession struct { 53 Contract *ENS // Generic contract binding to set the session for 54 CallOpts bind.CallOpts // Call options to use throughout this session 55 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 56 } 57 58 // ENSCallerSession is an auto generated read-only Go binding around an Ethereum contract, 59 // with pre-set call options. 60 type ENSCallerSession struct { 61 Contract *ENSCaller // Generic contract caller binding to set the session for 62 CallOpts bind.CallOpts // Call options to use throughout this session 63 } 64 65 // ENSTransactorSession is an auto generated write-only Go binding around an Ethereum contract, 66 // with pre-set transact options. 67 type ENSTransactorSession struct { 68 Contract *ENSTransactor // Generic contract transactor binding to set the session for 69 TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session 70 } 71 72 // ENSRaw is an auto generated low-level Go binding around an Ethereum contract. 73 type ENSRaw struct { 74 Contract *ENS // Generic contract binding to access the raw methods on 75 } 76 77 // ENSCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. 78 type ENSCallerRaw struct { 79 Contract *ENSCaller // Generic read-only contract binding to access the raw methods on 80 } 81 82 // ENSTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. 83 type ENSTransactorRaw struct { 84 Contract *ENSTransactor // Generic write-only contract binding to access the raw methods on 85 } 86 87 // NewENS creates a new instance of ENS, bound to a specific deployed contract. 88 func NewENS(address common.Address, backend bind.ContractBackend) (*ENS, error) { 89 contract, err := bindENS(address, backend, backend) 90 if err != nil { 91 return nil, err 92 } 93 return &ENS{ENSCaller: ENSCaller{contract: contract}, ENSTransactor: ENSTransactor{contract: contract}}, nil 94 } 95 96 // NewENSCaller creates a new read-only instance of ENS, bound to a specific deployed contract. 97 func NewENSCaller(address common.Address, caller bind.ContractCaller) (*ENSCaller, error) { 98 contract, err := bindENS(address, caller, nil) 99 if err != nil { 100 return nil, err 101 } 102 return &ENSCaller{contract: contract}, nil 103 } 104 105 // NewENSTransactor creates a new write-only instance of ENS, bound to a specific deployed contract. 106 func NewENSTransactor(address common.Address, transactor bind.ContractTransactor) (*ENSTransactor, error) { 107 contract, err := bindENS(address, nil, transactor) 108 if err != nil { 109 return nil, err 110 } 111 return &ENSTransactor{contract: contract}, nil 112 } 113 114 // bindENS binds a generic wrapper to an already deployed contract. 115 func bindENS(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor) (*bind.BoundContract, error) { 116 parsed, err := abi.JSON(strings.NewReader(ENSABI)) 117 if err != nil { 118 return nil, err 119 } 120 return bind.NewBoundContract(address, parsed, caller, transactor), nil 121 } 122 123 // Call invokes the (constant) contract method with params as input values and 124 // sets the output to result. The result type might be a single field for simple 125 // returns, a slice of interfaces for anonymous returns and a struct for named 126 // returns. 127 func (_ENS *ENSRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { 128 return _ENS.Contract.ENSCaller.contract.Call(opts, result, method, params...) 129 } 130 131 // Transfer initiates a plain transaction to move funds to the contract, calling 132 // its default method if one is available. 133 func (_ENS *ENSRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 134 return _ENS.Contract.ENSTransactor.contract.Transfer(opts) 135 } 136 137 // Transact invokes the (paid) contract method with params as input values. 138 func (_ENS *ENSRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 139 return _ENS.Contract.ENSTransactor.contract.Transact(opts, method, params...) 140 } 141 142 // Call invokes the (constant) contract method with params as input values and 143 // sets the output to result. The result type might be a single field for simple 144 // returns, a slice of interfaces for anonymous returns and a struct for named 145 // returns. 146 func (_ENS *ENSCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { 147 return _ENS.Contract.contract.Call(opts, result, method, params...) 148 } 149 150 // Transfer initiates a plain transaction to move funds to the contract, calling 151 // its default method if one is available. 152 func (_ENS *ENSTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { 153 return _ENS.Contract.contract.Transfer(opts) 154 } 155 156 // Transact invokes the (paid) contract method with params as input values. 157 func (_ENS *ENSTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { 158 return _ENS.Contract.contract.Transact(opts, method, params...) 159 } 160 161 // Owner is a free data retrieval call binding the contract method 0x02571be3. 162 // 163 // Solidity: function owner(node bytes32) constant returns(address) 164 func (_ENS *ENSCaller) Owner(opts *bind.CallOpts, node [32]byte) (common.Address, error) { 165 var ( 166 ret0 = new(common.Address) 167 ) 168 out := ret0 169 err := _ENS.contract.Call(opts, out, "owner", node) 170 return *ret0, err 171 } 172 173 // Owner is a free data retrieval call binding the contract method 0x02571be3. 174 // 175 // Solidity: function owner(node bytes32) constant returns(address) 176 func (_ENS *ENSSession) Owner(node [32]byte) (common.Address, error) { 177 return _ENS.Contract.Owner(&_ENS.CallOpts, node) 178 } 179 180 // Owner is a free data retrieval call binding the contract method 0x02571be3. 181 // 182 // Solidity: function owner(node bytes32) constant returns(address) 183 func (_ENS *ENSCallerSession) Owner(node [32]byte) (common.Address, error) { 184 return _ENS.Contract.Owner(&_ENS.CallOpts, node) 185 } 186 187 // Resolver is a free data retrieval call binding the contract method 0x0178b8bf. 188 // 189 // Solidity: function resolver(node bytes32) constant returns(address) 190 func (_ENS *ENSCaller) Resolver(opts *bind.CallOpts, node [32]byte) (common.Address, error) { 191 var ( 192 ret0 = new(common.Address) 193 ) 194 out := ret0 195 err := _ENS.contract.Call(opts, out, "resolver", node) 196 return *ret0, err 197 } 198 199 // Resolver is a free data retrieval call binding the contract method 0x0178b8bf. 200 // 201 // Solidity: function resolver(node bytes32) constant returns(address) 202 func (_ENS *ENSSession) Resolver(node [32]byte) (common.Address, error) { 203 return _ENS.Contract.Resolver(&_ENS.CallOpts, node) 204 } 205 206 // Resolver is a free data retrieval call binding the contract method 0x0178b8bf. 207 // 208 // Solidity: function resolver(node bytes32) constant returns(address) 209 func (_ENS *ENSCallerSession) Resolver(node [32]byte) (common.Address, error) { 210 return _ENS.Contract.Resolver(&_ENS.CallOpts, node) 211 } 212 213 // Ttl is a free data retrieval call binding the contract method 0x16a25cbd. 214 // 215 // Solidity: function ttl(node bytes32) constant returns(uint64) 216 func (_ENS *ENSCaller) Ttl(opts *bind.CallOpts, node [32]byte) (uint64, error) { 217 var ( 218 ret0 = new(uint64) 219 ) 220 out := ret0 221 err := _ENS.contract.Call(opts, out, "ttl", node) 222 return *ret0, err 223 } 224 225 // Ttl is a free data retrieval call binding the contract method 0x16a25cbd. 226 // 227 // Solidity: function ttl(node bytes32) constant returns(uint64) 228 func (_ENS *ENSSession) Ttl(node [32]byte) (uint64, error) { 229 return _ENS.Contract.Ttl(&_ENS.CallOpts, node) 230 } 231 232 // Ttl is a free data retrieval call binding the contract method 0x16a25cbd. 233 // 234 // Solidity: function ttl(node bytes32) constant returns(uint64) 235 func (_ENS *ENSCallerSession) Ttl(node [32]byte) (uint64, error) { 236 return _ENS.Contract.Ttl(&_ENS.CallOpts, node) 237 } 238 239 // SetOwner is a paid mutator transaction binding the contract method 0x5b0fc9c3. 240 // 241 // Solidity: function setOwner(node bytes32, owner address) returns() 242 func (_ENS *ENSTransactor) SetOwner(opts *bind.TransactOpts, node [32]byte, owner common.Address) (*types.Transaction, error) { 243 return _ENS.contract.Transact(opts, "setOwner", node, owner) 244 } 245 246 // SetOwner is a paid mutator transaction binding the contract method 0x5b0fc9c3. 247 // 248 // Solidity: function setOwner(node bytes32, owner address) returns() 249 func (_ENS *ENSSession) SetOwner(node [32]byte, owner common.Address) (*types.Transaction, error) { 250 return _ENS.Contract.SetOwner(&_ENS.TransactOpts, node, owner) 251 } 252 253 // SetOwner is a paid mutator transaction binding the contract method 0x5b0fc9c3. 254 // 255 // Solidity: function setOwner(node bytes32, owner address) returns() 256 func (_ENS *ENSTransactorSession) SetOwner(node [32]byte, owner common.Address) (*types.Transaction, error) { 257 return _ENS.Contract.SetOwner(&_ENS.TransactOpts, node, owner) 258 } 259 260 // SetResolver is a paid mutator transaction binding the contract method 0x1896f70a. 261 // 262 // Solidity: function setResolver(node bytes32, resolver address) returns() 263 func (_ENS *ENSTransactor) SetResolver(opts *bind.TransactOpts, node [32]byte, resolver common.Address) (*types.Transaction, error) { 264 return _ENS.contract.Transact(opts, "setResolver", node, resolver) 265 } 266 267 // SetResolver is a paid mutator transaction binding the contract method 0x1896f70a. 268 // 269 // Solidity: function setResolver(node bytes32, resolver address) returns() 270 func (_ENS *ENSSession) SetResolver(node [32]byte, resolver common.Address) (*types.Transaction, error) { 271 return _ENS.Contract.SetResolver(&_ENS.TransactOpts, node, resolver) 272 } 273 274 // SetResolver is a paid mutator transaction binding the contract method 0x1896f70a. 275 // 276 // Solidity: function setResolver(node bytes32, resolver address) returns() 277 func (_ENS *ENSTransactorSession) SetResolver(node [32]byte, resolver common.Address) (*types.Transaction, error) { 278 return _ENS.Contract.SetResolver(&_ENS.TransactOpts, node, resolver) 279 } 280 281 // SetSubnodeOwner is a paid mutator transaction binding the contract method 0x06ab5923. 282 // 283 // Solidity: function setSubnodeOwner(node bytes32, label bytes32, owner address) returns() 284 func (_ENS *ENSTransactor) SetSubnodeOwner(opts *bind.TransactOpts, node [32]byte, label [32]byte, owner common.Address) (*types.Transaction, error) { 285 return _ENS.contract.Transact(opts, "setSubnodeOwner", node, label, owner) 286 } 287 288 // SetSubnodeOwner is a paid mutator transaction binding the contract method 0x06ab5923. 289 // 290 // Solidity: function setSubnodeOwner(node bytes32, label bytes32, owner address) returns() 291 func (_ENS *ENSSession) SetSubnodeOwner(node [32]byte, label [32]byte, owner common.Address) (*types.Transaction, error) { 292 return _ENS.Contract.SetSubnodeOwner(&_ENS.TransactOpts, node, label, owner) 293 } 294 295 // SetSubnodeOwner is a paid mutator transaction binding the contract method 0x06ab5923. 296 // 297 // Solidity: function setSubnodeOwner(node bytes32, label bytes32, owner address) returns() 298 func (_ENS *ENSTransactorSession) SetSubnodeOwner(node [32]byte, label [32]byte, owner common.Address) (*types.Transaction, error) { 299 return _ENS.Contract.SetSubnodeOwner(&_ENS.TransactOpts, node, label, owner) 300 } 301 302 // SetTTL is a paid mutator transaction binding the contract method 0x14ab9038. 303 // 304 // Solidity: function setTTL(node bytes32, ttl uint64) returns() 305 func (_ENS *ENSTransactor) SetTTL(opts *bind.TransactOpts, node [32]byte, ttl uint64) (*types.Transaction, error) { 306 return _ENS.contract.Transact(opts, "setTTL", node, ttl) 307 } 308 309 // SetTTL is a paid mutator transaction binding the contract method 0x14ab9038. 310 // 311 // Solidity: function setTTL(node bytes32, ttl uint64) returns() 312 func (_ENS *ENSSession) SetTTL(node [32]byte, ttl uint64) (*types.Transaction, error) { 313 return _ENS.Contract.SetTTL(&_ENS.TransactOpts, node, ttl) 314 } 315 316 // SetTTL is a paid mutator transaction binding the contract method 0x14ab9038. 317 // 318 // Solidity: function setTTL(node bytes32, ttl uint64) returns() 319 func (_ENS *ENSTransactorSession) SetTTL(node [32]byte, ttl uint64) (*types.Transaction, error) { 320 return _ENS.Contract.SetTTL(&_ENS.TransactOpts, node, ttl) 321 }