Skip to content
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
6 changes: 3 additions & 3 deletions contracts/DecentralizedAutonomousTrust.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pragma solidity 0.5.13;

import "./Whitelist.sol";
import "./interfaces/IWhitelist.sol";
import "./math/BigDiv.sol";
import "./math/Sqrt.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol";
Expand Down Expand Up @@ -105,7 +105,7 @@ contract DecentralizedAutonomousTrust
*/

/// @notice The contract for transfer authorizations, if any.
Whitelist public whitelist;
IWhitelist public whitelist;

/// @notice The total number of burned FAIR tokens, excluding tokens burned from a `Sell` action in the DAT.
uint public burnedSupply;
Expand Down Expand Up @@ -419,7 +419,7 @@ contract DecentralizedAutonomousTrust
require(msg.sender == control, "CONTROL_ONLY");

// address(0) is okay
whitelist = Whitelist(_whitelistAddress);
whitelist = IWhitelist(_whitelistAddress);

require(_control != address(0), "INVALID_ADDRESS");
control = _control;
Expand Down
9 changes: 6 additions & 3 deletions contracts/Whitelist.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
pragma solidity 0.5.13;


import "./interfaces/ERC1404.sol";
import "./interfaces/IWhitelist.sol";

/**
* @title ERC-1404 whitelist implementation which manages KYC approvals for the org.
* @title whitelist implementation which manages KYC approvals for the org.
* @dev modeled after ERC-1404
*/
contract Whitelist is ERC1404
contract Whitelist is IWhitelist
{
/**
* Emits when an operator KYC approves (or revokes) a trader.
Expand Down Expand Up @@ -85,6 +86,8 @@ contract Whitelist is ERC1404
/**
* @notice Called by the DAT contract before a transfer occurs.
* @dev This call will revert when the transfer is not authorized.
* This is a mutable call to allow additional data to be recorded,
* such as when the user aquired their tokens.
*/
function authorizeTransfer(
address _from,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ pragma solidity 0.5.13;
/**
* Source: https://raw.githubusercontent.com/simple-restricted-token/reference-implementation/master/contracts/token/ERC1404/ERC1404.sol
* With ERC-20 APIs removed (will be implemented as a separate contract).
* And adding authorizeTransfer.
*/
interface ERC1404
interface IWhitelist
{
/**
* @notice Detects if a transfer will be reverted and if so returns an appropriate reference code
Expand All @@ -32,4 +33,17 @@ interface ERC1404
uint8 restrictionCode
) external pure
returns (string memory);

/**
* @notice Called by the DAT contract before a transfer occurs.
* @dev This call will revert when the transfer is not authorized.
* This is a mutable call to allow additional data to be recorded,
* such as when the user aquired their tokens.
*/
function authorizeTransfer(
address _from,
address _to,
uint _value,
bool _isSell
) external;
}