Skip to content

@stdlib/content

提供将链下链接从String编码为Cell的函数。

要使用此库,请导入@stdlib/content

solidity
import "@stdlib/content";

函数

createOffchainContent

solidity
fun createOffchainContent(link: String): Cell;

将链下linkString编码为Cell

源代码:

solidity
fun createOffchainContent(link: String): Cell {
    let builder: StringBuilder = beginStringFromBuilder(beginCell().storeUint(0x01, 8));
    builder.append(link);
    return builder.toCell();
}

源代码