Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make code compile and update open zeppelin dependency #15

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ pnpm-lock.yaml
yarn.lock

slither.config.json
contracts.json
48 changes: 24 additions & 24 deletions contracts.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"goerli":{
"l1":{
"token":"0x3D6AFAA395C31FCd391fE3D562E75fe9E8ec7E6a",
"controller":"0x7C9928829641Dd2Fa76AF3408f295A0A116983e3",
"tokenFactory":"0x0835493830897f4ebcDf13Bbf38E78fFC65a18f0"
},
"l2":{
"token":"0xf852198D0385c4B871E0B91804ecd47C6bA97351",
"controller":"0x6CC7274aF9cE9572d22DFD8545Fb8c9C9Bcb48AD",
"tokenFactory":"0x8cc272396Be7583c65BEe82CD7b743c69A87287D"
}
"goerli": {
"l1": {
"token":"0x3D6AFAA395C31FCd391fE3D562E75fe9E8ec7E6a",
"controller":"0x7C9928829641Dd2Fa76AF3408f295A0A116983e3",
"tokenFactory":"0x0835493830897f4ebcDf13Bbf38E78fFC65a18f0",
},
"mainnet":{
"l1":{
"token":"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E",
"controller":"0x52aE2B53C847327f95A5084a7C38c0adb12fD302",
"tokenFactory":"0xa1c957C0210397D2d0296341627B74411756d476"
},
"l2":{
"token":"",
"controller":"",
"tokenFactory":""
}
}
}
"l2": {
"token":"0xf852198D0385c4B871E0B91804ecd47C6bA97351",
"controller":"0x6CC7274aF9cE9572d22DFD8545Fb8c9C9Bcb48AD",
"tokenFactory":"0x8cc272396Be7583c65BEe82CD7b743c69A87287D",
},
},
"mainnet": {
"l1": {
"token":"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E",
"controller":"0x52aE2B53C847327f95A5084a7C38c0adb12fD302",
"tokenFactory":"0xa1c957C0210397D2d0296341627B74411756d476",
},
"l2": {
"token":"",
"controller":"",
"tokenFactory":"",
},
},
}
14 changes: 7 additions & 7 deletions contracts/SNTPlaceHolder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.18;

import { TokenController } from "@vacp2p/minime/contracts/TokenController.sol";
import { MiniMeBase } from "@vacp2p/minime/contracts/MiniMeBase.sol";
import "@openzeppelin/contracts/access/Ownable2Step.sol";
import { Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol";

/*
Copyright 2017, Jordi Baylina
Expand Down Expand Up @@ -32,7 +32,7 @@ import "@openzeppelin/contracts/access/Ownable2Step.sol";
contract SNTPlaceHolder is TokenController, Ownable2Step {
MiniMeBase public snt;

constructor(address _owner, address payable _snt) Ownable2Step(_owner) {
constructor(address payable _snt) {
snt = MiniMeBase(_snt);
}

Expand Down Expand Up @@ -60,20 +60,20 @@ contract SNTPlaceHolder is TokenController, Ownable2Step {
function onApprove(address, address, uint256) public pure override returns (bool) {
return true;
}

/// @notice This method can be used by the controller to extract mistakenly
/// sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
/// set to 0 in case you want to extract ether.
function claimTokens(MiniMeToken _token) public onlyOwner {
function claimTokens(MiniMeBase _token) public onlyOwner {
if (address(_token) == address(0)) {
payable(owner).transfer(address(this).balance);
payable(owner()).transfer(address(this).balance);
return;
}

uint256 balance = _token.balanceOf(address(this));
_token.transfer(owner, balance);
emit ClaimedTokens(address(_token), owner, balance);
_token.transfer(owner(), balance);
emit ClaimedTokens(address(_token), owner(), balance);
}

event ClaimedTokens(address indexed _token, address indexed _controller, uint256 _amount);
Expand Down
2 changes: 1 addition & 1 deletion lib/openzeppelin-contracts