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

SOV-3576 Set unlimited allowance for LockedSov migration #533

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/locked/LockedSOV.sol
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ contract LockedSOV is ILockedSOV {
function startMigration(address _newLockedSOV) external onlyAdmin {
require(_newLockedSOV != address(0), "New Locked SOV Address is Invalid.");
newLockedSOV = ILockedSOV(_newLockedSOV);
SOV.approve(_newLockedSOV, SOV.balanceOf(address(this)));
SOV.approve(_newLockedSOV, uint256(-1));
migration = true;

emit MigrationStarted(msg.sender, _newLockedSOV);
Expand Down
5 changes: 4 additions & 1 deletion tests/Locked/state.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ contract("Locked SOV (State)", (accounts) => {
}
});

it("Starting the migration should update the contract status correctly.", async () => {
it("Starting the migration should update the contract status correctly, and approved new LockedSOV with unlimited amount", async () => {
await checkStatus(
lockedSOV,
[1, 1, 1, 1, 1, 1, 1, 1],
Expand Down Expand Up @@ -540,6 +540,9 @@ contract("Locked SOV (State)", (accounts) => {
zero,
false
);

const allowance = await sov.allowance(lockedSOV.address, newLockedSOV.address);
expect(allowance).to.equal(constants.MAX_UINT256);
});

it("Using transfer() should correctly transfer locked token to new locked sov.", async () => {
Expand Down
Loading