This repository was archived by the owner on Jul 6, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/contract_wrappers/modules/checkpoint Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -512,9 +512,15 @@ export default abstract class DividendCheckpointWrapper extends ModuleWrapper {
512
512
assert . isNonZeroETHAddressHex ( 'token' , token ) ;
513
513
const erc20Detailed = await this . erc20DetailedContract ( token ) ;
514
514
const erc20TokenBalance = await erc20Detailed . balanceOf . callAsync ( callerAddress ) ;
515
- const erc20TokenAllowance = await erc20Detailed . allowance . callAsync ( callerAddress , token ) ;
516
- assert . assert ( erc20TokenAllowance . isGreaterThanOrEqualTo ( amount ) , 'Your allowance is less than dividend amount' ) ;
517
- assert . assert ( erc20TokenBalance . isGreaterThanOrEqualTo ( amount ) , 'Your balance is less than dividend amount' ) ;
515
+ const erc20TokenAllowance = await erc20Detailed . allowance . callAsync ( callerAddress , await this . address ( ) ) ;
516
+ assert . assert (
517
+ erc20TokenAllowance . isGreaterThanOrEqualTo ( amount . absoluteValue ( ) ) ,
518
+ 'Your allowance is less than dividend amount' ,
519
+ ) ;
520
+ assert . assert (
521
+ erc20TokenBalance . isGreaterThanOrEqualTo ( amount . absoluteValue ( ) ) ,
522
+ 'Your balance is less than dividend amount' ,
523
+ ) ;
518
524
} else {
519
525
assert . assert (
520
526
( await this . web3Wrapper . getBalanceInWeiAsync ( callerAddress ) ) . isGreaterThanOrEqualTo ( amount . valueOf ( ) ) ,
You can’t perform that action at this time.
0 commit comments