Rise In Logo

Build on Stellar

Understand the basics of smart contract interaction on the Stellar network by creating a trading offer and simulating a basic trade using the SingleOffer contract.

First Step:

You need to clone this repo, and you will make changes on the lib.rs file that is under the single_offer_to_complete/src folder.

Second step:

You will write some control mechanism after comment blocks like example below on ‘create’, ‘trade’ and ‘updt_price’ functions:

//Add a control here to check 'buy_price' and 'sell_price' are not equal to 0

Third step:

Update the trade function in the provided smart contract to allow trades only after a specific cutoff date.

  • Define the cutoff timestamp in the ‘trade’ function.
  • Block the trade if the current timestamp is not greater than the cutoff timestamp.


Rise In Logo

Rise together in web3