November 29th Challenge
Cross-contract calling challenge
A cross-contract call is when one smart contract calls another. You can find out more about NEAR cross-contract calls here.
What to do:
Write a smart contract (A) that calls another contract (B). Use any language you'd like.
Contract A should use data returned from Contract B
You can implement this however you like. Some examples:
- Contract A allows a user to log in, then calls Contract B to see how much NEAR they have in their wallet. Contract A returns 'Wow!' if there is more than 10 NEAR or 'Uh oh' if it is below 10 NEAR.'
- Contract A allows a user to log in, then calls Contract B which is a voting contract that returns if the user has already voted. Contract A tells the user if they have voted or not.
- Contract A allows the user to log in and pass another user's wallet. Contract A calls Contract B to see how much NEAR is in that wallet, and returns this to Contract A. Contract A sends NEAR from the user to this wallet if there is under 10 NEAR, else is returns "This wallet does not need more NEAR."
Deploy them on testnet.
How to win
- Deploy both smart contracts on testnet
- Share the command(s) in the thread on the Discord channel #challenge-9-cross-contract so we can test your contract
- Everyone who completes the challenge gets 500 points
- The three most creative solutions get 700 points
- The 3 most helpful in the Discord gets 300 points
- Combo Bonus: +40 points for each challenge you complete in a row