error UnauthorizedAccess()
error ExceedsSupplyLimit()
error OneTimeAuthorizationDone()
constructor(string name_, string symbol_) public
function mint(address account, uint256 amount) external
仅允许授权的地址调用 mint 函数
Name | Type | Description |
---|---|---|
account | address | account |
amount | uint256 | amount |
function authorizeOnce(address minter) external
一次性授权地址调用 mint 函数
Name | Type | Description |
---|---|---|
minter | address | minter |
function mintableBalance() external view returns (uint256)
查询还可以 mint 的余额
contract IBlast BLAST
enum PlantType {
Seed,
Seedling,
VegetativeVariation,
Vegetative,
Flowering,
Fruiting
}
struct Plant {
uint256 plantId;
enum PlantMarketV1.PlantType plantType;
uint256 valueEth;
uint256 adoptedTimestamp;
address owner;
bool isAdopted;
bool isSplit;
}
struct AdoptionPriceRange {
uint256 minEth;
uint256 maxEth;
uint8 startTime;
uint8 endTime;
uint8 profitDays;
uint16 profitRate;
uint256 rewardAmounts;
}
struct PlantDTO {
enum PlantMarketV1.PlantType plantType;
uint256 minEth;
uint256 maxEth;
}
mapping(uint256 => struct PlantMarketV1.Plant) plants
mapping(enum PlantMarketV1.PlantType => struct PlantMarketV1.AdoptionPriceRange) priceRanges
event PlantAdopted(uint256 plantId, address owner, enum PlantMarketV1.PlantType plantType, uint256 adoptionTime)
event PlantCreated(uint256 plantId, address seller, uint256 price)
event PlantListed(uint256 plantId, address seller, uint256 price)
event PlantSold(uint256 plantId, address buyer, address seller, uint256 price)
error PlantIDOverflow()
error TransferFailed()
error PlantAlreadyAdopted()
error PlantAlreadySplit()
error InvalidAdoptionPrice()
error NotAdoptionTime()
error InvalidPlantID()
error NotOwner()
error PlantNotAdopted()
error PlantAdoptedError()
error NotReachingContractTerm()
error InvalidPlantType()
error InsufficientTokens()
error OnlyScheduleAdoptionOncePerDay()
error NoBalance()
constructor(address tokenContractAddress, address _pointsOperator) public
function scheduleAdoption(enum PlantMarketV1.PlantType plantType) external
预约
Name | Type | Description |
---|---|---|
plantType | enum PlantMarketV1.PlantType | PlantType |
function createPlant(struct PlantMarketV1.PlantDTO newPlantDTO, address _owner) public
function adoptPlant(uint256 _plantId) external payable
function _isAdoptionTimeValid(enum PlantMarketV1.PlantType plantType) internal view returns (bool)
function list(uint256 plantId) public
function getLastPlantId() external view returns (uint256)
function getPlantInfoById(uint256 _plantId) public view returns (uint256 plantId, enum PlantMarketV1.PlantType plantType, uint256 valueEth, uint256 adoptedTimestamp, address owner, bool isAdopted, bool isSplit)
function getUserAdoptionRecordPlantIds(address _user) public view returns (uint256[])
获取用户曾经拥有的植物ID
Name | Type | Description |
---|---|---|
_user | address | 拥有者 |
function getUserAdoptedCurrentPlants(address _user, bool includeSplit) external view returns (struct PlantMarketV1.Plant[])
获取用户当前领养的植物
Name | Type | Description |
---|---|---|
_user | address | owner |
includeSplit | bool | 是否分裂 |
function getMarketListings() external view returns (struct PlantMarketV1.Plant[])
function claimMyContractsGas() external
receive() external payable
function withdraw() external
function configureClaimableGas() external
function claimAllGas(address contractAddress, address recipient) external returns (uint256)
function configurePointsOperator(address operator) external