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
Constants (6) keyboard_arrow_up
State Variables (13) keyboard_arrow_up
Functions
owner 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;
}
updateBranding keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function updateBranding(string memory newName, string memory newSymbol)
public
onlyOwner
{
name = newName;
symbol = newSymbol;
}
transferFeeTaker keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function transferFeeTaker(address newFeeTaker) public virtual onlyOwner {
emit FeeTakerTransferred(_feeTaker, newFeeTaker);
_feeTaker = newFeeTaker;
}
feeTaker keyboard_arrow_up
rebasePer keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
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
Modifiers help
onlyOwner checks for the following:
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;
}
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
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;
}
allowance keyboard_arrow_up
transferFrom keyboard_arrow_up
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;
}
approve keyboard_arrow_up
Source Code
function approve(address spender, uint256 value) public returns (bool) {
_allowedFragments[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
increaseAllowance keyboard_arrow_up
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;
}
decreaseAllowance keyboard_arrow_up
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
Modifiers help
onlyOwner checks for the following:
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.
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
processFeePool keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyOwner checks for the following:
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
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.