DOS Network Token
ERC20
This contract is an ERC20 token.
Name
DOS Network Token
Symbol
DOS
Decimals
18
Total Supply
950,000,000 DOS
About
Stats
Public Functions
17
Event Types
5
Code Size
12,079 bytes
Events (5) keyboard_arrow_up
State Variables (7) keyboard_arrow_up
Functions
changeManager keyboard_arrow_up
Modifiers help
onlyManager checks for the following:
Source Code
function changeManager(address _newManager) public onlyManager {
manager = _newManager;
}
setOwner keyboard_arrow_up
setAuthority keyboard_arrow_up
Modifiers help
auth checks for the following:
null
Source Code
function setAuthority(DSAuthority authority_) public auth {
authority = authority_;
emit LogSetAuthority(address(authority));
}
stop keyboard_arrow_up
start keyboard_arrow_up
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
allowance keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address dst, uint256 wad) public returns (bool) {
return transferFrom(msg.sender, dst, wad);
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address src,
address dst,
uint256 wad
) public stoppable returns (bool) {
require(_balances[src] >= wad, "token-insufficient-balance");
// Adjust token transfer amount if necessary.
if (isContract(manager)) {
wad = ControllerManager(manager).onTransfer(src, _balances[src], wad);
require(wad > 0, "transfer-disabled-by-ControllerManager");
}
if (src != msg.sender && _approvals[src][msg.sender] != uint256(-1)) {
require(_approvals[src][msg.sender] >= wad, "token-insufficient-approval");
_approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad);
}
_balances[src] = sub(_balances[src], wad);
_balances[dst] = add(_balances[dst], wad);
emit Transfer(src, dst, wad);
return true;
}
approve keyboard_arrow_up
Requirements help
One or more of the following:
Source Code
function approve(address guy, uint256 wad) public stoppable returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_guy, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((wad == 0) || (_approvals[msg.sender][guy] == 0));
_approvals[msg.sender][guy] = wad;
emit Approval(msg.sender, guy, wad);
return true;
}
approve keyboard_arrow_up
Requirements help
One or more of the following:
Source Code
function approve(address guy) public stoppable returns (bool) {
return approve(guy, uint256(-1));
}
burn keyboard_arrow_up
mint keyboard_arrow_up
Modifiers help
auth checks for the following:
null
stoppable checks for the following:
Requirements help
Source Code
function mint(address guy, uint256 wad) public auth stoppable {
_balances[guy] = add(_balances[guy], wad);
_supply = add(_supply, wad);
require(_supply <= MAX_SUPPLY, "Total supply overflow");
emit Transfer(address(0), guy, wad);
}
burn keyboard_arrow_up
Modifiers help
auth checks for the following:
null
stoppable checks for the following:
Requirements help
Source Code
function burn(address guy, uint256 wad) public auth stoppable {
if (guy != msg.sender && _approvals[guy][msg.sender] != uint256(-1)) {
require(_approvals[guy][msg.sender] >= wad, "token-insufficient-approval");
_approvals[guy][msg.sender] = sub(_approvals[guy][msg.sender], wad);
}
require(_balances[guy] >= wad, "token-insufficient-balance");
_balances[guy] = sub(_balances[guy], wad);
_supply = sub(_supply, wad);
emit Transfer(guy, address(0), wad);
}
constructor keyboard_arrow_up
claimTokens keyboard_arrow_up
Modifiers help
auth checks for the following:
null
Source Code
function claimTokens(address _token, address payable _dst) public auth {
if (_token == address(0)) {
_dst.transfer(address(this).balance);
return;
}
ERC20 token = ERC20(_token);
uint256 balance = token.balanceOf(address(this));
token.transfer(_dst, balance);
}
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 DSMath.add keyboard_arrow_up
Source Code
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
internal DSMath.sub keyboard_arrow_up
Source Code
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
internal DSMath.mul keyboard_arrow_up
Requirements help
Source Code
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
internal DSMath.min keyboard_arrow_up
internal DSMath.max keyboard_arrow_up
internal DSMath.imin keyboard_arrow_up
internal DSMath.imax keyboard_arrow_up
internal DSMath.wmul keyboard_arrow_up
internal DSMath.rmul keyboard_arrow_up
internal DSMath.wdiv keyboard_arrow_up
internal DSMath.rdiv keyboard_arrow_up
internal DSMath.rpow keyboard_arrow_up
Source Code
function rpow(uint256 x, uint256 n) internal pure returns (uint256 z) {
z = n % 2 != 0 ? x : RAY;
for (n /= 2; n != 0; n /= 2) {
x = rmul(x, x);
if (n % 2 != 0) {
z = rmul(z, x);
}
}
}
internal DSAuth.isAuthorized keyboard_arrow_up
Source Code
function isAuthorized(address src, bytes4 sig) internal view returns (bool) {
if (src == address(this)) {
return true;
} else if (src == owner) {
return true;
} else if (authority == DSAuthority(0)) {
return false;
} else {
return authority.canCall(src, address(this), sig);
}
}