Skip to content

Commit

Permalink
Merge pull request #490 from yeecai/main
Browse files Browse the repository at this point in the history
feat: update en/40
  • Loading branch information
AmazingAng committed May 1, 2023
2 parents efa3b8c + 6a910a3 commit 625cfa9
Show file tree
Hide file tree
Showing 6 changed files with 769 additions and 730 deletions.
31 changes: 17 additions & 14 deletions Languages/en/40_ERC1155_en/BAYC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,34 @@ pragma solidity ^0.8.4;

import "./ERC1155.sol";

contract BAYC1155 is ERC1155{
uint256 constant MAX_ID = 10000;
// 构造函数
constructor() ERC1155("BAYC1155", "BAYC1155"){
}
contract BAYC1155 is ERC1155 {
uint256 constant MAX_ID = 10000;

// Constructor
constructor() ERC1155("BAYC1155", "BAYC1155") {}

//BAYC的baseURI为ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/
//BAYC's baseURI is ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/
function _baseURI() internal pure override returns (string memory) {
return "ipfs://QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq/";
}
// 铸造函数

// casting function
function mint(address to, uint256 id, uint256 amount) external {
// id 不能超过10,000
// id cannot exceed 10,000
require(id < MAX_ID, "id overflow");
_mint(to, id, amount, "");
}

// 批量铸造函数
function mintBatch(address to, uint256[] memory ids, uint256[] memory amounts) external {
// id 不能超过10,000
// batch casting function
function mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts
) external {
// id cannot exceed 10,000
for (uint256 i = 0; i < ids.length; i++) {
require(ids[i] < MAX_ID, "id overflow");
}
_mintBatch(to, ids, amounts, "");
}

}
}
Loading

0 comments on commit 625cfa9

Please sign in to comment.