Blockwell

UniGraph

ERC20

This contract is an ERC20 token.

Name UniGraph
Symbol GRAPH
Decimals 18
Total Supply 108,150 GRAPH

About

Stats

Public Functions 19
Event Types 6
Code Size 11,391 bytes

Library Use

Uses SafeMath for uint256.

Events (6) keyboard_arrow_up

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

FeeTakerTransferred Event

Parameters help
previousFeeTaker
address help
newFeeTaker
address help

LogRebase Event

Parameters help
epoch
uint256 help
totalSupply
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

PoolFeeDropped Event

Parameters help
amount
uint256 help
poolBalance
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

decimals Constant

uint256 help
18

DECIMALS Constant

uint256 help
18

MAX_UINT256 Constant

uint256 help
UNKNOWN VALUE

INITIAL_FRAGMENTS_SUPPLY Constant

uint256 help
100_000 * UNKNOWN VALUE

TOTAL_GONS Constant

uint256 help

MAX_SUPPLY Constant

uint256 help
UNKNOWN VALUE

name Variable

string help

symbol Variable

string help

_feeTaker Variable

address help

uniswapFactory Variable

address help

POOL_FEE_DAILY_PERCENT Variable

uint256 help

uniswapPool Variable

address help

lastPoolFeeTime Variable

uint256 help

_owner Variable

address help

_totalSupply Variable

uint256 help
Internal Variable

_gonsPerFragment Variable

uint256 help
Internal Variable

_gonBalances Variable

mapping(address => uint256) help
Internal Variable

_allowedFragments Variable

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

epoch Variable

uint256 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;
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction

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;
}

updateBranding keyboard_arrow_up

Parameters help

Name Type
newName
string help
newSymbol
string help

Properties

Visibility help public
Mutability help transaction
Source Code
function updateBranding(string memory newName, string memory newSymbol)
  public
  onlyOwner
{
  name = newName;
  symbol = newSymbol;
}

transferFeeTaker keyboard_arrow_up

Parameters help

Name Type
newFeeTaker
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferFeeTaker(address newFeeTaker) public virtual onlyOwner {
  emit FeeTakerTransferred(_feeTaker, newFeeTaker);
  _feeTaker = newFeeTaker;
}

feeTaker keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

rebasePer keyboard_arrow_up

Parameters help

Name Type
supplyPercent
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function rebasePer(uint256 supplyPercent) external onlyOwner returns (uint256) {
  epoch = epoch.add(1);
  if (supplyPercent <= 50 || supplyPercent >= 100) {
    revert();
  }
  uint256 absSupplyPercent = uint256(supplyPercent);
  _totalSupply = _totalSupply.mul(absSupplyPercent).div(100);

  if (_totalSupply > MAX_SUPPLY) {
    _totalSupply = MAX_SUPPLY;
  }

  _gonsPerFragment = TOTAL_GONS.div(_totalSupply);

  emit LogRebase(epoch, _totalSupply);
  return _totalSupply;
}

rebase keyboard_arrow_up

Parameters help

Name Type
supplyDelta
int256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function rebase(int256 supplyDelta) external onlyOwner returns (uint256) {
  epoch = epoch.add(1);
  if (supplyDelta == 0) {
    emit LogRebase(epoch, _totalSupply);
    return _totalSupply;
  }

  uint256 absSupplyDelta = uint256(supplyDelta);
  if (supplyDelta < 0) {
    absSupplyDelta = uint256(-supplyDelta);
  }
  if (supplyDelta < 0) {
    _totalSupply = _totalSupply.sub(absSupplyDelta);
  } else {
    _totalSupply = _totalSupply.add(absSupplyDelta);
  }

  if (_totalSupply > MAX_SUPPLY) {
    _totalSupply = MAX_SUPPLY;
  }

  _gonsPerFragment = TOTAL_GONS.div(_totalSupply);

  emit LogRebase(epoch, _totalSupply);
  return _totalSupply;
}

Parameters help

This function has no parameters.

Properties

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

Parameters help

Name Type
who
address help

Properties

Visibility help public
Mutability help view
Source Code
function balanceOf(address who) public view returns (uint256) {
  return _gonBalances[who].div(_gonsPerFragment);
}

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
  validRecipient(to)
  returns (bool)
{
  uint256 gonValue = value.mul(_gonsPerFragment);
  _gonBalances[msg.sender] = _gonBalances[msg.sender].sub(gonValue);
  _gonBalances[to] = _gonBalances[to].add(gonValue);
  emit Transfer(msg.sender, 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
  returns (uint256)
{
  return _allowedFragments[owner_][spender];
}

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 validRecipient(to) returns (bool) {
  _allowedFragments[from][msg.sender] = _allowedFragments[from][msg.sender].sub(
    value
  );

  uint256 gonValue = value.mul(_gonsPerFragment);
  _gonBalances[from] = _gonBalances[from].sub(gonValue);
  _gonBalances[to] = _gonBalances[to].add(gonValue);
  emit Transfer(from, to, value);

  return true;
}

Parameters help

Name Type
spender
address help
value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address spender, uint256 value) public returns (bool) {
  _allowedFragments[msg.sender][spender] = value;
  emit Approval(msg.sender, spender, value);
  return true;
}

Parameters help

Name Type
spender
address help
addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function increaseAllowance(address spender, uint256 addedValue)
  public
  returns (bool)
{
  _allowedFragments[msg.sender][spender] = _allowedFragments[msg.sender][
    spender
  ]
  .add(addedValue);
  emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]);
  return true;
}

Parameters help

Name Type
spender
address help
subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function decreaseAllowance(address spender, uint256 subtractedValue)
  public
  returns (bool)
{
  uint256 oldValue = _allowedFragments[msg.sender][spender];
  if (subtractedValue >= oldValue) {
    _allowedFragments[msg.sender][spender] = 0;
  } else {
    _allowedFragments[msg.sender][spender] = oldValue.sub(subtractedValue);
  }
  emit Approval(msg.sender, spender, _allowedFragments[msg.sender][spender]);
  return true;
}

setPoolFeePercent keyboard_arrow_up

Parameters help

Name Type
newPer
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setPoolFeePercent(uint256 newPer) public onlyOwner {
  require(newPer >= 0);
  require(newPer < 5);
  POOL_FEE_DAILY_PERCENT = newPer;
}

poolFeeAvailable keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function poolFeeAvailable() public view returns (uint256) {
  uint256 timeBetweenLastPoolBurn = now - lastPoolFeeTime;
  uint256 tokensInUniswapPool = balanceOf(uniswapPool);
  uint256 dayInSeconds = 1 days;
  return
    (
      tokensInUniswapPool.mul(POOL_FEE_DAILY_PERCENT).mul(
        timeBetweenLastPoolBurn
      )
    )
      .div(dayInSeconds)
      .div(100);
}

pretty keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
function pretty() public view returns (uint256) {
  return _totalSupply.div(1e18);
}

processFeePool keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function processFeePool() external onlyOwner {
  // Reset last fee time
  lastPoolFeeTime = now;

  uint256 feeQty = poolFeeAvailable();

  _totalSupply = _totalSupply.sub(feeQty);

  uint256 burnQtyInGons = _gonsPerFragment * feeQty;

  _gonBalances[uniswapPool] = _gonBalances[uniswapPool].sub(burnQtyInGons);
  _gonBalances[_owner] = _gonBalances[_owner].add(burnQtyInGons);

  IUniswapV2Pair(uniswapPool).sync();

  emit PoolFeeDropped(feeQty, balanceOf(uniswapPool));
}

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.