Skip to content

Commit

Permalink
Change all functions to external
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmkm committed Dec 17, 2024
1 parent fd024cf commit 08038ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/token/SonicBeetsMigrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ contract SonicBeetsMigrator {
admin = msg.sender;
}

function exchangeOperaToSonic(uint256 amount) public {
function exchangeOperaToSonic(uint256 amount) external {
require(operaToSonicEnabled, MigrationDisabled());
require(OPERABEETS.balanceOf(msg.sender) >= amount, UserBalanceInsufficient());
require(SONICBEETS.balanceOf(address(this)) >= amount, MigratorBalanceInsufficient());
OPERABEETS.transferFrom(msg.sender, address(this), amount);
SONICBEETS.transfer(msg.sender, amount);
}

function exchangeSonicToOpera(uint256 amount) public {
function exchangeSonicToOpera(uint256 amount) external {
require(sonicToOperaEnabled, MigrationDisabled());
require(SONICBEETS.balanceOf(msg.sender) >= amount, UserBalanceInsufficient());
require(OPERABEETS.balanceOf(address(this)) >= amount, MigratorBalanceInsufficient());
SONICBEETS.transferFrom(msg.sender, address(this), amount);
OPERABEETS.transfer(msg.sender, amount);
}

function setAdmin(address _admin) public {
function setAdmin(address _admin) external {
require(msg.sender == admin, NotAdmin());
admin = _admin;
}
Expand All @@ -57,12 +57,12 @@ contract SonicBeetsMigrator {
sonicToOperaEnabled = _toggle;
}

function withdrawOperaBeets() public {
function withdrawOperaBeets() external {
require(msg.sender == admin, NotAdmin());
OPERABEETS.transfer(TREASURY, OPERABEETS.balanceOf(address(this)));
}

function withdrawSonicBeets() public {
function withdrawSonicBeets() external {
require(msg.sender == admin, NotAdmin());
SONICBEETS.transfer(TREASURY, SONICBEETS.balanceOf(address(this)));
}
Expand Down

0 comments on commit 08038ec

Please sign in to comment.