Contract-Invocation

如何直接從 sbt-ethereum 呼叫永久 ENS 註冊商合約?

  • May 7, 2019

我想使用sbt-ethereum.eth registrar controller在新的 ENS 契約中註冊一個名稱(例如 ‘somename’ >= 7 個字元) ,為期一年。

我已確認 .ethens-registrar-controller 合約中的程式碼包含正確的程式碼,並且該合約於 5 月 4 日生效。

我能夠與合約進行互動,例如確認所有者是ENS-Multisig ethTransactionView ens-registrar-controller owner

該計劃是:

  1. 確保 somename 有效:ethTransactionView ens-registrar-controller valid somename
  2. 該 somename 可用:ethTransactionView ens-registrar-controller available somename
  3. 以 wei計算myrent一年的秒數(3652460*60):ethTransactionView ens-registrar-controller rentPrice somename 31536000
  4. mysecret通過去除空白並添加 0x生成並保存32 個隨機字節。例如0x92ad4989c7906ab2b2830e534e434179f6dfdb67012187741be3520ea1a204c5
  5. secretmessage使用方便的內置嵌套 keccak256 函式計算:ethTransactionView ens-registrar-controller makeCommitment somename default-sender mysecret
  6. 發送secretmessageethTransactionInvoke ens-registrar-controller commit secretmessage
  7. 等待 >1 分鐘然後註冊,注意這筆交易是按數量支付myrent的,我將在 wei 中添加:ethTransactionInvoke ens-registrar-controller register somename default-sender 31536000 mysecret myrent wei

但是,呼叫這些函式會導致一個常見錯誤,對於第 1 步是:

$NonthrowableFailureException: Failed: No matching function 'valid' for args 'somename' in ABI

出現常見錯誤讓我懷疑我在做一些基本錯誤。**有任何想法嗎?**我懷疑一旦我可以執行第 1 步,第 2-7 步將是可行的。


我注意到合約程式碼包含控制器程式碼作為子集。也許我不明白如何在具有多個契約部分的已部署契約中呼叫函式。例如,owner我能夠呼叫的函式位於一個contract Ownable部分中,與該部分分開contract ETHRegistrarController is Ownable包含我感興趣的函式。

注意:通常我會為幾乎所有內容使用地址別名,而不是十六進制地址。但是除了基址之外的所有地址都ens可能發生變化,理想情況下應該在每次使用時動態查找。因此,除此之外,我將使用十六進制地址。ENS 並不是一個真正方便“手動”使用的應用程序。sbt-ethereum 的ens*任務有望很快更新,以使這更容易。

所以,讓我們從這裡的文件開始。

查找新註冊商的地址很簡單:通過在 ENS 系統資料庫上呼叫 owner(namehash(’eth’)) 在 ENS 中查找域“eth”的所有者。

namehash(“eth”) 是0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae. (sbt-ethereum應該將 namehash 顯示為實用程序。通常,它的ens*任務需要針對新的 ENS 註冊器進行更新。)

確保我們將ens(一份不變的合約)設置為地址別名。

sbt:ethdocstore> ethAddressAliasCheck ens
The alias 'ens' points to address '0x314159265dd8dbb310642f98f50c066173c1259b'.

如果我們不這樣做,請通過ethAddressAliasSet ens 0x314159265dd8dbb310642f98f50c066173c1259b. 科爾。

接下來,讓我們通過查找namehash('eth'). 在撰寫本文時(它可能有一天會再次改變!)產生……

sbt:ethdocstore> ethTransactionView ens owner 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae
[info] The function 'owner' yields 1 result.
[info]  + Result 1 of type 'address' is 0xfac7bea255a6990f749363002136af6556b31e04
[success] Total time: 1 s, completed May 6, 2019 4:29:01 PM

那是新的/目前註冊商的地址。

但是,使用控制器可能會更容易一些(這節省了我們計算標籤雜湊的工作,就像我們直接向註冊商註冊一樣)。根據文件,我們希望頂級域的解析器eth找到:

sbt:ethdocstore> ethTransactionView ens resolver 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae
[info] The function 'resolver' yields 1 result.
[info]  + Result 1 of type 'address' is 0x97683a370239817cf33ec2c2ad3b3a1884571f69
[success] Total time: 1 s, completed May 6, 2019 4:35:37 PM

我們想要與這個解析器互動,所以我們需要它的 ABI。(如果你沒有,設置一個 Etherscan ABI 密鑰真的很有幫助,當然你可以複製和粘貼。)

> ethContractAbiImport 0x97683a370239817cf33ec2c2ad3b3a1884571f69
An Etherscan API key has been set. Would you like to try to import the ABI for this address from Etherscan? [y/n] y
Attempting to fetch ABI for address '0x97683a370239817cf33ec2c2ad3b3a1884571f69' from Etherscan.
ABI found:
[{"outputs":[{"name":"","type":"bool"}],"constant":true,"payable":false,"inputs":[{"name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","stateMutability":"pure","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"key","type":"string"},{"name":"value","type":"string"}],"name":"setText","stateMutability":"nonpayable","type":"function"},{"outputs":[{"name":"","type":"address"}],"constant":true,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"interfaceID","type":"bytes4"}],"name":"interfaceImplementer","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"uint256"},{"name":"","type":"bytes"}],"constant":true,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"contentTypes","type":"uint256"}],"name":"ABI","stateMutability":"view","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"x","type":"bytes32"},{"name":"y","type":"bytes32"}],"name":"setPubkey","stateMutability":"nonpayable","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"hash","type":"bytes"}],"name":"setContenthash","stateMutability":"nonpayable","type":"function"},{"outputs":[{"name":"","type":"address"}],"constant":true,"payable":false,"inputs":[{"name":"node","type":"bytes32"}],"name":"addr","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"string"}],"constant":true,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"key","type":"string"}],"name":"text","stateMutability":"view","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"contentType","type":"uint256"},{"name":"data","type":"bytes"}],"name":"setABI","stateMutability":"nonpayable","type":"function"},{"outputs":[{"name":"","type":"string"}],"constant":true,"payable":false,"inputs":[{"name":"node","type":"bytes32"}],"name":"name","stateMutability":"view","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[],"name":"renounceOwnership","stateMutability":"nonpayable","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"name","type":"string"}],"name":"setName","stateMutability":"nonpayable","type":"function"},{"outputs":[{"name":"","type":"address"}],"constant":true,"payable":false,"inputs":[],"name":"owner","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"bool"}],"constant":true,"payable":false,"inputs":[],"name":"isOwner","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"bytes"}],"constant":true,"payable":false,"inputs":[{"name":"node","type":"bytes32"}],"name":"contenthash","stateMutability":"view","type":"function"},{"outputs":[{"name":"x","type":"bytes32"},{"name":"y","type":"bytes32"}],"constant":true,"payable":false,"inputs":[{"name":"node","type":"bytes32"}],"name":"pubkey","stateMutability":"view","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"addr","type":"address"}],"name":"setAddr","stateMutability":"nonpayable","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"node","type":"bytes32"},{"name":"interfaceID","type":"bytes4"},{"name":"implementer","type":"address"}],"name":"setInterface","stateMutability":"nonpayable","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"node","type":"bytes32","indexed":true},{"name":"indexedKey","type":"string","indexed":false},{"name":"key","type":"string","indexed":false}],"name":"TextChanged","anonymous":false,"type":"event"},{"inputs":[{"name":"node","type":"bytes32","indexed":true},{"name":"x","type":"bytes32","indexed":false},{"name":"y","type":"bytes32","indexed":false}],"name":"PubkeyChanged","anonymous":false,"type":"event"},{"inputs":[{"name":"node","type":"bytes32","indexed":true},{"name":"name","type":"string","indexed":false}],"name":"NameChanged","anonymous":false,"type":"event"},{"inputs":[{"name":"node","type":"bytes32","indexed":true},{"name":"interfaceID","type":"bytes4","indexed":true},{"name":"implementer","type":"address","indexed":false}],"name":"InterfaceChanged","anonymous":false,"type":"event"},{"inputs":[{"name":"node","type":"bytes32","indexed":true},{"name":"hash","type":"bytes","indexed":false}],"name":"ContenthashChanged","anonymous":false,"type":"event"},{"inputs":[{"name":"node","type":"bytes32","indexed":true},{"name":"a","type":"address","indexed":false}],"name":"AddrChanged","anonymous":false,"type":"event"},{"inputs":[{"name":"node","type":"bytes32","indexed":true},{"name":"contentType","type":"uint256","indexed":true}],"name":"ABIChanged","anonymous":false,"type":"event"},{"inputs":[{"name":"previousOwner","type":"address","indexed":true},{"name":"newOwner","type":"address","indexed":true}],"name":"OwnershipTransferred","anonymous":false,"type":"event"}]
Use this ABI? [y/n] y
[info] A default ABI is now known for the contract at address 0x97683a370239817cf33ec2c2ad3b3a1884571f69
[info] Refreshing caches.
[success] Total time: 6 s, completed May 6, 2019 4:36:52 PM

現在我們可以按照說明為頂級域找到一個控制器eth,使用它的 namehash 作為它的節點 ID(上面的計算方式),以及記錄在案的四字節介面 ID 0x018fac06

> ethTransactionView 0x97683a370239817cf33ec2c2ad3b3a1884571f69 interfaceImplementer 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae 0x018fac06
[info] The function 'interfaceImplementer' yields 1 result.
[info]  + Result 1 of type 'address' is 0xf0ad5cad05e10572efceb849f6ff0c68f9700455
[success] Total time: 1 s, completed May 6, 2019 4:41:44 PM

耶!我們有頂級eth域的控制器地址。讓我們成為使用者,我們有它的 ABI。

> ethContractAbiImport 0xf0ad5cad05e10572efceb849f6ff0c68f9700455
An Etherscan API key has been set. Would you like to try to import the ABI for this address from Etherscan? [y/n] y
Attempting to fetch ABI for address '0xf0ad5cad05e10572efceb849f6ff0c68f9700455' from Etherscan.
ABI found:
[{"outputs":[{"name":"","type":"bool"}],"constant":true,"payable":false,"inputs":[{"name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","stateMutability":"pure","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[],"name":"withdraw","stateMutability":"nonpayable","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"_prices","type":"address"}],"name":"setPriceOracle","stateMutability":"nonpayable","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[],"name":"renounceOwnership","stateMutability":"nonpayable","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"_minCommitmentAge","type":"uint256"},{"name":"_maxCommitmentAge","type":"uint256"}],"name":"setCommitmentAges","stateMutability":"nonpayable","type":"function"},{"outputs":[{"name":"","type":"uint256"}],"constant":true,"payable":false,"inputs":[{"name":"","type":"bytes32"}],"name":"commitments","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"uint256"}],"constant":true,"payable":false,"inputs":[{"name":"name","type":"string"},{"name":"duration","type":"uint256"}],"name":"rentPrice","stateMutability":"view","type":"function"},{"outputs":[],"constant":false,"payable":true,"inputs":[{"name":"name","type":"string"},{"name":"owner","type":"address"},{"name":"duration","type":"uint256"},{"name":"secret","type":"bytes32"}],"name":"register","stateMutability":"payable","type":"function"},{"outputs":[{"name":"","type":"uint256"}],"constant":true,"payable":false,"inputs":[],"name":"MIN_REGISTRATION_DURATION","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"uint256"}],"constant":true,"payable":false,"inputs":[],"name":"minCommitmentAge","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"address"}],"constant":true,"payable":false,"inputs":[],"name":"owner","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"bool"}],"constant":true,"payable":false,"inputs":[],"name":"isOwner","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"bool"}],"constant":true,"payable":false,"inputs":[{"name":"name","type":"string"}],"name":"valid","stateMutability":"view","type":"function"},{"outputs":[],"constant":false,"payable":true,"inputs":[{"name":"name","type":"string"},{"name":"duration","type":"uint256"}],"name":"renew","stateMutability":"payable","type":"function"},{"outputs":[{"name":"","type":"bool"}],"constant":true,"payable":false,"inputs":[{"name":"name","type":"string"}],"name":"available","stateMutability":"view","type":"function"},{"outputs":[{"name":"","type":"uint256"}],"constant":true,"payable":false,"inputs":[],"name":"maxCommitmentAge","stateMutability":"view","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"commitment","type":"bytes32"}],"name":"commit","stateMutability":"nonpayable","type":"function"},{"outputs":[],"constant":false,"payable":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","stateMutability":"nonpayable","type":"function"},{"outputs":[{"name":"","type":"bytes32"}],"constant":true,"payable":false,"inputs":[{"name":"name","type":"string"},{"name":"owner","type":"address"},{"name":"secret","type":"bytes32"}],"name":"makeCommitment","stateMutability":"pure","type":"function"},{"inputs":[{"name":"name","type":"string","indexed":false},{"name":"label","type":"bytes32","indexed":true},{"name":"owner","type":"address","indexed":true},{"name":"cost","type":"uint256","indexed":false},{"name":"expires","type":"uint256","indexed":false}],"name":"NameRegistered","anonymous":false,"type":"event"},{"inputs":[{"name":"name","type":"string","indexed":false},{"name":"label","type":"bytes32","indexed":true},{"name":"cost","type":"uint256","indexed":false},{"name":"expires","type":"uint256","indexed":false}],"name":"NameRenewed","anonymous":false,"type":"event"},{"inputs":[{"name":"oracle","type":"address","indexed":true}],"name":"NewPriceOracle","anonymous":false,"type":"event"},{"inputs":[{"name":"previousOwner","type":"address","indexed":true},{"name":"newOwner","type":"address","indexed":true}],"name":"OwnershipTransferred","anonymous":false,"type":"event"},{"payable":false,"inputs":[{"name":"_base","type":"address"},{"name":"_prices","type":"address"},{"name":"_minCommitmentAge","type":"uint256"},{"name":"_maxCommitmentAge","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"}]
Use this ABI? [y/n] y
[info] A default ABI is now known for the contract at address 0xf0ad5cad05e10572efceb849f6ff0c68f9700455
[info] Refreshing caches.
[success] Total time: 4 s, completed May 6, 2019 4:43:39 PM

好的!現在我們有了一個簡單的契約,我們可以使用它來註冊名稱!我們將按照這裡的指示。

首先,讓我們看看我們想要的名稱是否可用

> ethTransactionView 0xf0ad5cad05e10572efceb849f6ff0c68f9700455 available "coldbrew"
[info] The function 'available' yields 1 result.
[info]  + Result 1 of type 'bool' is false
[success] Total time: 0 s, completed May 6, 2019 4:52:40 PM
> ethTransactionView 0xf0ad5cad05e10572efceb849f6ff0c68f9700455 available "omnivorous"
[info] The function 'available' yields 1 result.
[info]  + Result 1 of type 'bool' is true
[success] Total time: 0 s, completed May 6, 2019 4:53:11 PM

唔。我們的第一選擇不可用。但我們的第二個選擇,“不祥”是。讓我們抓住它。

接下來,我們檢查最短註冊時長:

> ethTransactionView 0xf0ad5cad05e10572efceb849f6ff0c68f9700455 MIN_REGISTRATION_DURATION
[info] The function 'MIN_REGISTRATION_DURATION' yields 1 result.
[info]  + Result 1 of type 'uint256' is 2419200
[success] Total time: 1 s, completed May 6, 2019 4:55:47 PM

科爾。讓我們找出該期間的租金價格:

> ethTransactionView 0xf0ad5cad05e10572efceb849f6ff0c68f9700455 rentPrice "omnivorous" 2419200
[info] The function 'rentPrice' yields 1 result.
[info]  + Result 1 of type 'uint256' is 2218914982274932
[success] Total time: 1 s, completed May 6, 2019 4:58:14 PM

那是0.022 ETH 0.0022 ETH。指示建議支付 5% - 10% 的保費,差額將予以報銷。我們稱之為 0.025 ETH。(我們,嗯,多付了A LOT,減少了 10 倍,但差額被退還了。ENS 不會在更改上作弊!我以為最短註冊期限是一年,但它只是2419200 / (24*60*60) = 28 days

接下來,我們需要生成一個承諾。控制器有一個實用程序可以為我們做這件事。我們需要一個 32 字節的“秘密”,這將有助於保護我們免受試圖猜測我們要註冊的名稱的人的影響並搶先執行它。也許sbt-ethereum應該為此提供一個實用程序,但現在我們只需訪問一個網站,給我們一個隨機的 32 字節字元串。(如果這是一項高價值的操作,我們會更加私密地生成秘密!)

> ethTransactionView 0xf0ad5cad05e10572efceb849f6ff0c68f9700455 makeCommitment "omnivorous" default-sender 0xec2ac5eb3d0c2b0ae1815fbd4d7cd59a7367f3404ffa67e7e3577cb15a6a5d75
[info] The function 'makeCommitment' yields 1 result.
[info]  + Result 1 of type 'bytes32' is 0xd7b8becc2e8c84946c19846ba76bd3a3d83148a1266ac04b1e668007e1cb736c
[success] Total time: 1 s, completed May 6, 2019 5:06:56 PM

好的。現在我們開始實際執行此操作。commit我們用我們生成的承諾呼叫控制器。

> ethTransactionInvoke 0xf0ad5cad05e10572efceb849f6ff0c68f9700455 commit 0xd7b8becc2e8c84946c19846ba76bd3a3d83148a1266ac04b1e668007e1cb736c
[info] Unlocking address '0x465e79b940bc2157e4259ff6b2d92f454497f1e4' (on chain with ID 1, aliases ['default-sender','testing0'])
Enter passphrase or hex private key for address '0x465e79b940bc2157e4259ff6b2d92f454497f1e4': *******************
[info] V3 wallet(s) found for '0x465e79b940bc2157e4259ff6b2d92f454497f1e4' (aliases ['default-sender','testing0'])

==> T R A N S A C T I O N   S U B M I S S I O N   R E Q U E S T
==>
==> The transaction would be a message with...
==>   To:    0xf0ad5cad05e10572efceb849f6ff0c68f9700455 (with aliases ['ens-eth-tld-controller'] on chain with ID 1)
==>   From:  0x465e79b940bc2157e4259ff6b2d92f454497f1e4 (with aliases ['default-sender','testing0'] on chain with ID 1)
==>   Data:  0xf14fcbc8d7b8becc2e8c84946c19846ba76bd3a3d83148a1266ac04b1e668007e1cb736c
==>   Value: 0 Ether
==>
==> The transaction is signed with Chain ID 1 (which correctly matches the current session's 'ethNodeChainId').
==>
==> According to the ABI currently associated with the 'to' address, this message would amount to the following method call...
==>   Function called: commit(bytes32)
==>     Arg 1 [name=commitment, type=bytes32]: 0xd7b8becc2e8c84946c19846ba76bd3a3d83148a1266ac04b1e668007e1cb736c
==>
==> The nonce of the transaction would be 408.
==>
==> $$$ The transaction you have requested could use up to 53206 units of gas.
==> $$$ You would pay 5 gwei for each unit of gas, for a maximum cost of 0.00026603 ether.
==> $$$ This is worth 0.04655391985 USD (according to Coinbase at 5:08 PM).

Would you like to submit this transaction? [y/n] y
A transaction with hash '0x46828d4061dfc4d2c9ac41a8e6754037490e02e9754c4bc0741c18f28b03ff65' will be submitted. Please wait.
[info] Called function 'commit', with args 'd7b8becc2e8c84946c19846ba76bd3a3d83148a1266ac04b1e668007e1cb736c', sending 0 wei to address '0xf0ad5cad05e10572efceb849f6ff0c68f9700455' in transaction '0x46828d4061dfc4d2c9ac41a8e6754037490e02e9754c4bc0741c18f28b03ff65'.
[info] Waiting for the transaction to be mined (will wait up to 5 minutes).
[info] Transaction Receipt:
[info]        Transaction Hash:    0x46828d4061dfc4d2c9ac41a8e6754037490e02e9754c4bc0741c18f28b03ff65
[info]        Transaction Index:   49
[info]        Transaction Status:  SUCCEEDED
[info]        Block Hash:          0xd3957380725405739d638e2387d676ed15dbf4e766740733311045cd67788213
[info]        Block Number:        7710406
[info]        From:                0x465e79b940bc2157e4259ff6b2d92f454497f1e4
[info]        To:                  0xf0ad5cad05e10572efceb849f6ff0c68f9700455
[info]        Cumulative Gas Used: 6861463
[info]        Gas Used:            44339
[info]        Contract Address:    None
[info]        Logs:                None
[info]        Events:              None
[success] Total time: 48 s, completed May 6, 2019 5:09:28 PM

現在我們必須等待至少一分鐘(但不超過 24 小時),然後我們終於可以註冊我們的名字了。

> ethTransactionInvoke 0xf0ad5cad05e10572efceb849f6ff0c68f9700455 register "omnivorous" default-sender 2419200 0xec2ac5eb3d0c2b0ae1815fbd4d7cd59a7367f3404ffa67e7e3577cb15a6a5d75 0.025 ether
Using sender address '0x465e79b940bc2157e4259ff6b2d92f454497f1e4' (on chain with ID 1, aliases ['default-sender','testing0']). OK? [y/n] y

==> T R A N S A C T I O N   S U B M I S S I O N   R E Q U E S T
==>
==> The transaction would be a message with...
==>   To:    0xf0ad5cad05e10572efceb849f6ff0c68f9700455 (with aliases ['ens-eth-tld-controller'] on chain with ID 1)
==>   From:  0x465e79b940bc2157e4259ff6b2d92f454497f1e4 (with aliases ['default-sender','testing0'] on chain with ID 1)
==>   Data:  0x85f6d1550000000000000000000000000000000000000000000000000000000000000080000000000000000000000000465e79b940bc2157e4259ff6b2d92f454497f1e4000000000000000000000000000000000000000000000000000000000024ea00ec2ac5eb3d0c2b0ae1815fbd4d7cd59a7367f3404ffa67e7e3577cb15a6a5d75000000000000000000000000000000000000000000000000000000000000000a6f6d6e69766f726f757300000000000000000000000000000000000000000000
==>   Value: 0.025 Ether
==>
==> The transaction is signed with Chain ID 1 (which correctly matches the current session's 'ethNodeChainId').
==>
==> According to the ABI currently associated with the 'to' address, this message would amount to the following method call...
==>   Function called: register(string,address,uint256,bytes32)
==>     Arg 1 [name=name, type=string]: "omnivorous"
==>     Arg 2 [name=owner, type=address]: 0x465e79b940bc2157e4259ff6b2d92f454497f1e4
==>     Arg 3 [name=duration, type=uint256]: 2419200
==>     Arg 4 [name=secret, type=bytes32]: 0xec2ac5eb3d0c2b0ae1815fbd4d7cd59a7367f3404ffa67e7e3577cb15a6a5d75
==>
==> The nonce of the transaction would be 409.
==>
==> $$$ The transaction you have requested could use up to 181833 units of gas.
==> $$$ You would pay 5 gwei for each unit of gas, for a maximum cost of 0.000909165 ether.
==> $$$ This is worth 0.160999484025 USD (according to Coinbase at 5:13 PM).
==> $$$ You would also send 0.025 ether (4.427125 USD), for a maximum total cost of 0.025909165 ether (4.588124484025 USD).

Would you like to submit this transaction? [y/n] y
A transaction with hash '0x463c24c5aef9e8c97fd571c9fa3a9c2de1dd04f8c1da0d3f31245a485cce55f1' will be submitted. Please wait.
[info] Called function 'register', with args '"omnivorous", 465e79b940bc2157e4259ff6b2d92f454497f1e4, 2419200, ec2ac5eb3d0c2b0ae1815fbd4d7cd59a7367f3404ffa67e7e3577cb15a6a5d75', sending 25000000000000000 wei to address '0xf0ad5cad05e10572efceb849f6ff0c68f9700455' in transaction '0x463c24c5aef9e8c97fd571c9fa3a9c2de1dd04f8c1da0d3f31245a485cce55f1'.
[info] Waiting for the transaction to be mined (will wait up to 5 minutes).
[info] Transaction Receipt:
[info]        Transaction Hash:    0x463c24c5aef9e8c97fd571c9fa3a9c2de1dd04f8c1da0d3f31245a485cce55f1
[info]        Transaction Index:   45
[info]        Transaction Status:  SUCCEEDED
[info]        Block Hash:          0x7ffb7eff66d8516e50f447279ff7e1409a0a4178eec89bbb6cad10367ce9754e
[info]        Block Number:        7710424
[info]        From:                0x465e79b940bc2157e4259ff6b2d92f454497f1e4
[info]        To:                  0xf0ad5cad05e10572efceb849f6ff0c68f9700455
[info]        Cumulative Gas Used: 7927356
[info]        Gas Used:            134292
[info]        Contract Address:    None
[info]        Logs:                0 => EthLogEntry [source=0xfac7bea255a6990f749363002136af6556b31e04] (
[info]                                    topics=[
[info]                                      0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef,
[info]                                      0x0000000000000000000000000000000000000000000000000000000000000000,
[info]                                      0x000000000000000000000000465e79b940bc2157e4259ff6b2d92f454497f1e4,
[info]                                      0xbdd753d3174c6057d4300908f42291e9a9b74047fe6074903970054908887b68
[info]                                    ],
[info]                                    data=
[info]                                  ),
[info]                             1 => EthLogEntry [source=0x314159265dd8dbb310642f98f50c066173c1259b] (
[info]                                    topics=[
[info]                                      0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82,
[info]                                      0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae,
[info]                                      0xbdd753d3174c6057d4300908f42291e9a9b74047fe6074903970054908887b68
[info]                                    ],
[info]                                    data=000000000000000000000000465e79b940bc2157e4259ff6b2d92f454497f1e4
[info]                                  ),
[info]                             2 => EthLogEntry [source=0xfac7bea255a6990f749363002136af6556b31e04] (
[info]                                    topics=[
[info]                                      0xb3d987963d01b2f68493b4bdb130988f157ea43070d4ad840fee0466ed9370d9,
[info]                                      0xbdd753d3174c6057d4300908f42291e9a9b74047fe6074903970054908887b68,
[info]                                      0x000000000000000000000000465e79b940bc2157e4259ff6b2d92f454497f1e4
[info]                                    ],
[info]                                    data=000000000000000000000000000000000000000000000000000000005cf5b7ec
[info]                                  ),
[info]                             3 => EthLogEntry [source=0xf0ad5cad05e10572efceb849f6ff0c68f9700455] (
[info]                                    topics=[
[info]                                      0xca6abbe9d7f11422cb6ca7629fbf6fe9efb1c621f71ce8f02b9f2a230097404f,
[info]                                      0xbdd753d3174c6057d4300908f42291e9a9b74047fe6074903970054908887b68,
[info]                                      0x000000000000000000000000465e79b940bc2157e4259ff6b2d92f454497f1e4
[info]                                    ],
[info]                                    data=0000000000000000000000000000000000000000000000000000000000000060
[info]                                         0000000000000000000000000000000000000000000000000007b3402479ec1a
[info]                                         000000000000000000000000000000000000000000000000000000005cf5b7ec
[info]                                         000000000000000000000000000000000000000000000000000000000000000a
[info]                                         6f6d6e69766f726f757300000000000000000000000000000000000000000000
[info]                                  )
[info]        Events:              0 => Anonymous Event [source=0xfac7bea255a6990f749363002136af6556b31e04],
[info]                             1 => Anonymous Event [source=0x314159265dd8dbb310642f98f50c066173c1259b],
[info]                             2 => Anonymous Event [source=0xfac7bea255a6990f749363002136af6556b31e04],
[info]                             3 => NameRegistered [source=0xf0ad5cad05e10572efceb849f6ff0c68f9700455] (
[info]                                    name (of type string): "omnivorous",
[info]                                    label (of type bytes32): 0xbdd753d3174c6057d4300908f42291e9a9b74047fe6074903970054908887b68,
[info]                                    owner (of type address): 0x465e79b940bc2157e4259ff6b2d92f454497f1e4,
[info]                                    cost (of type uint256): 2167412908223514,
[info]                                    expires (of type uint256): 1559607276
[info]                                  )
[success] Total time: 65 s, completed May 6, 2019 5:14:45 PM

嗚呼!omnivorous.eth是我們的!

> ensOwnerLookup omnivorous.eth
The name 'omnivorous.eth' is owned by address '0x465e79b940bc2157e4259ff6b2d92f454497f1e4' (with aliases ['default-sender','testing0'] on chain with ID 1).
[success] Total time: 1 s, completed May 6, 2019 5:15:52 PM

我希望這有幫助!

引用自:https://ethereum.stackexchange.com/questions/70436