Unlocking Failed Funds

Unlocking Funds

If transfer does not occur within 90 days of the campaign end date, the unlockFailedFunds function may be invoked, which puts the campaign into a failed state and allows contributors to withdraw their funds.

This scenario is unlikely to occur, but is included as a failsafe in case the campaign recipient address is malicious or fails to receive native tokens for any reason.

Any account can unclock funds.

Invoking Transfer

const txn = await campaignContract.unlockFailedFunds();

Preflight Checks

Before invoking unlockFailedFunds, it's best to check that unlocking is allowed.

const txn = await campaignContract.isUnlockAllowed();