Skip to content
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

Invalid deposit transactions tests #381

Open
wants to merge 8 commits into
base: feat/v3.1
Choose a base branch
from

Conversation

cosmatudor
Copy link

No description provided.

@cosmatudor cosmatudor changed the base branch from main to feat/v3-audit-tests November 18, 2024 16:39
@cosmatudor cosmatudor marked this pull request as draft November 18, 2024 16:39
- deposits with less amount
- bridges to address zero
- deposits of non whitelisted tokens
@cosmatudor cosmatudor marked this pull request as ready for review November 27, 2024 15:24
# Conflicts:
#	integrationTests/relayers/slowTests/framework/multiversxHandler.go
#	integrationTests/relayers/slowTests/framework/testSetup.go
@cosmatudor cosmatudor changed the base branch from feat/v3-audit-tests to feat/v3.1 November 28, 2024 09:40
IsFaultyDeposit: true,
},
},
ESDTSafeExtraBalance: big.NewInt(100), // extra is just for the fees for the 2 transfers mvx->eth
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be 0, the swaps are not done, no values should be held in the ESDT safe

@@ -236,6 +275,82 @@ func GenerateTestMEXToken() framework.TestTokenParams {
}
}

// GenerateTestDOGEToken will generate a test DOGE token
func GenerateTestDOGEToken() framework.TestTokenParams {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GenerateUnlistedTokenFromEth?
I think it is a good idea to change in a future PR all test token names

}

// GenerateTestBOBERToken will generate a test BOBER token
func GenerateTestBOBERToken() framework.TestTokenParams {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GenerateUnlistedTokenFromMvx?
I think it is a good idea to change in a future PR all test token names

{
ValueToTransferToMvx: nil,
ValueToSendFromMvX: big.NewInt(2010),
MvxSCCallData: createScCallData("callPayable", 50000000),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is irrelevant for this token

MvxSCCallData: createScCallData("callPayable", 50000000),
},
},
ESDTSafeExtraBalance: big.NewInt(150), // just the fees should be collected in ESDT safe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not 0?

@@ -551,7 +481,10 @@ func (handler *MultiversxHandler) issueAndWhitelistTokensWithChainSpecific(ctx c
handler.setLocalRolesForUniversalTokenOnWrapper(ctx, params)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reconsider this a little bit. What do we need for an unlisted token?
issue at least the universal token
mint the Alice user with some funds for this token
All L481-L494 are not done for an unlisted token.

  • there is a mistake as handler.whitelistTokenOnMultisig(ctx, params) is called twice

@@ -569,7 +502,9 @@ func (handler *MultiversxHandler) issueAndWhitelistTokens(ctx context.Context, p

handler.setRolesForSpecificTokenOnSafe(ctx, params)
handler.addMappingInMultisig(ctx, params)
handler.whitelistTokenOnMultisig(ctx, params)
if !params.PreventWhitelist {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here

return len(responseData) != 0
}

func (handler *MultiversxHandler) sendAndCheckTx(ctx context.Context, sender KeysHolder, receiver *MvxAddress, value string, gasLimit uint64, function string, params []string) (string, *data.TransactionOnNetwork) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually scCallAndCheckTx :)

@@ -32,6 +33,22 @@ const (

type currentBridge string

type CurrentActorState struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing comment

if !setup.checkHolderEthBalanceForToken(sender, true, params) {
// if token is prevented from whitelist, we can't check the balances
if params.PreventWhitelist {
return true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants