Skip to content

Commit

Permalink
Merge pull request #533 from DistributedCollective/SOV-3576-locked-so…
Browse files Browse the repository at this point in the history
…v-migration-allowance

SOV-3576 Set unlimited allowance for LockedSov migration
  • Loading branch information
cwsnt authored Jan 30, 2024
2 parents 72ecfbb + d1d60b7 commit 675b300
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 675b300

Please sign in to comment.