Examples
We will help you better understand the working principle of brc-202 through the following examples. Besides, you must be aware that brc-202 is an experimental standard, and use it at your own risk.
Regular Examples
As the initiator, you need to deploy in the following steps to launch an IDO
Step 1: The initiator fills the necessary information into the DeployToken function, and transfers the tokens used for the IDO to the specified address at one time.
Since you have not set other receiving addresses, the default receiving address is the calling address
At this time, the calling address will have 21,000,000 "ordi"
User
Initial Balance
Final Balance
IDO Initiator
0
21,000,000
Step 2: Launch an IDO, fill the necessary information into the DeployIDO function, such as: IDO price, maximum amount for a single subscription, the end time of the IDO, etc.
“price” is the single purchase price of the IDO, which is 0.000001BTC at this time
“max” is the number of single purchases, which is 10,000 "ordi" at this time
“totalToken” is the maximum supply of this IDO
Check that the token balance of the receiving address in the DeployToken function is greater than totalToken
totalToken will be recorded to the notary address, which is equivalent to giving the inscription to the notary address
“notary” is the notary address, used to accept the IDO amount, it is recommended to use a multi-signature wallet, or a platform-managed address
The notary address is the unique identifier of this IDO, and each notary address can only be used once
As a subscriber, you need to complete the following operation steps to participate in the IDO.
After the deployment work of the IDO initiator is completed, the subscriber fills the necessary information into the DeclareIDO function to participate in the IDO
“amt” is the number of IDO subscriptions
Require the BTC amount transferred out when calling this method to be consistent with the totalBTC amount, and the BTC receiving address is the notary's receiving address
It will not be possible to apply after the end block 840,000
After the IDO ends, the notary needs to complete the following operation steps to distribute the IDO share to the subscribers in turn.
The ApproveIDO function is triggered by the notary address. If the content of approveIDO is consistent with the content of DeclareIDO, and BTC is received, it is almost equivalent to transferring coins to the declare address.
IDO Subscriber
0
100,000
We have provided a convenient BatchTransfer function, which can batch transfer the IDO tokens to all addresses that have successfully participated in the subscription. This function is triggered by the notary address
The notary address calls this method to destroy the remaining tokens after the IDO ends, of course, you can choose not to use this function.
Last updated