Skip to content

Commit

Permalink
refactor: remove param of transfer thusd ownership function
Browse files Browse the repository at this point in the history
  • Loading branch information
evandrosaturnino committed Feb 5, 2024
1 parent c757278 commit 3371b2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
12 changes: 4 additions & 8 deletions packages/contracts/contracts/THUSDOwner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import "./Dependencies/CheckContract.sol";
import "./Dependencies/Ownable.sol";

contract THUSDOwner is Ownable, CheckContract {
ITHUSDToken private thusdToken;
ITHUSDToken public immutable thusdToken;

address public governorBravoAddress;
address public immutable governorBravoAddress;

constructor(
address _governorBravoAddress,
Expand All @@ -35,11 +35,7 @@ contract THUSDOwner is Ownable, CheckContract {
thusdToken.finalizeRevokeMintList();
}

function transferThusdOwnershipToGovernorBravo(address _account)
external
onlyOwner
{
require(_account == governorBravoAddress, "THUSDOwner: new owner must be Governor Bravo");
thusdToken.transferOwnership(_account);
function transferThusdOwnershipToGovernorBravo() external onlyOwner {
thusdToken.transferOwnership(governorBravoAddress);
}
}
10 changes: 0 additions & 10 deletions packages/contracts/test/THUSDOwnerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,13 @@ contract('THUSDOwner', async accounts => {

it('transferThusdOwnershipToGovernorBravo(): reverts when caller is not owner', async () => {
await assertRevert(thusdOwner.transferThusdOwnershipToGovernorBravo(
governorBravo,
{ from: owner }),
"Ownable: caller is not the owner"
)
})

it('transferThusdOwnershipToGovernorBravo(): reverts when new owner is not governor bravo', async () => {
await assertRevert(thusdOwner.transferThusdOwnershipToGovernorBravo(
owner,
{ from: integrationsGuild }),
"THUSDOwner: new owner must be Governor Bravo"
)
})

it('transferThusdOwnershipToGovernorBravo(): transfer thusd ownership to governor bravo', async () => {
await thusdOwner.transferThusdOwnershipToGovernorBravo(
governorBravo,
{ from: integrationsGuild }
)
await assert.equal(await thusdToken.owner(), governorBravo)
Expand Down

0 comments on commit 3371b2b

Please sign in to comment.