Skip to content

Refactor: cover audit items - #7

Closed
sontrinh16 wants to merge 2 commits into
mainfrom
son/audit
Closed

sontrinh16 wants to merge 2 commits into
mainfrom
son/audit

Conversation

@sontrinh16

Copy link
Copy Markdown

Summary

Addresses audit findings C-01–C-06 by correcting error propagation, preserving lock state on failure, and preventing ERC20 conversion reverts from halting unbonding.

  • Return mint failures and unexpected unbonding lookup errors.
  • Enforce denomination checks for zero-balance coins and initialize new locks with their denomination.
  • Validate lock/unlock keys before slicing and return decoding errors.
  • Apply lock moves to copies, committing only after both remove and add succeed.
  • Isolate ERC20 conversion state and gas consumption so failed conversions leave the recipient’s Cosmos coins intact.
  • Add regression tests, including a reverting contract exercised through the real EVM, and fix simulated-app keeper wiring.

Compatibility

  • GetOrCreateMultiStakingLock now requires a denomination.
  • Both lock/unlock key decoders now return an error.
  • Stored formats remain unchanged.

Validation

  • Full suite passed: go test -tags=test ./...
  • Types tests passed after the final lock-move refactor.

@hieuvubk hieuvubk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall look good!
Left one comment for convert erc20 coins

Comment thread x/multi-staking/keeper/lock.go Resolved
@sontrinh16

Copy link
Copy Markdown
Author

moving to other target branch

@sontrinh16 sontrinh16 closed this Sep 15, 2026
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