[VEN-3338] SingleTokenConverter whitelisted assets#146
Open
Exef wants to merge 17 commits intofeat/VEN-3277from
Open
[VEN-3338] SingleTokenConverter whitelisted assets#146Exef wants to merge 17 commits intofeat/VEN-3277from
Exef wants to merge 17 commits intofeat/VEN-3277from
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.
Debugger022
reviewed
Aug 4, 2025
| expect(await whitelistedTokenIn.balanceOf(xvsVaultTreasury.address)).to.equal(whitelistedTokenAmount); | ||
| }); | ||
|
|
||
| it("Revert on when trying to set to a differnet address than xvsVaultTreasury", async () => { |
Contributor
There was a problem hiding this comment.
Suggested change
| 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; | ||
| } | ||
|
|
Comment on lines
183
to
187
| it("Should revert on zero address", async () => { | ||
| await expect(converter.setBaseAsset(ethers.constants.AddressZero)).to.be.revertedWithCustomError( | ||
| converter, | ||
| "ZeroAddressNotAllowed", | ||
| ); |
Contributor
There was a problem hiding this comment.
This is a duplicate, there’s already a test written for it here.
Comment on lines
190
to
207
| 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); |
Contributor
There was a problem hiding this comment.
it should revert if we update same base asset again. Please encorporate change here
chechu
reviewed
Aug 4, 2025
Contributor
|
LGTM |
2c52398 to
868c4dc
Compare
[VPD-74] Etherscan V2 Integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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