Git Product home page Git Product logo

adoption-plant-solidity's Introduction

Solidity API

AuthorizedERC20

UnauthorizedAccess

error UnauthorizedAccess()

ExceedsSupplyLimit

error ExceedsSupplyLimit()

OneTimeAuthorizationDone

error OneTimeAuthorizationDone()

constructor

constructor(string name_, string symbol_) public

mint

function mint(address account, uint256 amount) external

仅允许授权的地址调用 mint 函数

Parameters

Name Type Description
account address account
amount uint256 amount

authorizeOnce

function authorizeOnce(address minter) external

一次性授权地址调用 mint 函数

Parameters

Name Type Description
minter address minter

mintableBalance

function mintableBalance() external view returns (uint256)

查询还可以 mint 的余额

PlantMarketV1

BLAST

contract IBlast BLAST

PlantType

enum PlantType {
  Seed,
  Seedling,
  VegetativeVariation,
  Vegetative,
  Flowering,
  Fruiting
}

Plant

struct Plant {
  uint256 plantId;
  enum PlantMarketV1.PlantType plantType;
  uint256 valueEth;
  uint256 adoptedTimestamp;
  address owner;
  bool isAdopted;
  bool isSplit;
}

AdoptionPriceRange

struct AdoptionPriceRange {
  uint256 minEth;
  uint256 maxEth;
  uint8 startTime;
  uint8 endTime;
  uint8 profitDays;
  uint16 profitRate;
  uint256 rewardAmounts;
}

PlantDTO

struct PlantDTO {
  enum PlantMarketV1.PlantType plantType;
  uint256 minEth;
  uint256 maxEth;
}

plants

mapping(uint256 => struct PlantMarketV1.Plant) plants

priceRanges

mapping(enum PlantMarketV1.PlantType => struct PlantMarketV1.AdoptionPriceRange) priceRanges

PlantAdopted

event PlantAdopted(uint256 plantId, address owner, enum PlantMarketV1.PlantType plantType, uint256 adoptionTime)

PlantCreated

event PlantCreated(uint256 plantId, address seller, uint256 price)

PlantListed

event PlantListed(uint256 plantId, address seller, uint256 price)

PlantSold

event PlantSold(uint256 plantId, address buyer, address seller, uint256 price)

PlantIDOverflow

error PlantIDOverflow()

TransferFailed

error TransferFailed()

PlantAlreadyAdopted

error PlantAlreadyAdopted()

PlantAlreadySplit

error PlantAlreadySplit()

InvalidAdoptionPrice

error InvalidAdoptionPrice()

NotAdoptionTime

error NotAdoptionTime()

InvalidPlantID

error InvalidPlantID()

NotOwner

error NotOwner()

PlantNotAdopted

error PlantNotAdopted()

PlantAdoptedError

error PlantAdoptedError()

NotReachingContractTerm

error NotReachingContractTerm()

InvalidPlantType

error InvalidPlantType()

InsufficientTokens

error InsufficientTokens()

OnlyScheduleAdoptionOncePerDay

error OnlyScheduleAdoptionOncePerDay()

NoBalance

error NoBalance()

constructor

constructor(address tokenContractAddress, address _pointsOperator) public

scheduleAdoption

function scheduleAdoption(enum PlantMarketV1.PlantType plantType) external

预约

Parameters

Name Type Description
plantType enum PlantMarketV1.PlantType PlantType

createPlant

function createPlant(struct PlantMarketV1.PlantDTO newPlantDTO, address _owner) public

adoptPlant

function adoptPlant(uint256 _plantId) external payable

_isAdoptionTimeValid

function _isAdoptionTimeValid(enum PlantMarketV1.PlantType plantType) internal view returns (bool)

list

function list(uint256 plantId) public

getLastPlantId

function getLastPlantId() external view returns (uint256)

getPlantInfoById

function getPlantInfoById(uint256 _plantId) public view returns (uint256 plantId, enum PlantMarketV1.PlantType plantType, uint256 valueEth, uint256 adoptedTimestamp, address owner, bool isAdopted, bool isSplit)

getUserAdoptionRecordPlantIds

function getUserAdoptionRecordPlantIds(address _user) public view returns (uint256[])

获取用户曾经拥有的植物ID

Parameters

Name Type Description
_user address 拥有者

getUserAdoptedCurrentPlants

function getUserAdoptedCurrentPlants(address _user, bool includeSplit) external view returns (struct PlantMarketV1.Plant[])

获取用户当前领养的植物

Parameters

Name Type Description
_user address owner
includeSplit bool 是否分裂

getMarketListings

function getMarketListings() external view returns (struct PlantMarketV1.Plant[])

claimMyContractsGas

function claimMyContractsGas() external

receive

receive() external payable

withdraw

function withdraw() external

IBlast

configureClaimableGas

function configureClaimableGas() external

claimAllGas

function claimAllGas(address contractAddress, address recipient) external returns (uint256)

IBlastPoints

configurePointsOperator

function configurePointsOperator(address operator) external

adoption-plant-solidity's People

Contributors

sharebravery avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.