Code Monkey home page Code Monkey logo

crowdfunding-smart-contract's Introduction

Example addresses:

AW5C5LZjyr1jBQuZZg3kAmmri6ic32yH2q    b'\x9c\xd87)\x13\xd6\xec\xb2hjWX\x89\x82\x15\xc3\x02\x8f\xc8m'
AaLCDGQMuKdpNCkSVWVLry8MyvaXhbAXGW    b'\xcb\x8f\x12w\xb0e\xdb\xbaR\xe2\xb8\xaat\xfa@P(\xe7k:'

Build & test the contract

neo> build imusc/ico_template.py test 0710 05 True False crowdfunding_create ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX", "AW5C5LZjyr1jBQuZZg3kAmmri6ic32yH2q", "AaLCDGQMuKdpNCkSVWVLry8MyvaXhbAXGW"]
neo> build imusc/ico_template.py test 0710 05 True False crowdfunding_test ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]
neo> build imusc/ico_template.py test 0710 05 True False crowdfunding_numcontrib ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]

# Test rewrd functions
neo> build imusc/ico_template.py test 0710 05 True False level ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]
neo> build imusc/ico_template.py test 0710 05 True False reward_user ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]

Import to the blockchain

import contract imusc/ico_template.avm 0710 05 True False

get hash (eg. 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94)

Deploy

testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 deploy []
testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 circulation []

Mint some tokens

testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 mintTokens [] --attach-neo=1
testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 balanceOf ["AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y"]

Import token to neo-python wallet

import token 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94

CROWDFUNDING

Create a new crowdfunding address (AJWvenTD6n7ya56AuiKS83oj36zCD65aqX) with 2 members:

testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 crowdfunding_create ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX", "AW5C5LZjyr1jBQuZZg3kAmmri6ic32yH2q", "AaLCDGQMuKdpNCkSVWVLry8MyvaXhbAXGW"]

Check balances

testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 balanceOf ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]
testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 balanceOf ["AW5C5LZjyr1jBQuZZg3kAmmri6ic32yH2q"]
testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 balanceOf ["AaLCDGQMuKdpNCkSVWVLry8MyvaXhbAXGW"]

Get crowdfunding total contributions

testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 crowdfunding_total ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]

Get crowdfunding number of contributions

testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 crowdfunding_numcontrib ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]

Test

testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 crowdfunding_test ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]

Send funds to the crowdfunding address

send IMU AJWvenTD6n7ya56AuiKS83oj36zCD65aqX 200 --from-addr=AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y

REWARDS

testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 level ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]
testinvoke 0x08b9f4c2e0110b8eb650f89bbcaaaaa379497a94 reward_user ["AJWvenTD6n7ya56AuiKS83oj36zCD65aqX"]

crowdfunding-smart-contract's People

Contributors

belane avatar canesin avatar localhuman avatar metachris avatar tkrevh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.