This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from maticnetwork/lint-fix_
fix lint :D
- Loading branch information
Showing
63 changed files
with
6,211 additions
and
4,992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
pragma solidity ^0.5.2; | ||
|
||
|
||
contract Migrations { | ||
address public owner; | ||
uint public last_completed_migration; | ||
address public owner; | ||
uint256 public last_completed_migration; | ||
|
||
modifier restricted() { | ||
if (msg.sender == owner) _; | ||
} | ||
modifier restricted() { | ||
if (msg.sender == owner) _; | ||
} | ||
|
||
constructor () public { | ||
owner = msg.sender; | ||
} | ||
constructor() public { | ||
owner = msg.sender; | ||
} | ||
|
||
function setCompleted(uint completed) public restricted { | ||
last_completed_migration = completed; | ||
} | ||
function setCompleted(uint256 completed) public restricted { | ||
last_completed_migration = completed; | ||
} | ||
|
||
function upgrade(address new_address) public restricted { | ||
Migrations upgraded = Migrations(new_address); | ||
upgraded.setCompleted(last_completed_migration); | ||
} | ||
function upgrade(address new_address) public restricted { | ||
Migrations upgraded = Migrations(new_address); | ||
upgraded.setCompleted(last_completed_migration); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,90 @@ | ||
pragma solidity ^0.5.2; | ||
|
||
import { ERC20 } from "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; | ||
import {ERC20} from "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; | ||
|
||
import "./ChildToken.sol"; | ||
|
||
|
||
contract BaseERC20 is ChildToken { | ||
event Deposit( | ||
address indexed token, | ||
address indexed from, | ||
uint256 amount, | ||
uint256 input1, | ||
uint256 output1 | ||
); | ||
|
||
event Deposit( | ||
address indexed token, | ||
address indexed from, | ||
uint256 amount, | ||
uint256 input1, | ||
uint256 output1 | ||
); | ||
|
||
event Withdraw( | ||
address indexed token, | ||
address indexed from, | ||
uint256 amount, | ||
uint256 input1, | ||
uint256 output1 | ||
); | ||
event Withdraw( | ||
address indexed token, | ||
address indexed from, | ||
uint256 amount, | ||
uint256 input1, | ||
uint256 output1 | ||
); | ||
|
||
event LogTransfer( | ||
address indexed token, | ||
address indexed from, | ||
address indexed to, | ||
uint256 amount, | ||
uint256 input1, | ||
uint256 input2, | ||
uint256 output1, | ||
uint256 output2 | ||
); | ||
event LogTransfer( | ||
address indexed token, | ||
address indexed from, | ||
address indexed to, | ||
uint256 amount, | ||
uint256 input1, | ||
uint256 input2, | ||
uint256 output1, | ||
uint256 output2 | ||
); | ||
|
||
constructor() public {} | ||
constructor() public {} | ||
|
||
function transferWithSig(bytes calldata sig, uint256 amount, bytes32 data, uint256 expiration, address to) external returns (address from) { | ||
require(amount > 0); | ||
require(expiration == 0 || block.number <= expiration, "Signature is expired"); | ||
function transferWithSig( | ||
bytes calldata sig, | ||
uint256 amount, | ||
bytes32 data, | ||
uint256 expiration, | ||
address to | ||
) external returns (address from) { | ||
require(amount > 0); | ||
require( | ||
expiration == 0 || block.number <= expiration, | ||
"Signature is expired" | ||
); | ||
|
||
bytes32 dataHash = getTokenTransferOrderHash( | ||
msg.sender, | ||
amount, | ||
data, | ||
expiration | ||
); | ||
require(disabledHashes[dataHash] == false, "Sig deactivated"); | ||
disabledHashes[dataHash] = true; | ||
bytes32 dataHash = getTokenTransferOrderHash( | ||
msg.sender, | ||
amount, | ||
data, | ||
expiration | ||
); | ||
require(disabledHashes[dataHash] == false, "Sig deactivated"); | ||
disabledHashes[dataHash] = true; | ||
|
||
from = ecrecovery(dataHash, sig); | ||
_transferFrom(from, address(uint160(to)), amount); | ||
} | ||
from = ecrecovery(dataHash, sig); | ||
_transferFrom(from, address(uint160(to)), amount); | ||
} | ||
|
||
function balanceOf(address account) external view returns (uint256); | ||
function _transfer(address sender, address recipient, uint256 amount) internal; | ||
function balanceOf(address account) external view returns (uint256); | ||
function _transfer(address sender, address recipient, uint256 amount) | ||
internal; | ||
|
||
/// @param from Address from where tokens are withdrawn. | ||
/// @param to Address to where tokens are sent. | ||
/// @param value Number of tokens to transfer. | ||
/// @return Returns success of function call. | ||
function _transferFrom(address from, address to, uint256 value) internal returns (bool) { | ||
uint256 input1 = this.balanceOf(from); | ||
uint256 input2 = this.balanceOf(to); | ||
_transfer(from, to, value); | ||
emit LogTransfer( | ||
token, | ||
from, | ||
to, | ||
value, | ||
input1, | ||
input2, | ||
this.balanceOf(from), | ||
this.balanceOf(to) | ||
); | ||
return true; | ||
} | ||
/// @param from Address from where tokens are withdrawn. | ||
/// @param to Address to where tokens are sent. | ||
/// @param value Number of tokens to transfer. | ||
/// @return Returns success of function call. | ||
function _transferFrom(address from, address to, uint256 value) | ||
internal | ||
returns (bool) | ||
{ | ||
uint256 input1 = this.balanceOf(from); | ||
uint256 input2 = this.balanceOf(to); | ||
_transfer(from, to, value); | ||
emit LogTransfer( | ||
token, | ||
from, | ||
to, | ||
value, | ||
input1, | ||
input2, | ||
this.balanceOf(from), | ||
this.balanceOf(to) | ||
); | ||
return true; | ||
} | ||
} |
Oops, something went wrong.