GithubHelp home page GithubHelp logo

saturn-presale's Introduction

Saturn Strategic presale smart contract

A thoroughly tested smart contract used to conduct discounted presales with a lockup period.

Having a time lockup ensures two things:

  1. Investors will not participate in a presale with the sole purpose of dumping their tokens on the market, exploiting the early bonus advantage.
  2. Investors that do participate have an aligned vision and are comfortable supporting the project long term.

Events

// called when presale is activated
event Activated(uint256 time);
// called when presale is stopped
event Finished(uint256 time);
// called when somebody makes a purchase. can use to show purchase history
event Purchase(address indexed purchaser, uint256 id, uint256 amount, uint256 purchasedAt, uint256 redeemAt);
// called when somebody withdraws their SATURN
event Claim(address indexed purchaser, uint256 id, uint256 amount);

Useful methods

presale = contract(abi); // load the contract interface in web3.js

// buy tokens
presale.buyShort({value: purchase_amount_in_wei})
// presale.buyMedium({value: purchase_amount_in_wei})
// presale.buyLong({value: purchase_amount_in_wei})
// emits purchase event, updates lockup and balance
// this event reports the purchaseId

presale.lockupOf(id) // check when they can withdraw. returns a UNIX timestamp
presale.amountOf(id) // check how much SATURN in a purchase
presale.redeem(id) // When lockup period ends, calling this function will withdraw tokens to your wallet

saturn-presale's People

Contributors

rados-io 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.