This is assignment is designed to help our team evaluate proficiency with the Solana programing model, focusing on the Anchor framework
This involves a building an integrated application, consisting of a frontend (React app) and a Solana program
Estimated time to complete is between 2-3 weeks
- Create base-user and super-user accounts
- Build out
platform
program to spec- Global State (PDA)
pool
fortestToken
(PDA)- Deposit function: user ->
pool
- Withdraw function:
pool
-> user
- Create a second program called
farm-program
farm
(PDA)- Stake function:
pool
->farm
- Harvest function (calls Reward Calculation function):
farm
-> user - Unstake function (calls Harvest function):
farm
->pool
- Reward Calculation function
- This calculates (time elapsed since Staking * rewards per sec)
- Create React app (with Typescript) for UI, with the ability to use all of the functionality described + sign and send transactions
- Create
farm
(this can be done at any step before "Stake" test) - Create global state
- Should fail if base-user tries to call this
- Create token (mint) thru Anchor Typescript, called
testToken
- Super-user creates
pool
- Super-user mints
testToken
topool
- Super-user mints
testToken
to base-user - Base-user deposits
testToken
topool
- Base-user should fail to withdraw more than token amount the base-user deposited to
pool
- Base-user stakes
testToken
frompool
tofarm
via CPI - Base-user harvests rewards (in the form of
testToken
) fromfarm
touser
via CPI - Base-user unstakes
testToken
fromfarm
topool
via CPI, also harvesting rewards - Base-user withdraws
testToken
frompool
- There should be a base-user and a super-user
- Typescript must be used for React app and unit-testing Solana program code
- The tester needs to be able to:
- clone the repo
- run
anchor test
and all tests need to pass - click through each feature without failing
- sign and send transactions without failing
- Clone repo
- Create new branch
- Create the React app in the
app
directory, this must use typescript - Commits should be made often, and they should be small, preferably at each feature addition/update
- Submit PR (
git push
)
-
How could you get the real-world market price of token in the contract?
-
How do you call another contract's function in your contract?
-
How can you get account information in your contract?
-
How do you deposit SOL to your contract?
-
What is difference between devnet & testnet on Solana?