内建函数

Support Functions are inbuilt functions which provide some functionality or expose internals for speed and technical reasons.

LOAD(variable)

从数据库加载变量所对应的值。

LOAD loads a variable which was previously stored in the blockchain using STORE function. Return type will be Uint64/String depending on what is stored.

It will panic if the value does NOT exists

Uint64 EXISTS(variable)

数据库里变量所对应的值是否存在?

EXISTS return 1 if the variable is store in DB and 0 otherwise

STORE(key variable, value variable)

向数据库存储数据。

STORE stores key and value in the DB. All storage state of the SC is accessible only from the SC which created it.

Uint64 RANDOM()

随机函数。

Uint64 RANDOM(limit Uin64)

随机函数。

RANDOM returns a random using a PRNG seeded on BLID,SCID,TXID. First form gives a uint64, second form returns

random number in the range 0 - (limit), 0 is inclusive, limit is exclusive

String SCID()

智能合约唯一ID.

Returns SMART CONTRACT ID which is currently running

String BLID()

智能合约所在的区块ID.

Returns current BLOCK ID which contains current execution-in-progress TXID

String TXID()

智能合约所在的交易ID.

Returns current TXID which is execution-in-progress.

Uint64 BLOCK_HEIGHT()

智能合约所在的区块所对应的高度。

Returns current chain height of BLID()

Uint64 BLOCK_TOPOHEIGHT()

智能合约所在的区块所对应的拓扑高度。

Returns current topoheight of BLID()

String SIGNER()

本合约发行者的地址。

Returns address of who signed this transaction

Uint64 IS_ADDRESS_VALID(p String)

检查所给字符串是否为正确地址。

Returns 1 is address is valid, 0 otherwise

String ADDRESS_RAW(p String)

创建一个地址,以字节格式返回。

Returns address in RAW form as 64 byte keys, stripping away textual/presentation form. 2 address should always be compared in RAW form

SEND_DERO_TO_ADDRESS(a String, amount Uint64)

给某地址发送货币。

Sends amount DERO from SC DERO balance to a address. address must in string form DERO/DETO form

If the SC does not have enough balance, it will panic

results matching ""

    No results matching ""