-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.5.0; | ||
pragma solidity 0.6.12; | ||
|
||
import "../../../upgrades/contracts/Initializable.sol"; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.5.0; | ||
pragma solidity 0.6.12; | ||
|
||
/** | ||
* @title Roles | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity ^0.5.0; | ||
pragma solidity 0.6.12; | ||
|
||
import "./IERC20.sol"; | ||
import "../../math/SafeMath.sol"; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
pragma solidity 0.5.16; | ||
pragma solidity 0.6.12; | ||
|
||
import "./@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; | ||
|
||
contract ERC1404 is IERC20 { | ||
abstract contract ERC1404 is IERC20 { | ||
/// @notice Detects if a transfer will be reverted and if so returns an appropriate reference code | ||
/// @param from Sending address | ||
/// @param to Receiving address | ||
/// @param value Amount of tokens being transferred | ||
/// @return Code by which to reference message for rejection reasoning | ||
/// @dev Overwrite with your custom transfer restriction logic | ||
function detectTransferRestriction (address from, address to, uint256 value) public view returns (uint8); | ||
function detectTransferRestriction (address from, address to, uint256 value) public virtual view returns (uint8); | ||
|
||
/// @notice Returns a human-readable message for a given restriction code | ||
/// @param restrictionCode Identifier for looking up a message | ||
/// @return Text showing the restriction's reasoning | ||
/// @dev Overwrite with your custom message and restrictionCode handling | ||
function messageForTransferRestriction (uint8 restrictionCode) public view returns (string memory); | ||
function messageForTransferRestriction (uint8 restrictionCode) public virtual view returns (string memory); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity 0.5.16; | ||
pragma solidity 0.6.12; | ||
|
||
contract Migrations { | ||
address public owner; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pragma solidity 0.5.16; | ||
pragma solidity 0.6.12; | ||
|
||
import "../roles/PauserRole.sol"; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
pragma solidity 0.5.16; | ||
pragma solidity 0.6.12; | ||
|
||
contract Proxiable { | ||
// Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7" | ||
uint256 constant PROXIABLE_MEM_SLOT = 0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7; | ||
|
||
event CodeAddressUpdated(address newAddress); | ||
|
||
function _updateCodeAddress(address newAddress) internal { | ||
require( | ||
bytes32(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7) == Proxiable(newAddress).proxiableUUID(), | ||
bytes32(PROXIABLE_MEM_SLOT) == Proxiable(newAddress).proxiableUUID(), | ||
"Not compatible" | ||
); | ||
assembly { // solium-disable-line | ||
sstore(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7, newAddress) | ||
sstore(PROXIABLE_MEM_SLOT, newAddress) | ||
} | ||
|
||
emit CodeAddressUpdated(newAddress); | ||
} | ||
|
||
function getLogicAddress() public view returns (address logicAddress) { | ||
assembly { // solium-disable-line | ||
logicAddress := sload(0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7) | ||
logicAddress := sload(PROXIABLE_MEM_SLOT) | ||
} | ||
} | ||
|
||
function proxiableUUID() public pure returns (bytes32) { | ||
return 0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7; | ||
return bytes32(PROXIABLE_MEM_SLOT); | ||
} | ||
} |