Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
[
{
"name": "encodeFields",
"category": "Contract",
"signature": "fn .encodeFields!(...) -> (ByteVec, ByteVec)",
"doc": "Encode the fields for creating a contract",
"params": [
"@param ... the fields of the to-be-created target contract"
],
"returns": "@returns two ByteVecs: the first one is the encoded immutable fields, and the second one is the encoded mutable fields"
},
{
"name": "createContract",
"category": "Contract",
"signature": "fn createContract!(bytecode:ByteVec, encodedImmFields:ByteVec, encodedMutFields:ByteVec) -> (ByteVec)",
"doc": "Creates a new contract without token issuance.",
"params": [
"@param bytecode the bytecode of the contract to be created",
"@param encodedImmFields the encoded immutable fields as a ByteVec",
"@param encodedMutFields the encoded mutable fields as a ByteVec"
],
"returns": "@returns the id of the created contract"
},
{
"name": "createContractWithToken",
"category": "Contract",
"signature": "fn createContractWithToken!(bytecode:ByteVec, encodedImmFields:ByteVec, encodedMutFields:ByteVec, issueTokenAmount:U256, issueTo?:Address) -> (ByteVec)",
"doc": "Creates a new contract with token issuance.",
"params": [
"@param bytecode the bytecode of the contract to be created",
"@param encodedImmFields the encoded immutable fields as a ByteVec",
"@param encodedMutFields the encoded mutable fields as a ByteVec",
"@param issueTokenAmount the amount of token to be issued",
"@param issueTo (optional) a designated address to receive issued token"
],
"returns": "@returns the id of the created contract"
},
{
"name": "copyCreateContract",
"category": "Contract",
"signature": "fn copyCreateContract!(contractId:ByteVec, encodedImmFields:ByteVec, encodedMutFields:ByteVec) -> (ByteVec)",
"doc": "Creates a new contract without token issuance by copying another contract's code. This costs less gas than createContract!(...).",
"params": [
"@param contractId the id of the contract to be copied",
"@param encodedImmFields the encoded immutable fields as a ByteVec",
"@param encodedMutFields the encoded mutable fields as a ByteVec"
],
"returns": "@returns the id of the created contract"
},
{
"name": "copyCreateContractWithToken",
"category": "Contract",
"signature": "fn copyCreateContractWithToken!(contractId:ByteVec, encodedImmFields:ByteVec, encodedMutFields:ByteVec, issueTokenAmount:U256, issueTo?:Address) -> (ByteVec)",
"doc": "Creates a new contract with token issuance by copying another contract's code. This costs less gas than createContractWithToken!(...).",
"params": [
"@param contractId the id of the contract to be copied",
"@param encodedImmFields the encoded immutable fields as a ByteVec",
"@param encodedMutFields the encoded mutable fields as a ByteVec",
"@param issueTokenAmount the amount of token to be issued",
"@param issueTo (optional) a designated address to receive issued token"
],
"returns": "@returns the id of the created contract"
},
{
"name": "selfAddress",
"category": "Contract",
"signature": "fn selfAddress!() -> (Address)",
"doc": "Returns the address of the contract.",
"params": [],
"returns": "@returns the address of the contract"
},
{
"name": "selfContractId",
"category": "Contract",
"signature": "fn selfContractId!() -> (ByteVec)",
"doc": "Returns the id (ByteVec) of the contract.",
"params": [],
"returns": "@returns the id (ByteVec) of the contract"
},
{
"name": "selfTokenId",
"category": "Contract",
"signature": "fn selfTokenId!() -> (ByteVec)",
"doc": "Returns the token id (ByteVec) of the contract.",
"params": [],
"returns": "@returns the token id (ByteVec) of the contract"
},
{
"name": "tokenId",
"category": "Contract",
"signature": "fn tokenId!(contract:) -> (ByteVec)",
"doc": "Returns the id of the contract",
"params": [
"@param contract the contract variable"
],
"returns": "@returns the id of the contract"
},
{
"name": "contractId",
"category": "Contract",
"signature": "fn contractId!(contract:) -> (ByteVec)",
"doc": "Returns the id of the contract",
"params": [
"@param contract the contract variable"
],
"returns": "@returns the id of the contract"
},
{
"name": "contractAddress",
"category": "Contract",
"signature": "fn contractAddress!(contract:) -> (Address)",
"doc": "Returns the address of the contract",
"params": [
"@param contract the contract variable"
],
"returns": "@returns the address of the contract"
},
{
"name": "callerContractId",
"category": "Contract",
"signature": "fn callerContractId!() -> (ByteVec)",
"doc": "Returns the contract id of the caller.",
"params": [],
"returns": "@returns the contract id of the caller"
},
{
"name": "callerAddress",
"category": "Contract",
"signature": "fn callerAddress!() -> (Address)",
"doc": "
When used in a TxScript, returns the transaction caller, which is the first input address when all input addresses are the same. If not all input addresses are the same, `callAddress!()` function fails.
When used in a contract function called directly from TxScript, returns the transaction caller as explained in 1)
When used in a contract function called from another contract, returns the address of the calling contract.
",
"params": [],
"returns": "@returns the address of the caller"
},
{
"name": "contractInitialStateHash",
"category": "Contract",
"signature": "fn contractInitialStateHash!(contractId:ByteVec) -> (ByteVec)",
"doc": "Returns the initial state hash of the contract.",
"params": [
"@param contractId the id of the input contract"
],
"returns": "@returns the initial state hash of the contract"
},
{
"name": "contractCodeHash",
"category": "Contract",
"signature": "fn contractCodeHash!(contractId:ByteVec) -> (ByteVec)",
"doc": "Returns the contract code hash of the contract.",
"params": [
"@param contractId the id of the input contract"
],
"returns": "@returns the contract code hash of the contract"
},
{
"name": "callerInitialStateHash",
"category": "Contract",
"signature": "fn callerInitialStateHash!() -> (ByteVec)",
"doc": "Returns the initial state hash of the caller contract.",
"params": [],
"returns": "@returns the initial state hash of the caller contract"
},
{
"name": "callerCodeHash",
"category": "Contract",
"signature": "fn callerCodeHash!() -> (ByteVec)",
"doc": "Returns the contract code hash of the caller contract.",
"params": [],
"returns": "@returns the contract code hash of the caller contract"
},
{
"name": "contractExists",
"category": "Contract",
"signature": "fn contractExists!(contractId:ByteVec) -> (Bool)",
"doc": "Checks whether the contract exists with the given id.",
"params": [
"@param contractId the input contract id to be tested"
],
"returns": "@returns ture if the contract exists on the chain, false otherwise"
},
{
"name": "destroySelf",
"category": "Contract",
"signature": "fn destroySelf!(refundAddress:Address) -> ()",
"doc": "Destroys the contract and transfer the remaining assets to a designated address.",
"params": [
"@param refundAddress the address to receive the remaining assets in the contract"
],
"returns": "@returns "
},
{
"name": "migrate",
"category": "Contract",
"signature": "fn migrate!(newBytecode:ByteVec) -> ()",
"doc": "Migrates the code of the contract.",
"params": [
"@param newBytecode the new bytecode for the contract to migrate to"
],
"returns": "@returns "
},
{
"name": "migrateWithFields",
"category": "Contract",
"signature": "fn migrateWithFields!(newBytecode:ByteVec, newEncodedImmFields:ByteVec, newEncodedMutFields:ByteVec) -> ()",
"doc": "Migrates both the code and the fields of the contract.",
"params": [
"@param newBytecode the bytecode for the contract to migrate to",
"@param newEncodedImmFields the encoded immutable fields for the contract to migrate to",
"@param newEncodedMutFields the encoded mutable fields for the contract to migrate to"
],
"returns": "@returns "
},
{
"name": "isCalledFromTxScript",
"category": "Contract",
"signature": "fn isCalledFromTxScript!() -> (Bool)",
"doc": "Checks whether the function is called by a TxScript.",
"params": [],
"returns": "@returns true if the function is called by a TxScript, false otherwise"
},
{
"name": "selfContract",
"category": "Contract",
"signature": "fn selfContract!() -> ()",
"doc": "Returns self contract",
"params": [],
"returns": "@returns self contract"
},
{
"name": "createSubContract",
"category": "SubContract",
"signature": "fn createSubContract!(subContractPath:ByteVec, bytecode:ByteVec, encodedImmFields:ByteVec, encodedMutFields:ByteVec) -> (ByteVec)",
"doc": "Creates a new sub-contract without token issuance.",
"params": [
"@param subContractPath the path of the sub-contract to be created",
"@param bytecode the bytecode of the sub-contract to be created",
"@param encodedImmFields the encoded immutable fields as a ByteVec",
"@param encodedMutFields the encoded mutable fields as a ByteVec"
],
"returns": "@returns the id of the created contract"
},
{
"name": "createSubContractWithToken",
"category": "SubContract",
"signature": "fn createSubContractWithToken!(subContractPath:ByteVec, bytecode:ByteVec, encodedImmFields:ByteVec, encodedMutFields:ByteVec, issueTokenAmount:U256, issueTo?:Address) -> (ByteVec)",
"doc": "Creates a new sub-contract with token issuance.",
"params": [
"@param subContractPath the path of the sub-contract to be created",
"@param bytecode the bytecode of the sub-contract to be created",
"@param encodedImmFields the encoded immutable fields as a ByteVec",
"@param encodedMutFields the encoded mutable fields as a ByteVec",
"@param issueTokenAmount the amount of token to be issued",
"@param issueTo (optional) a designated address to receive issued token"
],
"returns": "@returns the id of the created contract"
},
{
"name": "copyCreateSubContract",
"category": "SubContract",
"signature": "fn copyCreateSubContract!(subContractPath:ByteVec, contractId:ByteVec, encodedImmFields:ByteVec, encodedMutFields:ByteVec) -> (ByteVec)",
"doc": "Creates a new sub-contract without token issuance by copying another contract's code. This costs less gas than createSubContract!(...).",
"params": [
"@param subContractPath the path of the sub-contract to be created",
"@param contractId the id of the contract to be copied",
"@param encodedImmFields the encoded immutable fields as a ByteVec",
"@param encodedMutFields the encoded mutable fields as a ByteVec"
],
"returns": "@returns the id of the created contract"
},
{
"name": "copyCreateSubContractWithToken",
"category": "SubContract",
"signature": "fn copyCreateSubContractWithToken!(subContractPath:ByteVec, contractId:ByteVec, encodedImmFields:ByteVec, encodedMutFields:ByteVec, issueTokenAmount:U256, issueTo?:Address) -> (ByteVec)",
"doc": "Creates a new sub-contract with token issuance by copying another contract's code. This costs less gas than createSubContractWithToken!(...).",
"params": [
"@param subContractPath the path of the sub-contract to be created",
"@param contractId the id of the contract to be copied",
"@param encodedImmFields the encoded immutable fields as a ByteVec",
"@param encodedMutFields the encoded mutable fields as a ByteVec",
"@param issueTokenAmount the amount of token to be issued",
"@param issueTo (optional) a designated address to receive issued token"
],
"returns": "@returns the id of the created contract"
},
{
"name": "subContractId",
"category": "SubContract",
"signature": "fn subContractId!(subContractPath:ByteVec) -> (ByteVec)",
"doc": "Returns the id of the sub contract.",
"params": [
"@param subContractPath the path of the sub-contract"
],
"returns": "@returns the id of the sub contract"
},
{
"name": "subContractIdOf",
"category": "SubContract",
"signature": "fn subContractIdOf!(contract:, subContractPath:ByteVec) -> (ByteVec)",
"doc": "Returns the id of the sub contract.",
"params": [
"@param contract the parent contract of the sub-contract",
"@param subContractPath the path of the sub-contract"
],
"returns": "@returns the id of the sub contract"
},
{
"name": "subContractIdInParentGroup",
"category": "SubContract",
"signature": "fn subContractIdInParentGroup!(contract:, subContractPath:ByteVec) -> (ByteVec)",
"doc": "Returns the id of the sub contract.",
"params": [
"@param contract the parent contract of the sub-contract",
"@param subContractPath the path of the sub-contract"
],
"returns": "@returns the id of the sub contract"
},
{
"name": "map.insert",
"category": "Map",
"signature": "fn