Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
asselstine committed Oct 14, 2021
1 parent 335dc47 commit b4d0b5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/prize-pool/YieldSourcePrizePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ contract YieldSourcePrizePool is PrizePool {
/// @param _externalToken The address of the token to check
/// @return True if the token may be awarded, false otherwise
function _canAwardExternal(address _externalToken) internal view override returns (bool) {
IYieldSource _yieldSource = yieldSource;
return (
_externalToken != address(yieldSource) &&
_externalToken != yieldSource.depositToken()
_externalToken != address(_yieldSource) &&
_externalToken != _yieldSource.depositToken()
);
}

Expand Down
4 changes: 4 additions & 0 deletions test/prize-pool/YieldSourcePrizePool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ describe('YieldSourcePrizePool', function () {
it('should not allow the prize pool to award its token, as its likely the receipt', async () => {
expect(await prizePool.canAwardExternal(yieldSource.address)).to.equal(false);
});

it('should not allow the prize pool to award the deposit token', async () => {
expect(await prizePool.canAwardExternal(depositToken.address)).to.equal(false);
})
});

describe('sweep()', () => {
Expand Down

0 comments on commit b4d0b5b

Please sign in to comment.