optimism-bridge-snt/contracts/SNTPlaceHolder.sol

68 lines
2.5 KiB
Solidity
Raw Normal View History

2023-07-17 16:59:00 +00:00
// SPDX-License-Identifier: GPL-3.0
2023-09-26 14:34:28 +00:00
pragma solidity ^0.8.18;
import { TokenController } from "@vacp2p/minime/contracts/TokenController.sol";
import { MiniMeToken } from "@vacp2p/minime/contracts/MiniMeToken.sol";
2023-07-17 16:59:00 +00:00
import "./Owned.sol";
/*
Copyright 2017, Jordi Baylina
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/// @title SNTPlaceholder Contract
/// @author Jordi Baylina
/// @dev The SNTPlaceholder contract will take control over the SNT after the contribution
/// is finalized and before the Status Network is deployed.
/// The contract allows for SNT transfers and transferFrom and implements the
/// logic for transferring control of the token to the network when the offering
/// asks it to do so.
contract SNTPlaceHolder is TokenController, Owned {
MiniMeToken public snt;
constructor(address _owner, address payable _snt) {
owner = _owner;
snt = MiniMeToken(_snt);
}
/// @notice The owner of this contract can change the controller of the SNT token
/// Please, be sure that the owner is a trusted agent or 0x0 address.
/// @param _newController The address of the new controller
2023-09-26 14:34:28 +00:00
function changeController(address payable _newController) public onlyOwner {
2023-07-17 16:59:00 +00:00
snt.changeController(_newController);
emit ControllerChanged(_newController);
}
2023-09-26 14:34:28 +00:00
2023-07-17 16:59:00 +00:00
//////////
// MiniMe Controller Interface functions
//////////
// In between the offering and the network. Default settings for allowing token transfers.
2023-09-26 14:34:28 +00:00
function proxyPayment(address) public payable override returns (bool) {
2023-07-17 16:59:00 +00:00
return false;
}
2023-09-26 14:34:28 +00:00
function onTransfer(address, address, uint256) public pure override returns (bool) {
2023-07-17 16:59:00 +00:00
return true;
}
2023-09-26 14:34:28 +00:00
function onApprove(address, address, uint256) public pure override returns (bool) {
2023-07-17 16:59:00 +00:00
return true;
}
2023-09-26 14:34:28 +00:00
2023-07-17 16:59:00 +00:00
event ClaimedTokens(address indexed _token, address indexed _controller, uint256 _amount);
event ControllerChanged(address indexed _newController);
2023-09-26 14:34:28 +00:00
}