Skip to content

Commit

Permalink
feat(ControllerToken): setting setFrontend with onlyOwner modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
KristenPire committed Apr 9, 2024
1 parent 0fed35a commit 8c75cc0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions script/connectV2toV1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
pragma solidity ^0.8.20;

import "forge-std/Script.sol";
import "../src/Token.sol";
import "../src/ControllerToken.sol";
import "../src/TokenFrontend.sol";
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

contract All is Script {
function run() external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
address tokenAddress = vm.envAddress("TOKEN_ADDRESS");
address frontend = vm.envAddress("FRONTEND_ADDRESS");
address frontendAddress = vm.envAddress("FRONTEND_ADDRESS");
address owner = vm.envAddress("OWNER_ADDRESS");
vm.startBroadcast(deployerPrivateKey);
console.log("Configuring with Token:");

// Assuming Token and SmartController are already deployed and their ABIs are known
Token token = Token(tokenAddress);
ControllerToken token = ControllerToken(tokenAddress);
TokenFrontend frontend = TokenFrontend(frontendAddress);

// Claiming ownership of Token and SmartController
if (token.pendingOwner() == address(this)) {
token.claimOwnership();
token.acceptOwnership();
}
frontend.claimOwnership();

Expand Down
2 changes: 1 addition & 1 deletion src/ControllerToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ contract ControllerToken is Token {
return _getControllerStorage().ticker;
}

function setFrontend(address _address) public {
function setFrontend(address _address) public onlyOwner {
_getControllerStorage().frontend = _address;
}

Expand Down

0 comments on commit 8c75cc0

Please sign in to comment.