Uses hardhat toolchain for EVM.
setNft(IERC1155 _nft)- set ERC1155 contract (
_nft) to manage
- set ERC1155 contract (
setPrice(uint256 id, address underlying, uint256 price)- set
pricefor certain ERC1155 token (id), based onunderlyingERC20 token (0 for native token)
- set
buy(uint256 id, uint256 value, bytes memory data, address underlying)- buy amount (
value) of certain ERC1155 token (id) with extra in-game order info (data), with specified (underlying) ERC20 token. This function will,- [Web3 asset action] mint token to end user
- [Web3 game action] transfer token back to manager, on behalf of end user, be sure that the end users shall auth their ERC1155 token to this contract
- [Web3 game action] burn the token and notify game for order completion
- buy amount (
log(string calldata data)- log data on chain and notify mini game server