This smart contract was created on Rust 4MyFuture DApp is a crowdfunding application made for students, in which they will have the oportunity to request fund to the NEAR Ecosystem Community, explaining why they need the funds, uploading images, descriptions and much more 😎
Before you compile this code, you will need to install Rust with correct target
For compile the code just run the following script:
sh scripts/build.sh
It will generate the .wasm file and will deploy it on testnet
The main smart contract code lives in src
folder.
Here you will find five .rs files:
- Enumeration --> Here you will find all the contract query methods
- Internal --> File created for manage internal complex methods that are called for the main methods
- Lib --> Main file that initialize the contract and all persistent storage collections
- Metadata --> Here all the main contract structures live
- Proposal --> The main functions folder
- Frontend here
- Graph here
- Query the Graph here
- Graph implementation Repo here
- DAO for test upgrade contract here
-
create-proposal <--- Method for create proposal and receive funds
near call ${CONTRACT-NAME} create_proposal '{"title":"test", "description": "test", "finish_date": 123321332342345, "images":["link1.affd.com", "link2.aaa.com"], "goal":"3", "institution_link":"www.unimet.com", "pensum_link":"www.unimet.com/ingenieria-sistemas"}' --account-id ${YOUR-ACCOUNT.testnet}
-
contribute <--- Method for fund a proposal
near call ${CONTRACT-NAME} contribute '{"proposal_id":"1"}' --account-id ${YOUR-ACCOUNT.testnet} --deposit 0.1
-
proposals <--- Get all proposals registered
near call ${CONTRACT-NAME} proposals
-
proposals_by_id <--- Get a range of proposals registered
near view ${CONTRACT-NAME} proposals_by_id '{"from_index":"0" , "limit":1}'
-
proposal_by_id <--- Get a specified proposal by id
near view ${CONTRACT-NAME} proposal_by_id '{"proposal_id":"1}'
-
proposal_by_owner <--- Get the proposal created by an user
near view ${CONTRACT_NAME} proposal_by_owner '{"owner_id": "4my2.lexdev.testnet"}'
-
contributions <--- Get all contributions registered
near call ${CONTRACT-NAME} contributions
-
contributions_by_id <--- Get a range of contributions
near view ${CONTRACT-NAME} contributions_by_id '{"from_index":"0" , "limit":1}'
-
contribution_by_id <--- Get a specified contribution by id
near view ${CONTRACT-NAME} contribution_by_id '{"contribution_id":"1}'
-
contribution_for_user <--- Get the contributions made for an user
near view ${CONTRACT-NAME} contributions_for_user '{"account_id":"lexdev.testnet", "from_index":"0" , "limit":10}'
CONTRACT_NAME example dev-1653178134167-92125643978356