Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use AlphaWallet wallet to check and accept the function of test network

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about how to use AlphaWallet wallet to test the functional acceptance of the network, many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

1 Summary

Through the practice of this paper, we can use AlphaWallet wallet to complete the acceptance test of Repsten Test Network ERC20 token transfer, freezing, locking and other functions.

[precondition]

1) know how to debug SOLIDITY language in REMIX, will release lock contract

[harvest]

1) AlphaWallet is a wallet that supports ERC875, and it also perfectly supports ERC20. To learn about ERC875, please refer to [ERC875] HiBlock Hackathon tickets from customization to coding implementation.

2) imToken only supports the wallet function of the main network environment, and AlphaWallet can support various test networks such as Ropsten to reduce the risk that the main network can not be tampered with on the intelligent contract.

2 using AlphaWallet to test the basic function of CLB

2.1 release of CLB tokens

Get the intelligent contract code of CLB and publish the CLB token contract under REMIX+MetaMask (Repston test environment).

Reference practical information that will not send tokens | how a technical rookie issues a pass (TOKEN) and goes online within 45 minutes (with process code) is not detailed here.

Brother Hui released a successful token link: https://ropsten.etherscan.io/tx/0xd84b11e4558c7d40cf6a26b02320e2aefe51caca7942fbd8d6dcf5e89547c38b

Brother Hui publishes the account information used by ACCOUNT1: address: 0xD1F7922e8b78cBEB182250753ade8379d1E09949 Private key: FE8514896FE1882D8751AD012E208889889602FB374A249BCF9DA9FD26EF3655

You can see its corresponding intelligent contract address (Contract Address): 0xe37ffd55b6c135209b6742b7fbe096ae2837fce6

The token information is as follows:

Name = "Colorbay Token"

Symbol = "CLB"

Decimals = 18

TotalSupply = 1 billion

2.2 download the AlphaWallet wallet and import the private key into the wallet

1) download and install APP

Brother Hui downloads APP on the official website (https://awallet.io/) to complete the installation. Set the network to a Ropston (test) network.

2) Import the private key address to the wallet

Address: 0xD1F7922e8b78cBEB182250753ade8379d1E09949 private key: FE8514896FE1882D8751AD012E208889889602FB374A249BCF9DA9FD26EF3655

After the import is successful, you can see the CLB token, which has a total of 1 billion.

Initial 1 billion CLB

2.3 transfer, the new wallet can show the token amount

1) create a wallet

Create a new wallet ACCOUNT2 "0xda5c82f12f5c2ab1ef918afefe089c76103f453c" on AlphaWallet

2) transfer / inquiry

Switch to the ACCOUNT1 account and transfer 10000 CLB to ACCOUNT2 successfully. After waiting for 2 minutes, you can see that there are 10, 000 CLB in ACCOUNT2.

Deal Information: https://ropsten.etherscan.io/tx/0xebab900d530f2eecbeba197bea0abc928ae00c6b3e77eee42b86e517e941d0ec

Screenshot of ACCOUNT2 account balance:

2.4 frozen accounts cannot be transferred.

Use https://www.myetherwallet.com/#contracts to make account freeze calls. Contract Address: 0xe37ffd55b6c135209b6742b7fbe096ae2837fce6

ABI / JSON Interface: (available in REMIX compilation environment), the code is too long to be stored on the knowledge planet, please add the self-fetching file: Colorbay.min.ABI.

The attachment to the article corresponding to knowledge Planet also stores the source code of CLB and Lock Intelligent contract.

When the MetaMask account stays under the CLB token account created by ACCOUNT1, perform the ACCOUT1 action:

Freeze ACCOUNT1

After the freeze is successful, the operation of transferring money to the ACCOUNT2 account in AlphaWallet will return a failure, which proves that the account freeze function is successful. Https://ropsten.etherscan.io/tx/0x2d85e4523dcbc6d2357fe33d5f9efe903b1ec69feaf25ddcf97f885961d244a5

Execute the false option of freezeAccount to unfreeze the ACCOUNT1.

(3) using AlphaWallet to carry out the acceptance test of CLB lock function.

Reference article Block chain 100: token lock after the gradual release of the ERC20 intelligent contract practice to complete the release of the lock contract.

3.1 create a lock smart contract

After the lock contract is compiled successfully, the create lock contract action is performed in remix at 16: 25 on 2018-08-14. Suppose that the lock contract is a token option to encourage Hui GE to participate in the Caibei project.

Revenue account is "0xda5c82f12f5c2ab1ef918afefe089c76103f453c"

Target start time: 16:35 on 2018-08-14; lock freeze operation time: 2 minutes; token option cycle time: 10 minutes; support incentive revocation function

Constructor ("0xda5c82f12f5c2ab1ef918afefe089c76103f453c", "1534235700", "120,600", true)

Smart contract record: https://ropsten.etherscan.io/tx/0x74e3cae0a6872282e396f91899f502e2f85ae54a3ec31d7f53a739383854557a

Address of smart contract: Contract 0xaf9cdde9bbee1b3d26180ce1daeab540df33cf3d

3.2 transfer to Lock Intelligence contract

At 16:30 on 2018-08-14, the company boss typed 20000 CLB into the intelligent contract from ACCOUNT1 account to Lock position under AlphaWallet.

Transactions with successful transfer: https://ropsten.etherscan.io/tx/0x84d6e6f3e4d10607d14fe993bd1afd750db1edc9624261bb781c1799e805fff7

3.3 execution of descendant coins can be released to the target account

At 16: 38 on 2018-08-14, the boss executes a function call to release the option under ACCOUNT1:

Release ("0xe37ffd55b6c135209b6742b7fbe096ae2837fce6")

Execute the screenshot:

Release incentive

Execute successful link: https://ropsten.etherscan.io/tx/0xe9063edca480ea504028e10583178929024954c828107bd1acb49ec8e0955f6f

Check AlphaWallet Hui's account "0xda5c82f12f5c2ab1ef918afefe089c76103f453c" and have received 6400 CLB tokens.

3.3 cancel the token option incentive and return the token to the ACCOUNT1 account

Brother Hui needs to leave the Caibei project team for personal reasons. The boss executes the cancellation token option incentive command function when the ACCOUNT1 account is 16: 40, and reclaims the unallocated tokens to the ACCOUNT1 account.

Revoke ("0xe37ffd55b6c135209b6742b7fbe096ae2837fce6")

Execute the screenshot:

The contract is terminated and the token is returned

Unallocated CLB tokens have been transferred back to the ACCOUNT1 boss account.

The transaction is https://ropsten.etherscan.io/tx/0x16f4567f96a58b3f94699049e89db5b2b2b3d3d334daffa7e5f7e5ad53dd2d31 and 9633.33333333333334 ERC20 (CLB) is returned.

ACCOUNT1 update

3.4 the remaining authorized and unreleased parts are distributed to Brother Hui.

16:42, because of the time difference, we also need to execute the release command to release the rest of the authorized and unreleased parts to Brother Hui.

Release ("0xe37ffd55b6c135209b6742b7fbe096ae2837fce6")

Record of successful execution: https://ropsten.etherscan.io/tx/0x58889376a496221f03b5424e3959ec438ac1973575a2e9aa21005a2ce493e826 3966.666666666666666666 ERC20 (CLB)

AlphaWallet wallet is an excellent wallet. Compared with imToken, it has the following features that fascinate Brother Hui:

1) support ERC875 token function, can transfer tickets, etc.; 2) support ERC721 token function, can transfer non-homogeneous items (not tested yet); 3) support ERC20 token function; 4) Test token and smart contracts in various test environments (Ropsten Test Network)

After reading the above, do you have any further understanding of how to use AlphaWallet wallet to test the functional acceptance of the network? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report