File tree Expand file tree Collapse file tree
cadence/contracts/interfaces Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -294,16 +294,17 @@ access(all) contract DeFiActions {
294294 /// graceful fallback on unexpected conditions, executing no-ops or returning an empty Vault instead of reverting.
295295 ///
296296 access (all ) struct interface Source : IdentifiableStruct {
297- /// Returns the Vault type provided by this Source
297+ /// Returns the Vault type the Source claims to offer.
298+ /// CAUTION: Untrusted Source implementations may return a different Vault type than claimed in `withdrawAvailable`.
299+ /// Users MUST validate the type of all withdrawn funds.
298300 access (all ) view fun getSourceType (): Type
299- /// Returns an estimate of how much of the associated Vault Type can be provided by this Source
301+ /// Returns an estimate of how much of the associated Vault Type can be provided by this Source.
300302 access (all ) fun minimumAvailable (): UFix64
301- /// Withdraws the lesser of maxAmount or minimumAvailable(). If none is available, an empty Vault should be
302- /// returned
303+ /// Withdraws the lesser of maxAmount or minimumAvailable(). If none is available, an empty Vault should be returned.
304+ /// CAUTION: Untrusted Source implementations may return a different Vault type than claimed in `getSourceType`.
305+ /// Users MUST validate the type of all withdrawn funds.
303306 access (FungibleToken.Withdraw ) fun withdrawAvailable (maxAmount : UFix64 ): @{FungibleToken .Vault } {
304307 post {
305- result .getType () == self .getSourceType ():
306- " Invalid vault provided for withdraw - \( result .getType ().identifier ) is not \( self .getSourceType ().identifier ) "
307308 DeFiActions .emitWithdrawn (
308309 type : result .getType ().identifier ,
309310 amount : result .balance ,
You can’t perform that action at this time.
0 commit comments