Description:
Multi-signature wallet contract requiring multiple confirmations for transaction execution.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"src/InfoService.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
☞ https://ethos.vision
???? https://x.com/Ethereum_OS
✌︎ https://t.me/ethosportal
Welcome to the Ethereum Operating System — the first-of-its-kind revenue generating DeFi pumpware
built as a social DeFi sandbox that is filled with composable elements so you can create, trade,
communicate, and participate—all in one place.
@
@@:
@@@::
==@@@::::
===@@@:::::
===+@@+::::::
====@@@::::::::
=====@@@:::::::::
======@@@::::::::::
=======@@@:::::::::::
=======*@@+::::::::::::
========@@@::::::::::::::
==========@@@::::::::::::::::
===========@@@:::::::::::::::::
============@@@::::::::::::::::::
============*@@=:::::::::::::::::::
=============@@@:::::::::::::::::::::
=====@@@======@@@::::::::@@@:::::::::::
======@@@======@@@::::::::@@@::::::::::::
=======@@@======@@@::::::::@@@:::::::::::::
=================@@=:::::::::::::::::::::::::
==================%@@::::::::::::::::::::::::::::
===================@@@:::::::::::::::::::::::::::::
====================@@@::::::::::::::::::::::::::::::
=====================@@@:::::::::::::::::::::::::::::::
=====================+@@-::::::::::::::::::::::::::::::::
======================@@@@@@@@@@@@@@*::::::::::::::::::::::
=======================@@@@@@@@@@@@@@::::::::::::::::::::::::
===================================@@@:::::::::::::::::::::::::
=================================@@@:::::::::::::::::::::::
=========@@@@===================@@@::::::::@@@*::::::::::
=========@@@@@@@==============*@@:::::%@@@@@:::::::::::
===========@@@@@@@@@@@#*+=+*@@@@@@@@@@@-:::::::::::
==============+@@@@@@@@@@@@@@@@@@@:::::::::::::::
==========================@@@::::::::::::::::::
========================@@@::::::::::::::::
======================@@@::::::::::::::::
=====================@@@:::::::::::::::
===================@@@:::::::::::::
==================@@@::::::::::::
================*@@=:::::::::::
==============@@@::::::::::
=============@@@:::::::::
============@@@::::::::
==========@@#::::::
========@@@::::::
=======@@@:::::
=====@@@:::
====@@@::
==*@@-:
=@@@:
@
@@@
@@@@@@@@@@@@@@@@@@@ @@@@@@@ ======= ========
@@@@@@@@@@@@@@@@@@ @@@@@ ==== ===== ===== =====
@@@@@ @@ @@@@ ===== ==== ==== ===
@@@@@ @ @@@@ ==== ===== ==== ===
@@@@@ @@@@ ==== ===== ==== ==
@@@@@ @@ @@@@ ===== ===== =====
@@@@@ @ @@@@ @@@@ @ ===== ===== =======
@@@@@ @@ @@@@@@@@@@@@ @@@@ @@@@@@@@ ===== ===== =========
@@@@@@@@@@@@@ @@@@ @@@@@@ @@@@@ ===== ===== =========
@@@@@ @@ @@@@ @@@@@ @@@@@ ===== ===== =========
@@@@@ @@ @@@@ @@@@ @@@@ ===== ===== ========
@@@@@ @@@@ @@@@ @@@@ ====== ===== ======
@@@@@ @@@@ @@@@ @@@@ ===== ===== =====
@@@@@ @@@@ @@@@ @@@@ ===== ===== == =====
@@@@@ @@ @@@@ @@@@ @@@@ ==== ===== === =====
@@@@@ @@@ @@@@@ @@@@ @@@@ ===== ==== ==== ====
@@@@@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@ @@@@@@ ===== ==== ===== =====
@@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@ @@@@@@@@@ ========== =========
*/
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "./math/SafeMathUint.sol";
import "./math/SafeMathInt.sol";
import "interfaces/IUniswapV2Router02.sol";
import "interfaces/IUniswapV2Factory.sol";
import "../interfaces/ITokenSettings.sol";
import "../interfaces/IBooster.sol";
import "../interfaces/IEOS20.sol";
import "./Deployer.sol";
interface IBooster {
function getEosPriceInUsd() external view returns (uint);
}
contract InfoService is Ownable, Pausable, ReentrancyGuard {
// Contracts
IEOS20 public mainToken;
IBooster public booster;
address public ETH_OS;
// States
uint public infoUpdatePrice = 0; // 10 dollars
uint public usernameUpdatePrice = 5; // 10 dollars
uint public avatarUpdatePrice = 5; // 10 dollars
uint public burnedViaUpdates;
uint public burnedViaReactions;
uint public burnedViaUserProfile;
// Mappings
// Reactions
mapping(uint256 => string) public reaction;
mapping(uint256 => uint256) public priceForReaction;
mapping(address => mapping(uint256 => uint256)) public reactionAmount;
// User Profile
mapping(address => string) public userName;
mapping(address => bool) public isUserNameUpdated;
mapping(address => string) public avatar;
mapping(string => bool) public isNameTaken;
mapping(string => address) public nameToAddress;
// Update Socials
mapping(address => string) public Description;
mapping(address => string) public Website;
mapping(address => string) public Socials;
mapping(address => string) public Image;
mapping(address => string) public Chat;
// Constructor
constructor() {
addReaction(1, unicode"????", 0);
addReaction(2, unicode"????", 0);
addReaction(3, unicode"????", 0);
addReaction(4, unicode"⚠️", 0);
addReaction(5, unicode"????", 5e18);
addReaction(6, unicode"????", 5e18);
addReaction(7, unicode"????", 5e18);
addReaction(8, unicode"❤️????", 5e18);
addReaction(9, unicode"????", 0);
addReaction(10, unicode"????", 0);
addReaction(11, unicode"????????", 5e18);
}
// Get Price for Update
function getPriceForUpdate(uint _price) public view returns (uint) {
return _price * 1e18 / booster.getEosPriceInUsd();
}
// Update Socials
function setDescription(address _token, string calldata _description) public {
require(msg.sender == IEOS20(_token).owner(), "Owner only");
if(infoUpdatePrice > 0 && msg.sender != ETH_OS){
uint tokensToBurn = getPriceForUpdate(infoUpdatePrice);
mainToken.transferFrom(msg.sender, address(this), tokensToBurn);
mainToken.burn(tokensToBurn);
burnedViaUpdates += tokensToBurn;
}
Description[_token] = _description;
}
function setWebsite(address _token, string calldata _website) public {
require(msg.sender == IEOS20(_token).owner(), "Owner only");
if(infoUpdatePrice > 0 && msg.sender != ETH_OS){
uint tokensToBurn = getPriceForUpdate(infoUpdatePrice);
mainToken.transferFrom(msg.sender, address(this), tokensToBurn);
mainToken.burn(tokensToBurn);
burnedViaUpdates += tokensToBurn;
}
Website[_token] = _website;
}
function setSocials(address _token, string calldata _socials) public {
require(msg.sender == IEOS20(_token).owner(), "Owner only");
if(infoUpdatePrice > 0 && msg.sender != ETH_OS){
uint tokensToBurn = getPriceForUpdate(infoUpdatePrice);
mainToken.transferFrom(msg.sender, address(this), tokensToBurn);
mainToken.burn(tokensToBurn);
burnedViaUpdates += tokensToBurn;
}
Socials[_token] = _socials;
}
function setImage(address _token, string calldata _image) public {
require(msg.sender == IEOS20(_token).owner(), "Owner only");
if(infoUpdatePrice > 0 && msg.sender != ETH_OS){
uint tokensToBurn = getPriceForUpdate(infoUpdatePrice);
mainToken.transferFrom(msg.sender, address(this), tokensToBurn);
mainToken.burn(tokensToBurn);
burnedViaUpdates += tokensToBurn;
}
Image[_token] = _image;
}
function setChat(address _token, string calldata _chat) public {
require(msg.sender == IEOS20(_token).owner(), "Owner only");
if(infoUpdatePrice > 0 && msg.sender != ETH_OS){
uint tokensToBurn = getPriceForUpdate(infoUpdatePrice);
mainToken.transferFrom(msg.sender, address(this), tokensToBurn);
mainToken.burn(tokensToBurn);
burnedViaUpdates += tokensToBurn;
}
Chat[_token] = _chat;
}
// User Profile
function setUserName(string calldata _name) public {
require(!isNameTaken[_name], "Name already taken");
if(usernameUpdatePrice > 0){
uint tokensToBurn = getPriceForUpdate(usernameUpdatePrice);
mainToken.transferFrom(msg.sender, address(this), tokensToBurn);
mainToken.burn(tokensToBurn);
burnedViaUserProfile += tokensToBurn;
}
if(isUserNameUpdated[msg.sender]){
isNameTaken[userName[msg.sender]] = false;
nameToAddress[userName[msg.sender]] = address(0);
}
userName[msg.sender] = _name;
nameToAddress[_name] = msg.sender;
isNameTaken[_name] = true;
isUserNameUpdated[msg.sender] = true;
}
function setAvatar(string calldata _avatar) public {
if(avatarUpdatePrice > 0){
uint tokensToBurn = getPriceForUpdate(avatarUpdatePrice);
mainToken.transferFrom(msg.sender, address(this), tokensToBurn);
mainToken.burn(tokensToBurn);
burnedViaUserProfile += tokensToBurn;
}
avatar[msg.sender] = _avatar;
}
// Reactions
function addReaction(uint256 id, string memory _reaction, uint256 _price) public onlyOwner {
priceForReaction[id] = _price;
reaction[id] = _reaction;
}
function react(address _token, uint256 id) public {
if(priceForReaction[id] > 0){
uint256 tokensToBurn = getPriceForUpdate(priceForReaction[id]);
mainToken.transferFrom(msg.sender, address(this), tokensToBurn);
mainToken.burn(tokensToBurn);
burnedViaReactions += tokensToBurn;
}
reactionAmount[_token][id] += 1;
}
// Admin
function setEthOS(address _ethOS) public onlyOwner {
ETH_OS = _ethOS;
}
function setBooster(address _booster) public onlyOwner {
booster = IBooster(_booster);
}
function setMainToken(address _mainToken) public onlyOwner {
mainToken = IEOS20(_mainToken);
}
function setPricesForUpdates(uint _info) public onlyOwner {
infoUpdatePrice = _info;
}
function setPriceForUserName(uint _price) public onlyOwner {
usernameUpdatePrice = _price;
}
function setPriceForAvatar(uint _price) public onlyOwner {
avatarUpdatePrice = _price;
}
}
"
},
"lib/openzeppelin-contracts/contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
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() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
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 {
_transferOwnership(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");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
"
},
"lib/openzeppelin-contracts/contracts/utils/math/SafeMath.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// 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 (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @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) {
return a + b;
}
/**
* @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 a - b;
}
/**
* @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) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting 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 a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting 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) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* 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) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
"
},
"lib/openzeppelin-contracts/contracts/security/Pausable.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
"
},
"lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
"
},
"src/math/SafeMathUint.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.1;
/**
* @title SafeMathUint
* @dev Math operations with safety checks that revert on error
*/
library SafeMathUint {
function toInt256Safe(uint256 a) internal pure returns (int256) {
int256 b = int256(a);
require(b >= 0);
return b;
}
}
"
},
"src/math/SafeMathInt.sol": {
"content": "// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.1;
/**
* @title SafeMathInt
* @dev Math operations with safety checks that revert on error
* @dev SafeMath adapted for int256
* Based on code of https://github.com/RequestNetwork/requestNetwork/blob/master/packages/requestNetworkSmartContracts/contracts/base/math/SafeMathInt.sol
*/
library SafeMathInt {
function mul(int256 a, int256 b) internal pure returns (int256) {
// Prevent overflow when multiplying INT256_MIN with -1
// https://github.com/RequestNetwork/requestNetwork/issues/43
require(!(a == -2 ** 255 && b == -1) && !(b == -2 ** 255 && a == -1));
int256 c = a * b;
require((b == 0) || (c / b == a));
return c;
}
function div(int256 a, int256 b) internal pure returns (int256) {
// Prevent overflow when dividing INT256_MIN by -1
// https://github.com/RequestNetwork/requestNetwork/issues/43
require(!(a == -2 ** 255 && b == -1) && (b > 0));
return a / b;
}
function sub(int256 a, int256 b) internal pure returns (int256) {
require((b >= 0 && a - b <= a) || (b < 0 && a - b > a));
return a - b;
}
function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a));
return c;
}
function toUint256Safe(int256 a) internal pure returns (uint256) {
require(a >= 0);
return uint256(a);
}
}
"
},
"interfaces/IUniswapV2Router02.sol": {
"content": "pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function launch(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
uint8 buyLpFee,
uint8 sellLpFee,
uint8 buyProtocolFee,
uint8 sellProtocolFee,
address protocolAddress
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
"
},
"interfaces/IUniswapV2Factory.sol": {
"content": "pragma solidity >=0.5.0;
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;
}"
},
"interfaces/ITokenSettings.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ITokenSettings {
struct TokenSettings {
string name;
string symbol;
address router;
// address owner;
// address deployer;
string description;
string website;
string image;
string chat;
string socials;
uint256 devFee;
uint256 reflectionsPercent;
uint256 liquidityPercent;
uint256 maxDailyPumpRate;
uint256 reaperDeathTime;
uint256 cooldown;
uint256 winAmountPercent;
uint256 apy;
uint256 devSupply;
uint256 devDeadline;
uint256 burnPercentBuy;
uint256 burnPercentSell;
uint256 maxWallet;
bool antiBot;
}
} "
},
"interfaces/IBooster.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IBOOSTER {
function mainToken() external view returns (address);
function balanceOf(address _user) external view returns (uint256);
function bonusEOS(address _user) external view returns (uint256);
function getEosPriceInUsd() external view returns (uint);
}"
},
"interfaces/IEOS20.sol": {
"content": "pragma solidity ^0.8.0;
interface IEOS20 {
// FOR ETH OS
function initializeToken(address owner, address router, address deployer, uint256 _devDeadline) external;
function setSpecs(
uint256 _devFeePercent,
uint256 _maxDailyPumpRate,
uint256 _reflectionsPercent,
uint256 _liquidityPercent,
uint256 _reaperDeathTime,
uint256 _cooldown,
uint256 _winAmountPercent,
uint256 _apy,
uint256 _burnPercentBuy,
uint256 _burnPercentSell
) external;
function transferOwnershipOfTheToken(address) external;
function openTrading(bool _tradingOpen) external;
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function owner() external view returns (address);
function timeCreated() external view returns (uint256);
function deploymentBlock() external view returns (uint);
function uniswapV2Pair() external view returns (address);
function uniswapV2Router() external view returns (address);
function antiBot() external view returns (bool);
function maxWalletPercent() external view returns (uint);
function toggleYield(bool toggle) external;
function tradingOpen() external view returns (bool);
function yieldOn() external view returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
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 totalShares() external view returns (uint256);
function burn(uint256 _amount) external;
function getReserves() external view returns (uint112, uint112);
function getQuote(uint256 amountA, uint256 reserveA, uint256 reserveB) external view returns (uint256);
function lastBuyTimestamp() external view returns (uint256);
function reflectionsPercent() external view returns (uint256);
function liquidityPercent() external view returns (uint256);
function winAmountPercent() external view returns (uint256);
function devFeePercent() external view returns (uint256);
function burnPercentageBuy() external view returns (uint256);
function burnPercentageSell() external view returns (uint256);
function deathTime() external view returns (uint256);
function apy() external view returns (uint256);
function share(address user) external view returns (uint256);
function shares(address user) external view returns (uint256);
function ethAccumulated(address user) external view returns (uint256);
function ethAccumulatedForUi(address _user) external view returns (uint256);
function ethWithdrawn(address user) external view returns (uint256);
function ethWithdrawnForUi(address user) external view returns (uint256);
function totalEthDistributed() external view returns (uint256);
function devWithdrawn() external view returns (uint256);
function lpAdded() external view returns (uint256);
function pendingPonziTokens(address _user) external view returns (uint256);
function devClaimableEth() external view returns (uint256);
function lastPumpTimestamp() external view returns (uint256);
function maxDailyPumpRate() external view returns (uint256);
function pumpIsPublic() external view returns (bool);
function firstReceivedBlockTimeStamp(address) external view returns (uint256);
function immortal(address _user) external view returns (bool);
function deathStartedTimestamp() external view returns (uint256);
function cooldown() external view returns (uint256);
function winAmount() external view returns (uint256);
function currentWinner() external view returns (address);
function ponziStart() external view returns (uint256);
function mintBonus(uint256 amount, address _user) external;
function setMaxWallet(bool _antiBot, uint256 _maxWallet) external;
function volumeAmount() external view returns (uint256);
}
"
},
"src/Deployer.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
☞ https://ethos.vision
???? https://x.com/Ethereum_OS
✌︎ https://t.me/ethosportal
Welcome to the Ethereum Operating System — the first-of-its-kind revenue generating DeFi pumpware
built as a social DeFi sandbox that is filled with composable elements so you can create, trade,
communicate, and participate—all in one place.
@
@@:
@@@::
==@@@::::
===@@@:::::
===+@@+::::::
====@@@::::::::
=====@@@:::::::::
======@@@::::::::::
=======@@@:::::::::::
=======*@@+::::::::::::
========@@@::::::::::::::
==========@@@::::::::::::::::
===========@@@:::::::::::::::::
============@@@::::::::::::::::::
============*@@=:::::::::::::::::::
=============@@@:::::::::::::::::::::
=====@@@======@@@::::::::@@@:::::::::::
======@@@======@@@::::::::@@@::::::::::::
=======@@@======@@@::::::::@@@:::::::::::::
=================@@=:::::::::::::::::::::::::
==================%@@::::::::::::::::::::::::::::
===================@@@:::::::::::::::::::::::::::::
====================@@@::::::::::::::::::::::::::::::
=====================@@@:::::::::::::::::::::::::::::::
=====================+@@-::::::::::::::::::::::::::::::::
======================@@@@@@@@@@@@@@*::::::::::::::::::::::
=======================@@@@@@@@@@@@@@::::::::::::::::::::::::
===================================@@@:::::::::::::::::::::::::
=================================@@@:::::::::::::::::::::::
=========@@@@===================@@@::::::::@@@*::::::::::
=========@@@@@@@==============*@@:::::%@@@@@:::::::::::
===========@@@@@@@@@@@#*+=+*@@@@@@@@@@@-:::::::::::
==============+@@@@@@@@@@@@@@@@@@@:::::::::::::::
==========================@@@::::::::::::::::::
========================@@@::::::::::::::::
======================@@@::::::::::::::::
=====================@@@:::::::::::::::
===================@@@:::::::::::::
==================@@@::::::::::::
================*@@=:::::::::::
==============@@@::::::::::
=============@@@:::::::::
============@@@::::::::
==========@@#::::::
========@@@::::::
=======@@@:::::
=====@@@:::
====@@@::
==*@@-:
=@@@:
@
@@@
@@@@@@@@@@@@@@@@@@@ @@@@@@@ ======= ========
@@@@@@@@@@@@@@@@@@ @@@@@ ==== ===== ===== =====
@@@@@ @@ @@@@ ===== ==== ==== ===
@@@@@ @ @@@@ ==== ===== ==== ===
@@@@@ @@@@ ==== ===== ==== ==
@@@@@ @@ @@@@ ===== ===== =====
@@@@@ @ @@@@ @@@@ @ ===== ===== =======
@@@@@ @@ @@@@@@@@@@@@ @@@@ @@@@@@@@ ===== ===== =========
@@@@@@@@@@@@@ @@@@ @@@@@@ @@@@@ ===== ===== =========
@@@@@ @@ @@@@ @@@@@ @@@@@ ===== ===== =========
@@@@@ @@ @@@@ @@@@ @@@@ ===== ===== ========
@@@@@ @@@@ @@@@ @@@@ ====== ===== ======
@@@@@ @@@@ @@@@ @@@@ ===== ===== =====
@@@@@ @@@@ @@@@ @@@@ ===== ===== == =====
@@@@@ @@ @@@@ @@@@ @@@@ ==== ===== === =====
@@@@@ @@@ @@@@@ @@@@ @@@@ ===== ==== ==== ====
@@@@@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@ @@@@@@ ===== ==== ===== =====
@@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@ @@@@@@@@@ ========== =========
*/
import "./EOS20.sol";
contract Deployer{
function createTokenViaInterface(string memory name, string memory symbol, address _ethOs, bytes32 salt) public returns (address) {
EOS20 newToken = salt == 0 ? new EOS20(name, symbol, _ethOs) : new EOS20{salt: salt}(name, symbol, _ethOs);
return address(newToken);
}
}"
},
"lib/openzeppelin-contracts/contracts/utils/Context.sol": {
"content": "// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
"
},
"interfaces/IUniswapV2Router01.sol": {
"content": "pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}"
},
"src/EOS20.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
☞ https://ethos.vision
???? https://x.com/Ethereum_OS
✌︎ https://t.me/ethosportal
Welcome to the Ethereum Operating System — the first-of-its-kind revenue generating DeFi pumpware
built as a social DeFi sandbox that is filled with composable elements so you can create, trade,
communicate, and participate—all in one place.
@
@@:
@@@::
==@@@::::
===@@@:::::
===+@@+::::::
====@@@::::::::
=====@@@:::::::::
======@@@::::::::::
=======@@@:::::::::::
=======*@@+::::::::::::
========@@@::::::::::::::
==========@@@::::::::::::::::
===========@@@:::::::::::::::::
============@@@::::::::::::::::::
============*@@=:::::::::::::::::::
=============@@@:::::::::::::::::::::
=====@@@======@@@::::::::@@@:::::::::::
======@@@======@@@::::::::@@@::::::::::::
=======@@@======@@@::::::::@@@:::::::::::::
=================@@=:::::::::::::::::::::::::
==================%@@::::::::::::::::::::::::::::
===================@@@:::::::::::::::::::::::::::::
====================@@@::::::::::::::::::::::::::::::
=====================@@@:::::::::::::::::::::::::::::::
=====================+@@-::::::::::::::::::::::::::::::::
======================@@@@@@@@@@@@@@*::::::::::::::::::::::
=======================@@@@@@@@@@@@@@::::::::::::::::::::::::
===================================@@@:::::::::::::::::::::::::
=================================@@@:::::::::::::::::::::::
=========@@@@===================@@@::::::::@@@*::::::::::
=========@@@@@@@==============*@@:::::%@@@@@:::::::::::
===========@@@@@@@@@@@#*+=+*@@@@@@@@@@@-:::::::::::
==============+@@@@@@@@@@@@@@@@@@@:::::::::::::::
==========================@@@::::::::::::::::::
========================@@@::::::::::::::::
======================@@@::::::::::::::::
=====================@@@:::::::::::::::
===================@@@:::::::::::::
==================@@@::::::::::::
================*@@=:::::::::::
==============@@@::::::::::
=============@@@:::::::::
============@@@::::::::
==========@@#::::::
========@@@::::::
=======@@@:::::
=====@@@:::
====@@@::
==*@@-:
=@@@:
@
@@@
@@@@@@@@@@@@@@@@@@@ @@@@@@@ ======= ========
@@@@@@@@@@@@@@@@@@ @@@@@ ==== ===== ===== =====
@@@@@ @@ @@@@ ===== ==== ==== ===
@@@@@ @ @@@@ ==== ===== ==== ===
@@@@@ @@@@ ==== ===== ==== ==
@@@@@ @@ @@@@ ===== ===== =====
@@@@@ @ @@@@ @@@@ @ ===== ===== =======
@@@@@ @@ @@@@@@@@@@@@ @@@@ @@@@@@@@ ===== ===== =========
@@@@@@@@@@@@@ @@@@ @@@@@@ @@@@@ ===== ===== =========
@@@@@ @@ @@@@ @@@@@ @@@@@ ===== ===== =========
@@@@@ @@ @@@@ @@@@ @@@@ ===== ===== ========
@@@@@ @@@@ @@@@ @@@@ ====== ===== ======
@@@@@ @@@@ @@@@ @@@@ ===== ===== =====
@@@@@ @@@@ @@@@ @@@@ ===== ===== == =====
@@@@@ @@ @@@@ @@@@ @@@@ ==== ===== === =====
@@@@@ @@@ @@@@@ @@@@ @@@@ ===== ==== ==== ====
@@@@@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@ @@@@@@ ===== ==== ===== =====
@@@@@@@@@@@@@@@@@@@@ @@@@@@ @@@@@@@@@ @@@@@@@@@ ========== =========
*/
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "./math/SafeMathUint.sol";
import "./math/SafeMathInt.sol";
import "interfaces/IUniswapV2Router02.sol";
import "interfaces/IUniswapV2Pair.sol";
import "interfaces/IUniswapV2Factory.sol";
import "../interfaces/ITokenSettings.sol";
import "../interfaces/IBooster.sol";
interface IETH_OS {
function owner() external view returns (address);
function ecoFeePercent() external view returns (uint256);
function ecoFriendly(address _token) external view returns (bool);
function ecoFriendlyFeePercent() external view returns (uint256);
function ecoFeeOn() external view returns (bool);
function projectClaimFee() external view returns (uint256);
function projectWallet() external view returns (address);
function initialLiquidity(address) external view returns (uint256);
function isEligibleToMintBonus(address _user) external view returns (bool);
function booster() external view returns (address);
function calculatePump(address _token) external view returns (uint256 burnAmount, uint256 pumpNow, uint256 desiredPrice, uint256 price);
function getTimeLeft(address _token) external view returns (uint256);
function isAlive(address _token, address _user) external view returns (bool);
function calculateMaxSell(address _token) external view returns (uint256);
function isBooster(address _token) external view returns (bool);
function mainToken() external view returns (address);
function projectTradeFee() external view returns (uint256);
function minDeathTime() external view returns (uint256);
function maxReflectionPercent() external view returns (uint256);
function maxDailyPumpRate() external view returns (uint256);
function calculateMaxSellForCA(address _token, uint256 _userValue) external view returns (uint256);
function minBuy(address) external view returns (uint256);
function maxWallet(address) external view returns(uint);
function minReflectionsSwap(address) external view returns(uint);
function maxReflectionsSwap(address) external view returns(uint);
function maxBurnPercentage() external view returns(uint);
function maxDevFeePercent() external view returns(uint);
// function isMacroAvalaible() external view returns(bool);
function checkRequirements(uint256 _devFeePercent, uint256 _maxDailyPumpRate,
uint256 _reflectionsPercent, uint256 _liquidityPercent, uint256 _reaperDeathTime,
uint256 _cooldown, uint256 _winAmountPercent, uint256 _apy,
uint256 _burnPercentageBuy, uint256 _burnPercentageSell, address _token) external view returns (bool);
function eosPortionDivider() external view returns(uint);
function infoService() external view returns(address);
function isAuthorizedToClaim(address _user) external view returns(bool);
function lock() external view returns(address);
}
/// @title EOS20 — Eth OS token
/// @author ethjobs
/// @notice ERC20 token that integrates with the Ethereum Operating System.
/// @dev Public/external functions include NatSpec so they render on Etherscan's Read/Write tabs.
contract EOS20 is ERC20, Ownable, ReentrancyGuard, ITokenSettings {
// Libraries
using SafeMath for uint256;
using SafeMath for uint112;
using SafeMathUint for uint256;
using SafeMathInt for int256;
// Contracts
/// @notice ETH_OS orchestrator address.
address public ETH_OS;
/// @notice ETH_OS typed interface.
IETH_OS public ethOs;
/// @notice Uniswap V2 pair for (this token, WETH).
IUniswapV2Pair public uniswapV2Pair;
/// @notice Uniswap V2 router used for swaps and liquidity.
IUniswapV2Router02 public uniswapV2Router;
/// @notice Uniswap V2 factory reference.
IUniswapV2Factory public uniswapFactory;
/// @notice Wrapped ETH address used by the router.
address payable WETH;
// States
// SETTINGS
/// @notice Timestamp when the token was created.
uint256 public timeCreated;
/// @notice Block number when the token was deployed.
uint256 public deploymentBlock;
/// @dev Internal swap lock flag.
bool inSwap = false;
/// @notice When true, prevents draining LP by enforcing max sell.
bool public drainIsForbidden = true;
/// @notice Anti-bot mode for max wallet enforcement on buys.
bool public antiBot = false;
/// @notice Max wallet size as a percent of total supply (1–100).
uint public maxWalletPercent = 100;
Submitted on: 2025-09-17 15:24:12
Comments
Log in to comment.
No comments yet.