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

Upgrade DST20 contract to allow 1:1 splits #3059

Merged
merged 3 commits into from
Sep 20, 2024
Merged

Upgrade DST20 contract to allow 1:1 splits #3059

merged 3 commits into from
Sep 20, 2024

Conversation

Bushstar
Copy link
Member

@Bushstar Bushstar commented Sep 19, 2024

Summary

Resolves the issue where a 1:1 split fails due to the following DST20V2 contract code. 1:1 splits are used in the dToken restart, without this upgrade it is not possible to use the upgradeToken function in the contract once all locked tokens have been released.

if (newAmount != amount) {
        _burn(msg.sender, amount);
        IERC20(newTokenContractAddress).transfer(msg.sender, newAmount);
}

Adds a DST20V3 contract that checks the contract address rather than the amount.

if (newTokenContractAddress != address(this)) {
    _burn(msg.sender, amount);
     IERC20(newTokenContractAddress).transfer(msg.sender, newAmount);
}

Implications

  • Storage

    • Database reindex required
    • Database reindex optional
    • Database reindex not required
    • None
  • Consensus

    • Network upgrade required
    • Includes backward compatible changes
    • Includes consensus workarounds
    • Includes consensus refactors
    • None

@Bushstar Bushstar merged commit b0409f5 into master Sep 20, 2024
17 of 26 checks passed
@Bushstar Bushstar deleted the bush/v3contract branch September 20, 2024 09:04
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.

3 participants