Blockwell

Tranche Finance

ERC20

This contract is an ERC20 token.

Name Tranche Finance
Symbol SLICE
Decimals 18
Total Supply 20,000,000 SLICE

About link description

Tranche Finance (SLICE) is a cryptocurrency and operates on the Ethereum platform. Tranche Finance has a current supply of 20,000,000. The last known price of Tranche Finance is 0.80355507 USD and is up 0.47 over the last 24 hours. It is currently trading on 7 active market(s) with $720,031.69 traded over the last 24 hours. More information can be found at https://tranche.finance/borrow.

Stats

Public Functions 27
Event Types 9
Code Size 43,038 bytes

Library Use

Uses SafeMath for uint256.

Events (9) keyboard_arrow_up

AddedBlackList Event

Parameters help
_user
address help

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

DelegateChanged Event

Parameters help
delegator
address help
fromDelegate
address help
toDelegate
address help

DelegateVotesChanged Event

Parameters help
delegate
address help
previousBalance
uint256 help
newBalance
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Paused Event

Parameters help
account
address help

RemovedBlackList Event

Parameters help
_user
address help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

Unpaused Event

Parameters help
account
address help

Checkpoint Struct

Members
fromBlock
uint256 help
votes
uint256 help

DOMAIN_TYPEHASH Constant

bytes32 help
the result of calling keccak256 with "EIP712Domain(string name,uint256 chainId,address verifyingContract)"

DELEGATION_TYPEHASH Constant

bytes32 help
the result of calling keccak256 with "Delegation(address delegatee,uint256 nonce,uint256 expiry)"

minimumTimeBetweenMints Constant

uint32 help
1 days * 365

mintCap Constant

uint8 help
2

mintingAllowedAfter Variable

uint help

numCheckpoints Variable

mapping(address => uint32) help

nonces Variable

mapping(address => uint256) help

isBlackListed Variable

mapping(address => bool) help

_delegates Variable

mapping(address => address) help
Internal Variable

checkpoints Variable

mapping(address => mapping(uint32 => Checkpoint)) help
Internal Variable

_balances Variable

mapping(address => uint256) help
Internal Variable

_allowances Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

_totalSupply Variable

uint256 help
Internal Variable

_name Variable

string help
Internal Variable

_symbol Variable

string help
Internal Variable

_decimals Variable

uint8 help
Internal Variable

_owner Variable

address help
Internal Variable

_paused Variable

bool help
Internal Variable

Functions Expand All Collapse All

owner keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function owner() public view returns (address) {
  return _owner;
}

renounceOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function renounceOwnership() public virtual onlyOwner {
  emit OwnershipTransferred(_owner, address(0));
  _owner = address(0);
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
function transferOwnership(address newOwner) public virtual onlyOwner {
  require(newOwner != address(0), "Ownable: new owner is the zero address");
  emit OwnershipTransferred(_owner, newOwner);
  _owner = newOwner;
}

getBlackListStatus keyboard_arrow_up

Parameters help

Name Type
_maker
address help

Properties

Visibility help public
Mutability help view
Source Code
function getBlackListStatus(address _maker) external view returns (bool) {
  return isBlackListed[_maker];
}

addBlackList keyboard_arrow_up

Parameters help

Name Type
_evilUser
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function addBlackList(address _evilUser) public onlyOwner {
  isBlackListed[_evilUser] = true;
  AddedBlackList(_evilUser);
}

removeBlackList keyboard_arrow_up

Parameters help

Name Type
_clearedUser
address help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function removeBlackList(address _clearedUser) public onlyOwner {
  isBlackListed[_clearedUser] = false;
  RemovedBlackList(_clearedUser);
}

paused keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function paused() public view returns (bool) {
  return _paused;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function name() public view returns (string memory) {
  return _name;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function symbol() public view returns (string memory) {
  return _symbol;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function decimals() public view returns (uint8) {
  return _decimals;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function totalSupply() public view override returns (uint256) {
  return _totalSupply;
}

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address account) public view override returns (uint256) {
  return _balances[account];
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transfer(address _to, uint256 _value)
  public
  override
  onlyPayloadSize(2 * 32)
  whenNotPaused
  returns (bool)
{
  require(!isBlackListed[msg.sender], "Transfer - Sender is blacklisted");
  require(!isBlackListed[_to], "Transfer - Recipient is blacklisted");
  super.transfer(_to, _value);
  _moveDelegates(_delegates[msg.sender], _delegates[_to], _value);
  return true;
}

Parameters help

Name Type
owner
address help
spender
address help

Properties

Visibility help public
Mutability help view
Source Code
function allowance(address owner, address spender)
  public
  view
  virtual
  override
  returns (uint256)
{
  return _allowances[owner][spender];
}

Parameters help

Name Type
spender
address help
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address spender, uint256 amount)
  public
  virtual
  override
  returns (bool)
{
  _approve(_msgSender(), spender, amount);
  return true;
}

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function transferFrom(
  address _from,
  address _to,
  uint256 _value
) public override onlyPayloadSize(3 * 32) whenNotPaused returns (bool) {
  require(!isBlackListed[_from], "TransferFrom - Sender is blacklisted");
  require(!isBlackListed[_to], "TransferFrom - Recipient is blacklisted");
  super.transferFrom(_from, _to, _value);
  _moveDelegates(_delegates[_from], _delegates[_to], _value);
  return true;
}

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function increaseAllowance(address spender, uint256 addedValue)
  public
  virtual
  returns (bool)
{
  _approve(
    _msgSender(),
    spender,
    _allowances[_msgSender()][spender].add(addedValue)
  );
  return true;
}

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
  public
  virtual
  returns (bool)
{
  _approve(
    _msgSender(),
    spender,
    _allowances[_msgSender()][spender].sub(
      subtractedValue,
      "ERC20: decreased allowance below zero"
    )
  );
  return true;
}

mint keyboard_arrow_up

Parameters help

Name Type
recipient
address help
_mintVal
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function mint(address recipient, uint256 _mintVal)
  public
  onlyOwner
  whenNotPaused
{
  require(
    recipient != address(0),
    "Token::mint: cannot transfer to the zero address"
  );
  require(!isBlackListed[recipient], "Mint - Recipient is blacklisted");
  require(
    block.timestamp >= mintingAllowedAfter,
    "Token::mint: minting not allowed yet"
  );
  // record the mint
  mintingAllowedAfter = SafeMath.add(block.timestamp, minimumTimeBetweenMints);
  // mint the amount
  require(
    _mintVal <= SafeMath.div(SafeMath.mul(totalSupply(), mintCap), 100),
    "Token::mint: exceeded mint cap"
  );
  _mint(recipient, _mintVal);
  // move delegates
  _moveDelegates(address(0), _delegates[recipient], _mintVal);
}

burn keyboard_arrow_up

Parameters help

Name Type
_burnVal
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function burn(uint256 _burnVal) public whenNotPaused {
  require(!isBlackListed[msg.sender], "Burn - Sender is blacklisted");
  _burn(msg.sender, _burnVal);
}

setPause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function setPause() external whenNotPaused onlyOwner {
  _pause();
}

setUnpause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function setUnpause() external whenPaused onlyOwner {
  _unpause();
}

delegates keyboard_arrow_up

Parameters help

Name Type
delegator
address help

Properties

Visibility help public
Mutability help view
Source Code
function delegates(address delegator) external view returns (address) {
  return _delegates[delegator];
}

delegate keyboard_arrow_up

Parameters help

Name Type
delegatee
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function delegate(address delegatee) public {
  return _delegate(msg.sender, delegatee);
}

delegateBySig keyboard_arrow_up

Parameters help

Name Type
delegatee
address help
nonce
uint256 help
expiry
uint256 help
v
uint8 help
r
bytes32 help
s
bytes32 help

Properties

Visibility help public
Mutability help transaction
Source Code
function delegateBySig(
  address delegatee,
  uint256 nonce,
  uint256 expiry,
  uint8 v,
  bytes32 r,
  bytes32 s
) public {
  bytes32 domainSeparator = keccak256(
    abi.encode(
      DOMAIN_TYPEHASH,
      keccak256(bytes(string(name()))),
      getChainId(),
      address(this)
    )
  );
  bytes32 structHash = keccak256(
    abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)
  );
  bytes32 digest = keccak256(
    abi.encodePacked("\x19\x01", domainSeparator, structHash)
  );
  address signatory = ecrecover(digest, v, r, s);
  require(signatory != address(0), "Token::delegateBySig: invalid signature");
  require(nonce == nonces[signatory]++, "Token::delegateBySig: invalid nonce");
  require(now <= expiry, "Token::delegateBySig: signature expired");
  return _delegate(signatory, delegatee);
}

getCurrentVotes keyboard_arrow_up

Parameters help

Name Type
account
address help

Properties

Visibility help public
Mutability help view
Source Code
function getCurrentVotes(address account) external view returns (uint256) {
  uint32 nCheckpoints = numCheckpoints[account];
  return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}

getPriorVotes keyboard_arrow_up

Parameters help

Name Type
account
address help
blockNumber
uint256 help

Properties

Visibility help public
Mutability help view

Requirements help

Source Code
function getPriorVotes(address account, uint256 blockNumber)
  public
  view
  returns (uint256)
{
  require(
    blockNumber < block.number,
    "Token::getPriorVotes: not yet determined"
  );

  uint32 nCheckpoints = numCheckpoints[account];
  if (nCheckpoints == 0) {
    return 0;
  }

  // First check most recent balance
  if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
    return checkpoints[account][nCheckpoints - 1].votes;
  }

  // Next check implicit zero balance
  if (checkpoints[account][0].fromBlock > blockNumber) {
    return 0;
  }

  uint32 lower = 0;
  uint32 upper = nCheckpoints - 1;
  while (upper > lower) {
    uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
    Checkpoint memory cp = checkpoints[account][center];
    if (cp.fromBlock == blockNumber) {
      return cp.votes;
    } else if (cp.fromBlock < blockNumber) {
      lower = center;
    } else {
      upper = center - 1;
    }
  }
  return checkpoints[account][lower].votes;
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.

internal Token._delegate keyboard_arrow_up

Parameters help

Name Type
delegator
address help
delegatee
address help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _delegate(address delegator, address delegatee) internal {
  address currentDelegate = _delegates[delegator];
  uint256 delegatorBalance = balanceOf(delegator);
  _delegates[delegator] = delegatee;

  emit DelegateChanged(delegator, currentDelegate, delegatee);

  _moveDelegates(currentDelegate, delegatee, delegatorBalance);
}

internal Token._moveDelegates keyboard_arrow_up

Parameters help

Name Type
srcRep
address help
dstRep
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _moveDelegates(
  address srcRep,
  address dstRep,
  uint256 amount
) internal {
  if (srcRep != dstRep && amount > 0) {
    if (srcRep != address(0)) {
      uint32 srcRepNum = numCheckpoints[srcRep];
      uint256 srcRepOld = srcRepNum > 0
        ? checkpoints[srcRep][srcRepNum - 1].votes
        : 0;
      uint256 srcRepNew = srcRepOld.sub(amount);
      _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
    }

    if (dstRep != address(0)) {
      uint32 dstRepNum = numCheckpoints[dstRep];
      uint256 dstRepOld = dstRepNum > 0
        ? checkpoints[dstRep][dstRepNum - 1].votes
        : 0;
      uint256 dstRepNew = dstRepOld.add(amount);
      _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
    }
  }
}

internal Token._writeCheckpoint keyboard_arrow_up

Parameters help

Name Type
delegatee
address help
nCheckpoints
uint32 help
oldVotes
uint256 help
newVotes
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _writeCheckpoint(
  address delegatee,
  uint32 nCheckpoints,
  uint256 oldVotes,
  uint256 newVotes
) internal {
  uint256 blockNumber = block.number;

  if (
    nCheckpoints > 0 &&
    checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber
  ) {
    checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
  } else {
    checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
    numCheckpoints[delegatee] = nCheckpoints + 1;
  }

  emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}

internal Token.getChainId keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help pure
Source Code
function getChainId() internal pure returns (uint256) {
  uint256 chainId;
  assembly {
    chainId := chainid()
  }
  return chainId;
}

internal ERC20._transfer keyboard_arrow_up

Parameters help

Name Type
sender
address help
recipient
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _transfer(
  address sender,
  address recipient,
  uint256 amount
) internal virtual {
  require(sender != address(0), "ERC20: transfer from the zero address");
  require(recipient != address(0), "ERC20: transfer to the zero address");

  _beforeTokenTransfer(sender, recipient, amount);

  _balances[sender] = _balances[sender].sub(
    amount,
    "ERC20: transfer amount exceeds balance"
  );
  _balances[recipient] = _balances[recipient].add(amount);
  emit Transfer(sender, recipient, amount);
}

internal ERC20._mint keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _mint(address account, uint256 amount) internal virtual {
  require(account != address(0), "ERC20: mint to the zero address");

  _beforeTokenTransfer(address(0), account, amount);

  _totalSupply = _totalSupply.add(amount);
  _balances[account] = _balances[account].add(amount);
  emit Transfer(address(0), account, amount);
}

internal ERC20._burn keyboard_arrow_up

Parameters help

Name Type
account
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _burn(address account, uint256 amount) internal virtual {
  require(account != address(0), "ERC20: burn from the zero address");

  _beforeTokenTransfer(account, address(0), amount);

  _balances[account] = _balances[account].sub(
    amount,
    "ERC20: burn amount exceeds balance"
  );
  _totalSupply = _totalSupply.sub(amount);
  emit Transfer(account, address(0), amount);
}

internal ERC20._approve keyboard_arrow_up

Parameters help

Name Type
owner
address help
spender
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function _approve(
  address owner,
  address spender,
  uint256 amount
) internal virtual {
  require(owner != address(0), "ERC20: approve from the zero address");
  require(spender != address(0), "ERC20: approve to the zero address");

  _allowances[owner][spender] = amount;
  emit Approval(owner, spender, amount);
}

internal ERC20._setupDecimals keyboard_arrow_up

Parameters help

Name Type
decimals_
uint8 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _setupDecimals(uint8 decimals_) internal {
  _decimals = decimals_;
}

internal ERC20._beforeTokenTransfer keyboard_arrow_up

Parameters help

Name Type
from
address help
to
address help
amount
uint256 help

Properties

Visibility help internal
Mutability help transaction
Source Code
function _beforeTokenTransfer(
  address from,
  address to,
  uint256 amount
) internal virtual {}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  address msgSender = _msgSender();
  _owner = msgSender;
  emit OwnershipTransferred(address(0), msgSender);
}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal Pausable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  _paused = false;
}

internal Pausable._pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction

Modifiers help

Source Code
function _pause() internal virtual whenNotPaused {
  _paused = true;
  emit Paused(_msgSender());
}

internal Pausable._unpause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction

Modifiers help

Source Code
function _unpause() internal virtual whenPaused {
  _paused = false;
  emit Unpaused(_msgSender());
}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}

internal Ownable.constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help transaction
Source Code
constructor() internal {
  address msgSender = _msgSender();
  _owner = msgSender;
  emit OwnershipTransferred(address(0), msgSender);
}

internal Context._msgSender keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgSender() internal view virtual returns (address payable) {
  return msg.sender;
}

internal Context._msgData keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help internal
Mutability help view
Source Code
function _msgData() internal view virtual returns (bytes memory) {
  this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  return msg.data;
}