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
Constants (4) keyboard_arrow_up
State Variables (14) keyboard_arrow_up
Functions
owner keyboard_arrow_up
renounceOwnership keyboard_arrow_up
transferOwnership keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
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
addBlackList keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function addBlackList(address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
AddedBlackList(_evilUser);
}
removeBlackList keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function removeBlackList(address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
RemovedBlackList(_clearedUser);
}
paused keyboard_arrow_up
name keyboard_arrow_up
symbol keyboard_arrow_up
decimals keyboard_arrow_up
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Modifiers help
onlyPayloadSize checks for the following:
whenNotPaused checks for the following:
Requirements 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;
}
allowance keyboard_arrow_up
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address spender, uint256 amount)
public
virtual
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
transferFrom keyboard_arrow_up
Modifiers help
onlyPayloadSize checks for the following:
whenNotPaused checks for the following:
Requirements 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;
}
increaseAllowance keyboard_arrow_up
Requirements help
Source Code
function increaseAllowance(address spender, uint256 addedValue)
public
virtual
returns (bool)
{
_approve(
_msgSender(),
spender,
_allowances[_msgSender()][spender].add(addedValue)
);
return true;
}
decreaseAllowance keyboard_arrow_up
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
Modifiers help
onlyOwner checks for the following:
whenNotPaused checks for the following:
Requirements help
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
Requirements 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
setUnpause keyboard_arrow_up
delegates keyboard_arrow_up
delegate keyboard_arrow_up
delegateBySig keyboard_arrow_up
Parameters help
Requirements help
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
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
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
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
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
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
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
internal ERC20._transfer keyboard_arrow_up
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
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
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
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
internal ERC20._beforeTokenTransfer keyboard_arrow_up
internal Context._msgSender keyboard_arrow_up
internal Context._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
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
internal Context._msgSender keyboard_arrow_up
internal Context._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
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
internal Pausable._pause keyboard_arrow_up
Parameters help
This function has no parameters.
Source Code
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
internal Pausable._unpause keyboard_arrow_up
internal Context._msgSender keyboard_arrow_up
internal Context._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
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
internal Context._msgSender keyboard_arrow_up
internal Context._msgData keyboard_arrow_up
Parameters help
This function has no parameters.
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;
}