IBOX系统核心功能如下:
一、藏品上链
数字藏品简单上链,一键快速发行;
二、藏品分销
有强大推广分销功能,用户变成推销者;
三、多端合一
H5端 小程序端,一套系统自由生成;
四、链上赠予
支持藏品赠予功能,完善用户体验;
五、接口开放
可接入原有APP,小程序等。
以下是iobx系统里藏品单位合成的核心源码
from IBOX import IBOX_ART
import json#
#
# contract address is0x0632aDCab8F12edD3b06F99Dc6078FE1FEDD32B0 from web3 import Web3
my_provider = Web3.HTTPProvider('')
w3 = Web3(my_provider)def main():contract_address = '0x0632aDCab8F12edD3b06F99Dc6078FE1FEDD32B0'contract_abi = json.load(open('surge.abi', 'r'))# print(contract_abi)mycontract = act(address=contract_address, abi=contract_abi)name = mycontract.functions.name().call()print(name)symbol = mycontract.functions.symbol().call()print(symbol)tokenURI = kenURI(1802).call()print(tokenURI)passif __name__ == '__main__':main()
使用merkle tree
/// @notice Presale minting verifies callers address is in Merkle Root
/// @param _amountOfTokens Amount of tokens to mint
/// @param _merkleProof Hash of the callers address used to verify the location of that address in the Merkle Root
function presaleMint(uint256 _amountOfTokens, bytes32[] calldata _merkleProof)externalpayableverifyMaxPerUser(msg.sender, _amountOfTokens)verifyMaxSupply(_amountOfTokens)isEnoughEth(_amountOfTokens)
{require(status == SaleStatus.Presale, "Presale not active");bytes32 leaf = dePacked(msg.sender));require(MerkleProof.verify(_merkleProof, merkleRoot, leaf), "Not in presale list");_mintedAmount[msg.sender] += _amountOfTokens;_safeMint(msg.sender, _amountOfTokens);
}
设置merkle root
/// @notice Set Presale Merkle Root
/// @param _merkleRoot Merkle Root hash
function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner {merkleRoot = _merkleRoot;
}
本文发布于:2024-02-04 19:14:01,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170714487458675.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |