Git Product home page Git Product logo

market-contracts's Introduction

market-contracts

拍卖合约

ClockAuction.sol

初始化相关

在合约的构造器中涉及到的参数,其意义分别是:

  1. address _nftAddress: LAND合约地址
  2. address _RING: RING合约地址
  3. address _tokenVendor: ETH和RING相互转换的TokenVendor合约地址
  4. uint256 _cut: 交易手续费,即拍卖完成后不返还给卖家的部分。范围[0, 10000],对应着[0%, 100%]
  5. uint245 _waitingMinutes: 每次竞拍等待的最长时间,填入分钟数

拍卖操作相关

1. 创建拍卖

使用LAND合约中的approveAndCall方法,传入参数为:

  1. _to: 拍卖合约地址
  2. _tokenId: 地块的tokenId
  3. _startingPriceInRING: 起始价格(ring)
  4. _endingPriceInRING: 终止价格(ring),其实价格比终止价格高
  5. _duration: 拍卖持续时间,以秒为单位
  6. _seller: 卖方(或者地块拥有者指定的地块拍卖的受益人)

2. 取消拍卖

使用clockAunction.solcancelAuction方法

注意:只允许此次拍卖的_seller取消,如果_seller不是该地块的拥有者的话,意味着地块拥有者也无法取消此次拍卖

3. 获得拍卖信息

使用clockAunction.solgetAuction方法

4. 获得拍卖的现时价格

使用clockAunction.solgetCurrentPriceInRING方法

5. 使用RING来竞拍地块

发送要竞拍某次拍卖使用的RING的数量,到clockAunction合约中,使用RING.transfer(address(BidAuctionRING),ringAmount,bytes(tokenId))即可

注意:需要把tokenId转换成bytes格式

6. 使用ETH来竞拍地块

使用clockAunction.sol中的bidWithETH方法

提币相关

使用clockAunction.sol中的claimTokens方法

market-contracts's People

Contributors

sekisamu avatar hackfisher avatar

Watchers

James Cloos 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.