Deploy function Interface

The Deploy Interface defines a function interface that can execute a Deploy operation.

Input

There are no strict requirements for the input, but it is recommended to use the input format defined in the Deploy operation.

You can also write a function that only takes the tick, max, lim parameters, then calculate the hash of all operations in your contract and inscribe it into the message, although this will consume more gas.

Output

The output of this function should be a message payload, which conform to the following format:

ParamtertypeDescription
Deploy_hashFelt252Hash of Deploy operation
Mint_hashFelt252Hash of Mint operation
Transfer_hashFelt252Hash of Transfer operation
TickFelt252(ShortString)Ticker: A string identifier of the snrc-20
MaxFelt252(u128)Max supply: Max supply of the snrc-20
LimFelt252(u128)Mint limit: Limit per tx for users

These data contain the key elements to restore the complete Deploy inscription, and provide the Hash for Mint and Transfer, which will facilitate indexing.

Here is an example of an message payload(in Hex):

IndexValue
00x206E97BD728106AAE642A8847107EF91922321FF00A4FEB7A99880D4D8BA962
10x33FF744581AA76AFA81006908ADC9A41B68FACB15ECF5E980EF56F9910380DE
20x70B420BAF038B3D467D80FD313B0D2AEDBEB46B7157CED682649D4507292E6A
30x434f4f4c
40x22658
50x22658

Event

After a Deploy function is successfully executed, it should emit an event. This will facilitate the indexer to include this transaction.

The format of the events is as follows:

event Deploy(sender, hash, tick, max, lim)

The parameters are:

InputTypeDescription
senderContractAddressSender's address
hashArray::< Felt252 >[Deploy_hash, Mint_hash, Transfer_hash]
tickFelt252(ShortString)A string identifier of the snrc-20
maxFelt252(u128)Max supply: Max supply of the snrc-20
limFelt252(u128)Mint limit: Limit per tx for users