Closed netpoe closed 2 years ago
Tailor the withdraw function of Escrow to allow the account to withdraw the funds only if these conditions are met:
withdraw
Escrow
The expiration_date is lower than now AND The min_deposit is not met
expiration_date
now
min_deposit
If the above conditions are instead:
The expiration_date is lower than now AND the min_deposit is met
Then allow the withdraw function to send the funds to the recipient_account_id: AccountId
recipient_account_id: AccountId
expiration_date, min_deposit and recipient_account_id are values that need to be set upon the contract creation.
recipient_account_id
Note: Write the tests inside the ConditionalEscrow contract.
ConditionalEscrow
Tailor the
withdraw
function ofEscrow
to allow the account to withdraw the funds only if these conditions are met:The
expiration_date
is lower thannow
AND Themin_deposit
is not metIf the above conditions are instead:
The
expiration_date
is lower thannow
AND themin_deposit
is metThen allow the
withdraw
function to send the funds to therecipient_account_id: AccountId
expiration_date
,min_deposit
andrecipient_account_id
are values that need to be set upon the contract creation.Note: Write the tests inside the
ConditionalEscrow
contract.