- 
                Notifications
    You must be signed in to change notification settings 
- Fork 6
[VEN-3338] SingleTokenConverter whitelisted assets #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/VEN-3277
Are you sure you want to change the base?
Conversation
…em to destination. Moved poolsAssetsDirectTransfer mapping to AbstractTokenConverter. Used inherited poolsAssetsDirectTransfer mapping in RiskFundConverter. Modified SingleTokenConverter so whitelisted assets would be directly transfered to the destination address.
| expect(await whitelistedTokenIn.balanceOf(xvsVaultTreasury.address)).to.equal(whitelistedTokenAmount); | ||
| }); | ||
|  | ||
| it("Revert on when trying to set to a differnet address than xvsVaultTreasury", async () => { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| it("Revert on when trying to set to a differnet address than xvsVaultTreasury", async () => { | |
| it("Revert on when trying to set to a different address than xvsVaultTreasury", async () => { | 
| unchecked { | ||
| balanceDifference = currentBalance - assetReserve; | ||
| } | ||
|  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| it("Should revert on zero address", async () => { | ||
| await expect(converter.setBaseAsset(ethers.constants.AddressZero)).to.be.revertedWithCustomError( | ||
| converter, | ||
| "ZeroAddressNotAllowed", | ||
| ); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate, there’s already a test written for it here.
| it("Should succeed on updating existing base asset", async () => { | ||
| await converter.setBaseAsset(tokenIn.address); | ||
| expect(await converter.baseAsset()).to.equal(tokenIn.address); | ||
|  | ||
| const tx = await converter.setBaseAsset(tokenOut.address); | ||
| expect(tx).to.emit(converter, "BaseAssetUpdated").withArgs(tokenIn.address, tokenOut.address); | ||
|  | ||
| expect(await converter.baseAsset()).to.equal(tokenOut.address); | ||
| }); | ||
|  | ||
| it("Should succeed on setting same base asset multiple times", async () => { | ||
| await converter.setBaseAsset(tokenIn.address); | ||
| expect(await converter.baseAsset()).to.equal(tokenIn.address); | ||
|  | ||
| const tx = await converter.setBaseAsset(tokenIn.address); | ||
| expect(tx).to.emit(converter, "BaseAssetUpdated").withArgs(tokenIn.address, tokenIn.address); | ||
|  | ||
| expect(await converter.baseAsset()).to.equal(tokenIn.address); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should revert if we update same base asset again. Please encorporate change here
| LGTM | 
2c52398    to
    868c4dc      
    Compare
  
    [VPD-74] Etherscan V2 Integration
This PR adds a new asset whitelisting mechanism to
SingleTokenConverterthat allows specific tokens to be directly transferred to the destination address without going through the conversion process. This enhancement provides a more efficient path for certain assets while maintaining all existing functionality.Changes to
SingleTokenConvertercontractAsset Processing Flow after changes