Unnamed: 0 int64 0 7.36k | comments stringlengths 3 35.2k | code_string stringlengths 1 527k | code stringlengths 1 527k | __index_level_0__ int64 0 88.6k |
|---|---|---|---|---|
47 | // List of administrators. | mapping(address => bool) public admins;
event AdminAdded(address indexed _address);
event AdminRemoved(address indexed _address);
| mapping(address => bool) public admins;
event AdminAdded(address indexed _address);
event AdminRemoved(address indexed _address);
| 49,581 |
9 | // Min ratio of collat <-> 3crv conversions via add_liquidity / remove_liquidity; 1e6 | uint256 public liq_slippage_3crv = 900000;
| uint256 public liq_slippage_3crv = 900000;
| 30,065 |
80 | // taking the whole part only from the division and limiting to the max pods number that can be won | uint256 podsWon = Math.min(userBid / _price, _maxPodsPerWallet);
| uint256 podsWon = Math.min(userBid / _price, _maxPodsPerWallet);
| 17,521 |
0 | // keccak256("TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)") | bytes32
public constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH = 0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267;
| bytes32
public constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH = 0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267;
| 21,601 |
9 | // validate.1. Only the service owner can register any phonenumber2. sender can register only entry for itself address | if(owner == msg.sender){
phonebookByNumber[phonenumber].entryAddress = adrs;
} else {
| if(owner == msg.sender){
phonebookByNumber[phonenumber].entryAddress = adrs;
} else {
| 11,021 |
48 | // function getOptionBalances(address user) external view returns(uint256[]); |
function getExpirationList()external view returns (uint32[] memory);
function createOptions(address from,address settlement,uint256 type_ly_expiration,
uint128 strikePrice,uint128 underlyingPrice,uint128 amount,uint128 settlePrice) external returns(uint256);
function setSharedState(uint256 newFirstOption,int256[] calldata latestNetWorth,address[] calldata whiteList) external;
function getAllTotalOccupiedCollateral() external view returns (uint256,uint256);
function getCallTotalOccupiedCollateral() external view returns (uint256);
function getPutTotalOccupiedCollateral() external view returns (uint256);
function getTotalOccupiedCollateral() external view returns (uint256);
|
function getExpirationList()external view returns (uint32[] memory);
function createOptions(address from,address settlement,uint256 type_ly_expiration,
uint128 strikePrice,uint128 underlyingPrice,uint128 amount,uint128 settlePrice) external returns(uint256);
function setSharedState(uint256 newFirstOption,int256[] calldata latestNetWorth,address[] calldata whiteList) external;
function getAllTotalOccupiedCollateral() external view returns (uint256,uint256);
function getCallTotalOccupiedCollateral() external view returns (uint256);
function getPutTotalOccupiedCollateral() external view returns (uint256);
function getTotalOccupiedCollateral() external view returns (uint256);
| 80,403 |
393 | // If setting a new controller should be allowed during this funding cycle. | bool allowSetController;
| bool allowSetController;
| 81,454 |
5 | // SafeGuardFactory - factory contract for deploying SafeGuard contracts / | contract SafeGuardFactory {
/// @notice Address of the safeGuard registry
address public registry;
/// @notice The version of the rol manager
uint8 public constant SAFE_GUARD_VERSION = 1;
/// @notice Event emitted once new safeGuard is deployed
event SafeGuardCreated(
address indexed admin,
address indexed safeGuardAddress,
address indexed timelockAddress,
string safeName
);
constructor(address registry_) {
registry = registry_;
}
/**
* @notice Creates new instance of a SafeGuard contract
*/
function createSafeGuard(uint delay_, string memory safeGuardName, address admin, bytes32[] memory roles, address[] memory rolesAssignees) external returns (address) {
require(roles.length == rolesAssignees.length, "SafeGuardFactory::create: roles assignment arity mismatch");
SafeGuard safeGuard = new SafeGuard(admin, roles, rolesAssignees);
Timelock timelock = new Timelock(address(safeGuard), delay_);
safeGuard.setTimelock(address(timelock));
IRegistry(registry).register(address(safeGuard), SAFE_GUARD_VERSION);
emit SafeGuardCreated(admin, address(safeGuard), address(timelock), safeGuardName);
return address(safeGuard);
}
}
| contract SafeGuardFactory {
/// @notice Address of the safeGuard registry
address public registry;
/// @notice The version of the rol manager
uint8 public constant SAFE_GUARD_VERSION = 1;
/// @notice Event emitted once new safeGuard is deployed
event SafeGuardCreated(
address indexed admin,
address indexed safeGuardAddress,
address indexed timelockAddress,
string safeName
);
constructor(address registry_) {
registry = registry_;
}
/**
* @notice Creates new instance of a SafeGuard contract
*/
function createSafeGuard(uint delay_, string memory safeGuardName, address admin, bytes32[] memory roles, address[] memory rolesAssignees) external returns (address) {
require(roles.length == rolesAssignees.length, "SafeGuardFactory::create: roles assignment arity mismatch");
SafeGuard safeGuard = new SafeGuard(admin, roles, rolesAssignees);
Timelock timelock = new Timelock(address(safeGuard), delay_);
safeGuard.setTimelock(address(timelock));
IRegistry(registry).register(address(safeGuard), SAFE_GUARD_VERSION);
emit SafeGuardCreated(admin, address(safeGuard), address(timelock), safeGuardName);
return address(safeGuard);
}
}
| 23,942 |
208 | // How much referral income a given referrer has claimed. | mapping (address => uint256) public referralCommissionClaimed;
| mapping (address => uint256) public referralCommissionClaimed;
| 70,739 |
25 | // this function strictly sets accomplishments to the provided argument but also publishes the change from the current state as an audit trail | function setAccomplishments(uint256 _accomplishments) external onlyOwner {
emit AccomplishmentsUpdated(
_accomplishments ^ accomplishments,
_accomplishments
);
accomplishments = _accomplishments;
}
| function setAccomplishments(uint256 _accomplishments) external onlyOwner {
emit AccomplishmentsUpdated(
_accomplishments ^ accomplishments,
_accomplishments
);
accomplishments = _accomplishments;
}
| 19,332 |
44 | // It is called by contribute to determine amount of tokens for given contribution | // @return tokensToPurchase {uint} value of tokens to purchase
function calculateNoOfTokensToSend() view internal returns(uint) {
uint tokenAmount = safeMul(msg.value, 1e18) / tokenPriceWei;
uint ethAmount = msg.value;
if (ethAmount >= 50 ether)
return tokenAmount + (tokenAmount * 5) / 100; // 5% percent bonus
else if (ethAmount >= 15 ether)
return tokenAmount + (tokenAmount * 25) / 1000; // 2.5% percent bonus
else
return tokenAmount;
}
| // @return tokensToPurchase {uint} value of tokens to purchase
function calculateNoOfTokensToSend() view internal returns(uint) {
uint tokenAmount = safeMul(msg.value, 1e18) / tokenPriceWei;
uint ethAmount = msg.value;
if (ethAmount >= 50 ether)
return tokenAmount + (tokenAmount * 5) / 100; // 5% percent bonus
else if (ethAmount >= 15 ether)
return tokenAmount + (tokenAmount * 25) / 1000; // 2.5% percent bonus
else
return tokenAmount;
}
| 37,313 |
88 | // solhint-disable-next-line max-line-length | require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
| require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
| 1,803 |
83 | // Sets {decimals} to a value other than the default one of 18. WARNING: This function should only be called from the constructor. Most applications that interact with token contracts will not expect {decimals} to ever change, and may work incorrectly if it does./ | function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
| function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
| 16,172 |
335 | // Function to create a contractor smart contract/_contractorCreator The contractor creator smart contract/_recipient The recipient of the contractor smart contract/_metaProject True if meta project/_passProject The project smart contract (not mandatory)/_projectName The name of the project (if the project smart contract doesn't exist)/_projectDescription A description of the project (not mandatory, can be updated after)/ return The contractor smart contract | function createContractor(
PassContractorCreator _contractorCreator,
address _recipient,
bool _metaProject,
PassProject _passProject,
string _projectName,
string _projectDescription) returns (PassContractor);
| function createContractor(
PassContractorCreator _contractorCreator,
address _recipient,
bool _metaProject,
PassProject _passProject,
string _projectName,
string _projectDescription) returns (PassContractor);
| 7,611 |
22 | // minting(added) | function mint(address _to, uint256 _id,
uint256 _quantity,
bytes memory _data)
public
creatorOnly(_id)
| function mint(address _to, uint256 _id,
uint256 _quantity,
bytes memory _data)
public
creatorOnly(_id)
| 12,057 |
0 | // ================ Constants =================== // bridge id is mapped to its execution address. maps all the bridges to their address. / | mapping(uint8 => address) public bridgeAddress;
| mapping(uint8 => address) public bridgeAddress;
| 13,004 |
356 | // round 47 | ark(i, q, 2716062168542520412498610856550519519760063668165561277991771577403400784706);
sbox_partial(i, q);
mix(i, q);
| ark(i, q, 2716062168542520412498610856550519519760063668165561277991771577403400784706);
sbox_partial(i, q);
mix(i, q);
| 31,629 |
28 | // mint can be finished and token become fixed for forever | event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
| event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
| 41,823 |
15 | // Execute a multi-signature transaction from this wallet using 2 signers: one from msg.sender and the other from ecrecover.toAddress the destination address to send an outgoing transaction value the amount in Wei to be sent data the data to send to the toAddress when invoking the transaction expireTime the number of seconds since 1970 for which this transaction is valid orderId the unique order idallSigners the signer who sign tx signatures the signatures of tx / | function sendMultiSig(
address toAddress,
uint value,
bytes data,
uint expireTime,
uint64 orderId,
address[] allSigners,
bytes[] signatures
| function sendMultiSig(
address toAddress,
uint value,
bytes data,
uint expireTime,
uint64 orderId,
address[] allSigners,
bytes[] signatures
| 12,219 |
210 | // Withdraw funds as owner | function withdraw() external onlyOwner {
uint balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
| function withdraw() external onlyOwner {
uint balance = address(this).balance;
payable(msg.sender).transfer(balance);
}
| 40,453 |
15 | // Disallow transfers to this contract to prevent accidental misuse. The contract should never own any tiles. | require(_to != address(this));
| require(_to != address(this));
| 18,724 |
53 | // Function to change the ACO pools above tolerance prices percentages.Only can be called by a pool admin. tolerancePricesAbove Array of the above tolerance prices percentages to be set. acoPools Array of ACO pools addresses. / | function setTolerancePriceAboveOnAcoPool(uint256[] calldata tolerancePricesAbove, address[] calldata acoPools) onlyPoolAdmin external virtual {
_setAcoPoolUint256Data(IACOPool2.setTolerancePriceAbove.selector, tolerancePricesAbove, acoPools);
}
| function setTolerancePriceAboveOnAcoPool(uint256[] calldata tolerancePricesAbove, address[] calldata acoPools) onlyPoolAdmin external virtual {
_setAcoPoolUint256Data(IACOPool2.setTolerancePriceAbove.selector, tolerancePricesAbove, acoPools);
}
| 35,693 |
162 | // Restake to place fees into the indexer stake | _stake(alloc.indexer, tokensToClaim);
| _stake(alloc.indexer, tokensToClaim);
| 20,675 |
60 | // The initial BPT supply is equal to the invariant times the number of tokens. | return Math.mul(getInvariant(), _getTotalTokens()).divDown(totalSupply());
| return Math.mul(getInvariant(), _getTotalTokens()).divDown(totalSupply());
| 26,394 |
130 | // wBTC/Compound | pool = ISaffronPool(pools[4]);
base_asset = IERC20(pool.get_base_asset_address());
if (base_asset.balanceOf(pools[4]) > 0) pool.hourly_strategy(adapters[2]);
| pool = ISaffronPool(pools[4]);
base_asset = IERC20(pool.get_base_asset_address());
if (base_asset.balanceOf(pools[4]) > 0) pool.hourly_strategy(adapters[2]);
| 9,283 |
51 | // Helper function to handle ERC20 payments | function _tokenPayment(IERC20 _token, address payable _to, uint256 _amount) internal {
require(_token.transfer(_to, _amount), "Fail to transfer tokens");
}
| function _tokenPayment(IERC20 _token, address payable _to, uint256 _amount) internal {
require(_token.transfer(_to, _amount), "Fail to transfer tokens");
}
| 82,399 |
21 | // gathering ingredients | contract BarrelAgedFOMO {
/*
................................................................................
...............................,....................................NDOO88M.....
...............................M,................................O8888888NM.....
...............................ZOMM............................MMO888DMMMM......
................................MO88MZ:......................NMO88ODMMMM$.......
................................+DO88OODMM$=...............MMNO88OMMMMM.........
.............................MZ$MMMO888888O8OOONMM:....:MMMDO8888MMMM+..........
.......................,,D8$ZZZZZZZM8888888888888888OD88888888OMMMMI............
......................:N$ZZZZZZZZZ$ZMMO88888888888888O88888888MMMM:.............
....................$ZZZZZZZZZZZZZZ$ZDMMO888888D8888888888888NMMM:..............
..................O8ZZZZZZZZZZZZZZZZZZZMMMD8DN888888888888ONMMMN=...............
................M$ZZZZZZZZZZZZZZZZZZZZZOMMMD8O8888888888888ODMM.................
...............7OZZZZZZZZ$ZZZZZZZZZZZZZZMMM888888888888888O88M~.................
................=ZDMMND8ZZZ$$ZZZZZZZZOONMM8888888888888888888D?.................
..............:M$777MMN777NMMMMMMM$ZZZZZ8MOO8888888888888O888DM.................
.............877I777DI7777I7MMMMMOZZZZZZNDNNDD88888888O8ND888MM,................
...........+7777777$I77777777MMMZ$ZZZZZZZ$Z$Z$DMMMMMMMD88888NMM$................
..........N7$77777OOI7I7777777MMZZZZZZZZZZZ$ZZ$$MMM888O8888MMMMM................
........,7NZ$$7I$7D77777777777MOZZZZZZZZZZZZZZZZNMM8888O88MDO88M?...............
.........I$IM$I7NM777777777777MZZZZZZZZZZZZZZZZZNMM8888MMM8O88OMM...............
........$777M$777N7777777777I7MZZZZZZZZZZZZZZZZZMMDMMMMMMN888888M+..............
......~$7777I77I78777777II7Z8DDZZZZZZZZZZZZZZZZZMMMMMMMMMMD888888M..............
......77777M7777IO777DMI777OMMNZZZZZZZZZZZZZZZZMMMMMMMMMMMMM8888O8M.............
.....OI777N$77777ZII8M$7777778MZZZZZZZZZZZZZZZMMMMMZZZZZZZMMMM88O8OM,...........
....D7777ID7777777777D777777778ZZZZZZZZZZZZZZMMMMMMZZZZZZZZMMMMMMO888I..........
....77I7DMZ777777777$77777777778ZZZZZZZZZZ$MMMMMMMMZZZZZZZZMMMMM:..7O8D.........
.....Z777$7777777777MI77777777$7DM8OZO8NMMMMMMMMMM8ZZZZZZZZMMMM~................
....~7777$777I77IDMMM777777777777$7MMMD$Z778MMMMMMOZZZZZZZZMMMM.................
....N77777$$DMMIZMMMD77777777777778MMMZ7777777MMMMZZZZZZZZZMMN..................
....877777777Z7777DMO7777777777778MMMMI77777777MMMZZZZZZZZDMM?..................
....77777777787777$$O7777777777IMMMMMO777777777MMMZZZZZZZZMMZ...................
....$777777$7O777777N7777I7777OMMMMMM7777777I7MMMMZZZZZ$ZNM?....................
....Z7777777ZZ777777MZ7I77I$MMMMMMMM87777777?NMMMM8ZZZZZNMZ.....................
....8777IMMMM$777777777OMMMMM$I77I7M7777I$7ZMMMMMMDZ$ZZZMO......................
.......8777$$$7777777777MMMMZI$777777$77ZMMMDOZDMMMZZZDM........................
......777777IZ777777I77MMMMM7777778MMMMMMMI77777MMNZZNM.........................
......M7777I7DII77777MMMMMM77777777778MMMM7777$ZMM.7MO..........................
......D7777777I7MMMMDO$$MMN77777777I7MMMMM77777M=..N............................
......8777777777NMN77777$O$77777777MMMMMMM77INN.................................
......87777777I8MM$77777IMDOO88NMMDZ777MMM7ZD...................................
......MI77777DMMMM7I7777777MMMM7I77777OMM.M,....................................
........?ONND7:..O7777777INMMMD777I78MN.........................................
.................$I7777$MMMMM877ZMM7............................................
...................~$88OI....~MM~...............................................
................................................................................
*/
//first step of any good idea is a name
string public constant name = "Barrel Aged FOMO";
//and of course after a name, we need a code name.
string public constant symbol = "BARF";
//Then determine brewing capacity
uint256 public totalSupply = 1000;
//get all of that's devil's cut
uint8 public constant decimals = 0;
//Setting the price on awesome
uint256 public numBrews;
uint256 public ETH_Rate = 44;
uint256 public ETH_Rate_Factor = 10000;
uint256 public WeiinEth = 1000000000000000000;
//Then some overhead
address public owner;
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) allowed;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//Starting to brew
function BarrelAgedFOMO() public {
owner = msg.sender;
balances[this] += totalSupply - 20;
/*
Quality checks........
....................................................................IZ,~I,==~,+~
..........................................................$,....,::.ZN,+7=$=:7+=
........................................................:,D+,:=~O7Z$$M8OMDDD$?NI
.....................................................,.~=7OMNNMMMMMMMMMMMMMMMMMM
.......................................................=$8NMMMNMMMMMMMMMMMMMMMMM
................................+7=,................I+::$DMDMMMMMMMMMMMMMMMMMMMM
................................NMDNNNDN............,I7O8NMMMMMMMMMMMMMMMMMMMMMM
...............................IMMDNNNMD.............,Z8NMMMMMMMMMMMMMMMMMMMMMMM
...............................NMNDNMNMM............+?8$MMMMMMMMMMMMMMMMMMMMMMMM
...............................DMDNMMMMD............$ODMMMMMMMMMMMMMMMMMMMMMMMMM
..............................,NNZ88NNM.............:INMD8NMMMMMMMMMMMMMMMMMMMMM
..............................NN8ODDNNM:.............?+,IMMMMMMMMMMMMMMMMMMMMMMM
.............................DND8ODDNNM+............,.,MMMMMMMMMMMMMMMMMMMMMMMMM
............................,ND88ODDNNMZ.............DMMMMMMMMMMMMMMMMMMMMMMMMMM
............................DDOOZZ88DNN8...........+NMMMMMMMMMMMMMMMMMMMMMMMMMMM
............................8$$$$$O88DN8..........$MMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...........................$Z777I$$OOO8O.........~MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...........................D$$8NNNNMNNN$.........OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..........................:N?+I77I++?8M=........,8MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..........................$N??7$I?++I8N,........+NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..........................DD?I77I?++7DN..........?NNMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..........................DZI7$$7?++OMD..........?MOMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.........................INDOZ$$I?+?DM~.........7MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
........................8NNNNNNNNNNMMM:.......:NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
......................$DD888888OOZ8NNMO......DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.....................8D8$$$ZZZZ$$$O8DMMD...+MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
....................ZD87III7777III7$OMMM8:MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
....................D87??II777IIIIII$NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................,D8I??I77$77I???+INMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................~N87?I7$$$$7I?????OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................ZDZI?I7$$Z$7II?+?$8NMM:MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................8N7II7$ZZ$$7III?I$DNMZ..NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................DD7I7$$ZZ$$77IIIIZDMMOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..................+DD777$ZZZZ$77IIIIONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..................ODO7$$ZZZZZ$77III78DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..................8DZ7$$ZZZZZ$77II7$8NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..................D8$7$$ZZZZ$$77II7$DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.................?D8$$$ZZZZ$$$7III7ZNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.................8DO$$$ZZZZ$$777II7ONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.................DDO$$ZZZZ$$$77777$8DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.................DDOZZZZOZ$$$77777Z8NMZ.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
................+D8ZZZOOZZ$$$$77$$O8NM:~MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
................ON8ZZZOOZZ$$$$$7$Z88NM.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
................DDOZZZOOOZZ$$$$7$Z8DMN.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
................DD8OZOOOOZZ$$$$$ZO8NMZ.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...............:DD8OOOOOOZZ$$$$ZZODNM:.8MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...............ZND8OOOOOOZZ$$$$OO8NMM...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...............DD8OOOOOOOZZZ$$$ZODNMN....7MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...............DDOZZZOOOOZZZ$$$ZODMM$.......7MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.=NND$Z=......~NDZZZZOOOZZ$$$$$Z8NMM=..............::~+=~+ZNMMMMMMMMMMMMMMMMMMMM
.?NMMMNND:....8MDOZZOOOOZZ$$77$Z8NMM,.........................~DMMMMMMMMMMMMMMMM
..$NMMMMDND8NDMMMNNNNNND8OZ$77$O8NMM............................:MMMMMMMMMMMMMMM
...ZMMMMNNMMNDMMMMMMNMMNNNNMNDDNNMMN..............................8MMMMMMMMMMMMM
....DMMMMMMNMMMMMMMMMMMNMNMNNMNNMMM8...............................7MMMMMMMMMMMM
.....$MMMMMMMMMMMMMMMMMMMMMMMMMMMMM?................................$MMMMMMMMMMM
.......NMMMMMMMMMMMMMMMMMMMMMMMMMMM+.................................+MMMMMMMMMM
........DMMMMMMMMMMMMMMMMMMMMMMMDNNNNIO8$:.............................NMMMMMMMM
.........8MMMMMMMMMMMMMMMMMMMMMMMMMND8O8O8NI............................IMMMMMMM
...........INNMMMMMMMMMMMMMMMMMMMMMMMMMMD88DD+..........................7NMMMMMM
...............?NMMMMMMMMMMMMMMMMMMMMMMMMMMNZOO,........................8MDMMMMM
...................8MMMMMMMMMMMMMMMMMMMMMMMMMMDOZ.......................NMMMMMMM
.....................NNMMMMMMMMMMMMMMMMMMMMMMMMMZZ......................MMMMMMMM
......................,NMMMMMMMMMMMMMMMMMMMMMMMMMO$,....................MNMMMMMM
.......................$MMMMMMMMMMMMMMMMMMMMMMMMMMOD............................
Damn that's good!
*/
balances[0xFFd2ac3C389EDB3DF325f2f1df9364b01F0D7fe5] += 10; // brewmaster samples
balances[0x88FEd759256faf7F290b1267cfBC6aecbBc83A69] += 10; // brewmaster samples
}
/* Now it's time to send you the good stuff
................................~++??I777+7I77I+................................
.............................+8I~~+$NNDNN$I$I+~~ZD..............................
............................N7~Z8DNNNDDDD888Z$?~?NN.............................
............................NNN8Z$I?II77$$ZOODNNNNO.............................
............................:7ONNNNNNNDND8$ZZ7II=:..............................
.............................DDD8OZ$ZZO88DDDDNNNNN$.............................
............................=NNNNNNNNNNNNNNNNNNNDNN.............................
............................ZNNNNNNN8NDNDNDDDNDNNNN+............................
............................NNNNNNNNNNNNNNNNNNNNNDZ.............................
............................I8DDNNNNNNDD8OZ$I+~~?$..............................
.............................~OOZ$ZII7ZO8DDDNNNNNN+.............................
.............................ONDDD88NDZNN8NNZ...:ZZ.............................
.............................D8~..=+NNNNNNZ8NN+.8NN.............................
.............................8NN~.DNNNNDDO$8NN:.DNN.............................
............................~NNN=.8NND~...ONNN..NNN.............................
............................+NNN+.ONND..Z.:8NN.:DNN:............................
............................ZNNNI.8ND..DND.7OD.~NNN=............................
............................DNNN7.8N.IDNNNN:.+.+NNNZ............................
............................NNNN$.O..ONNNNND+..+N8ND............................
...........................:NNDDZ...7NNNNNNNN7.I8NNN............................
............................NNN7I..:ZNNNNNN:....?NNN............................
...........................+NND7II?=+NNNNNNNNNNNNNND+...........................
...........................ZNDDNNNNNNNNNNNND8ZI+:NNN$...........................
...........................NNN8.................$NNND...........................
...........................NNNNNNNNNNNN=.~NNNNNNNNNND...........................
...........................NNNNNNNNNNNN~.INNNNNNNNNND...........................
...........................NNNNNNNNNNNN:.$NNNNNNNNNNN...........................
...........................NNNNNNNNNNNN:.7NNND8O$+8ND=..........................
..........................:NNNO...................ONN7..........................
..........................?NNNNND88OZZZ$ZO8DNNNNNNNNNO..........................
..........................$NNNNNDDD8NNI....INNNNNNNNNO..........................
..........................ZN:......~NNO$.~NNNNNNNNNNNN:.........................
..........................ONNN7.?NNNNNN$.?NDNNNI.ONNNN=.........................
..........................DNNN?.7NNNNNNZ.INNDNNI.ON..N?.........................
..........................NNNN=.$NNNNNNZ.$NNNDDI.8N..NZ.........................
..........................NNNN~.ONNNN::..........8N..8D?........................
.........................INNNN..8NNNDDDD8DDDNNNNNNN..$ND+.......................
.........................8NNNN..8NNNND888OOZZ$$$$7?..7NND~......................
........................ZNN..........................ZNNN$O.....................
.......................$NN8I7I$ZZOO88DDNNNNNNNNNNNNNNNDODNNN=...................
....................~ZNNNNNNNNNNNNNDZDNNNNNNNNNNNNNNNNN7..?DND7.................
...................ZNNDDNNDNNNNNNND.....=DNNNNNNNNNNNNN7...NNNNNZ:..............
..................8NNNNNNNNDNNNNNN?....+NNNNNN?=ZNNNNNN7...NNNNNND=.............
................+N7....ZNN...+NNNZ....ZNNNNN8..:.8NNNON7..=NNNNNNNN$............
...............?N7.?...ZND...DNND~...ZNNNNNN$.:7.$7...NI..$NNNNNNNNNI...........
..............+ND.OD:..DN~..:NNNI...$NN7..ONNI.I.$....?I..8NNOIONNNND...........
.............:NN=+N$..~NN...8NNN~...ND.....ONNN=.ZN=.:DI..8N....8NNDN=..........
............:DNN$DN..:8NI..:NNNZ...8N...:..?NNN..8Z..$NI..8.....$DNNN8..........
............INNNNNZ..?NN:..8NNNI...NI..=DZ.=NNZ..N..:NN7..+.78..NNNNND..........
............NNNNND..:8NZ...NNNN=..=N:..8DO.:ON+.?Z..ZNN$...~N:.ZNNNNN8..........
...........:NNDNN$..$DN+..$NNNN...DN...DN8..N8..D:..NNN$...D..INNNNNNN:.........
...........78NNNN...8ND...DNNND...8N...8NO.~D:.IZ..ONNN$.....INDNNNNNN+.........
...........NNNNN$..INN?...NNNNO..:DN~..?N$.$=.~N=..NNNN$........?NNNNN?.........
..........:N8N8N:..NN8...$NNNN$..=DN8...IZ=...DD..7NNNN$..?ODD8..+NNNNO.........
..........:NDNND..~NN?...8NNNN?..IDN.O......=NNZ..DNNNN+..NNNNNO..$NNN8.........
..........:NNNN?..8NO....DNDNN:..OND.:87~=?DNNN=..NNNN$...NNNNND..?DNND.........
..........:NNND:..NN:...~NNNNO..+DN?.:NN$.INNNN..=NNN8....8NNNND..+DNND.........
..........:NNN8..=N?....~NNNN=..ZNN..~NN~.DNNNN..+DND.~+..ZNNNNO..7DNNN.........
...........NNNZ..78.....~NNNZ..?DNN..?N$.$NNNNN..=NO.:NI.:ONNNNZ..7DDNN:........
..........:NNN$..I.......DND...8NNN..7N..DNNNNN=....=DNOONNNZ:.7..?..?N:........
...........NNNO.....7Z...ZZ...DNNNN..=..ZNNNNNND:.~8NNDNN7....:$:.Z8..N~........
...........DNNN+...$NNO.....~NNNNNNO...$NNNN8NNNNNNNNO=...:?DNND=..~~7D~........
...........NNNNND88NNNNN7+?DNNN78NNND$DNNNNNNNNNND$....:IDNNNNNNNDOZ8DN+........
...........NNNNNDDNNNNNNNN8Z?:...?DNNNNNNNNDN8$+....:$DNNNDZI=~:~+ZNNNN+........
...........DNNNN8...................~=+?~~:......:ONNNI~............7NN+........
...........8NNNNNOO...........................+8NNNNNN~..:7DNNNNNN:..:N?........
...........8NDNNNNNNN8I~................:~$NNNDDNNNNNN~..NNNNNNNND:..NN?........
...........ONND$ODNNNNNNNNND88O8888DDNNND7~......:DNNN:.:NNNNNN8?..+NNN?........
...........DNNO..........:~====~:..NNNO....=$ODD?.~NNN:.:NN87~...$NNNNNI........
...........ONNO.:ZI=:............~?NND...DNNNNNND..NN8........:DNNNNNNN7........
...........DNNO.:NNNNNNNNNNNNNNNNNNNNZ..ZNNNNNNNN..NN$...?8NO...8NNNNNNZ........
...........DNNZ.:8DDDDNDNDNDDD8O$IDN8...NNNNNNNNN...NN:.:NNNN8..~DN+.DNZ........
...........8ND:...................DN=..:NNNNNNNND..NNN:.:NNNND$..ZN~.NN$........
...........8NNO..NNNDND888888DDNNNNNN+.:NNNNNNND:.?NNN:.:NNNNNN:....=NNZ........
...........8NNO..NNNNDNNNDNNNNNNNNNNN$..ZNND7+:..7NNNN:.~NNDNNNN7=?8NNN7........
...........$NNO..DNNNNNNNNNNNNNNNNNNNN8=...:=IODNNNNNNNNNDD7=~:~~=$NN$N7........
...........ZNN8II8NNNNNNNNNNNNNNNNNNNNNNNNNNNDDNNNND$+~..N:.........+NNI........
...........?NNDDO$+:......:ONNNNNND8Z7+~......ZZ.........N...........=N7........
...........=NNN.............=DNN8~............DI.........N.....~+:....NI........
...........:NNN...............8N$.............N=........:N8Z..:NNN~..=N?........
...........~DDD...............=M$............:N=........=NNO..~NNI...DN?........
............NND................DI............=NNI..DDN=+$NN7..:=...?NNN?........
...........:NN8......I8DD8~....ONNN...NNNN~+IONN?..NNNNNNNN=.....=ONNNN+........
............NND8D....ZDNNNN....DNNN...NNNNNNNDDD+..D+$DDNNN~..:=:..7N8N=........
............ZNN8D....ONNNN8...+NNND..:N?=8NNNNNN=..~.ONNNNN...7NN:.:N.N~........
............NNNN8....ZDNNN....8NNNZ..:7..8NNNNNN~....ONNNNN...ZNN=..Z.N.........
............NNNNZ....$DNI...:DNNNN?......NNNNNNN:..8.OD88NN.....ND:..ON.........
............NNNN7....?.....7NNNNNN=.....:NNDDDNN...NNN?.77......8NNNNND.........
............NNNNI........IDNNNNNNN:..NZ.+N:..ONN..:DZ~..$Z..=ZNNNDZ+.ND.........
............NNNN?..........INDNNND:..NNNNN:..DD$........$DNNNNO+...=$88.........
............NNNN?....77=.....NNNND...NNNNO...D~.....:7DNNNNI:..?ONN8:=D.........
............NNNN+...~DNND:...7NNND...N7:.....N?..?8DNN8I:...7DNNNO:..ND.........
............NNNN=...=NNNND...~DNNO..........+NNMNNNI.....ZNIN8+D7...?ND.........
............NNND=...+NDNNI...:N~........~ZNNDNNO~...:$DDNN=:..8NN:..8NN.........
............NNNN~...+D87.....IN=....:IDNNNN+.....+8NNNNNN8N..:NNN~..ONN.........
............NN+:............~NN77ONNNNNO?:....$NDNZNNN8+..$..~NNN~..ONN.........
............NN=............$DDDDNND7~...:7887DNN$.DN7....~N..$NNN~..ZNN.........
............NN=.:........ZNNNDOI:....ZNNNNNNNN8..:N......=N..ONNN=..ZNN.........
............NN=......~INNDD+....~IDNNNNND$:DN$...?NN..~~:~N..8NNN=..DNN.........
............NN++IZDNNN87:...+ODNNNNNND:...INNN$..INN..8NDNN..ZNNN=..DNN.........
............NNNNND$=...~IDNO+IDN8I=+8NN=..+NNN8..7ND..ONNNN..ONNN=..DNN.........
............NN8....IODDNN:...DD:.....ON7..:DNND..7NN..8NNNN..$NNN~..NND.........
............NN87DNNNNNNND~..=N=..I8..~N$...DNNN..$NN..DNNNN..7NNN~..8ND.........
............DDD8D8+.DNND7...8O..~8N...NZ...ZNNN:.$NN..DNN?D..?NDN~..DNO.........
............8NN?....DNDN=...D$..?DD...NZ...7NNN:.ZNN..DO~=N..?NNN~..NN8.........
............ONNZ....8NNI.:..NI..INN...D$....DNN..ZND.....IN..=DNN:..NN8.........
............ONNZ:.?.+N8..Z..N?..$NN...N$....INN..ZNN.....+N...NN+...NNO.........
............$NN$.:N:.+..?O.~N?..ZNN...NI....~NN:.ZNN..$NNNN+........NN7.........
............+DDI.IND....8$.~N+..ONN...NI:....IN..OND..ZNNDNN7..:O:..DN=.........
............~NN=.IND...IN$.:N+..8NN..:N?..Z...N:.O8N..ZNNNNNNDI8N:..8N:.........
............:NZ..~NN8DZZN?..N?..ZNN..~N+..DI..$..7NN..7NNNN7..:NN...NN..........
.............IN$~.DNNNNNN=..N7..7N8..IN~..NN+.::.7NN..INNONNI.:NN..:NN..........
..............=DNOONNNNNN:..NO..?NZ..8N:..NN8....7NN..7NNN=DN:.::..7ND..........
................?NNNNNNNO...$N..~DI..NN...NNNZ...?NN..IN8..DNN~...ON$...........
..................:DNDNN+....N$.....ONN..:NNNN...=DN..~:...8NNNNNN$:............
....................:I88NND$=?N7:.:ZNND...DNNNI...DN......~INNN8=...............
.......................:IDNNNNNNNNNNND+....8NN=..~ZZ..IODNNNZ~..................
.........................~:+IZNNNNNNNDZ$$7$ONNDDN8NODNNN87~:....................
.................................:+$DNNNNNNNNNND8Z?=::..........................
................................................................................
*/
function () public payable {
//CheckInventory();
numBrews = div(div(msg.value,ETH_Rate)*ETH_Rate_Factor,WeiinEth);
require(numBrews > 0 && balances[this] >= numBrews);
balances[msg.sender] += numBrews;
balances[this] -= numBrews;
owner.transfer(msg.value);
}
/*
................................................................................
......................~8?.......................................................
.....................,OMM.......................................................
.....................+MMM.............................................OD+.......
.............,~=~....ZMM8..........................IO:................8MD.......
...........:ZN==NO,..NMO:........................$MM$:........+8Z,....8MD.......
..........IMM~:.$N=.DMN~..........................$MMI~~......NMMN=...DM8.......
.........7MM+..,88Z.OM8=...........OMZNI.....7DD$:.$NDNMMZ...+MMMZ~...DMO.......
........+MMN..+8MO..DMZ:.........+MM..8M?..7MM..8M..$=ZMMO...$MM8~....DMZ.......
.......,NMM..$MMD...MMI..?OZ:...7MM?..NM?.IMM$..8M..$~8MMI...=MM$,....DMI.......
.......ZMMD..8M8...?MM?,DMMMD..:MM8...MO..DMN...MM..Z=DMM=...ZNMN?....NM+.......
.......NMM8........8MM~8O=MMO..ZMM$..MN...MMN..8M..I?+MMD~..:D=NM8:...NN=.......
......~MMMI........DMN$O~?MM7..NMM?.ON...$MM8.OO...8=?MM8~..O=:7MMZ...N8........
......ZMMM.........NMMN:.8MM?..MMN=O8....ZMM88....+Z~?MM8..?O+..NM8...MZ........
......NMMM........,MMMI..NMN...MMN8I+....ZMMZ~....N=:IMMO..8~.$8OMN...MI........
......NMMN........+MMD~..MMO...MMN=......ZMMD=...DI~.=MMN$8~.ZM~7MD...I.........
......MMMD........7MMO..=MMZ...MMN?.......DMMI.,O7=,.,$MN7~..MN~ON=.............
......NMMD........OMMI..ZMM7..8~8MM88D7::..ZMMNI~:...........IND+~,..NZ,........
......NMMD........OMN=..DMM$+N......................................=M7~........
......OMMN....ZMD.......?MMM$.......................................~+~.........
......=MMM+..~MMI...............................................................
.......8MM$..NM7................................................................
........DMMNMN~.................................................................
................................................................................
................................................................................
........................III?I+=,................................................
........................ZI,~~I7+:+..............................................
.......................=$,,=~I+IZ:.............,?Z777I$I=~77$?:.................
.......................:?~=+????$:..........,=7=~.,.........,~?I,...............
.......................II.=I77D7I..........Z$:~:,.?I?.....,,,=:=O~..............
.......................Z?,+?=I??+.........$+.,..:...~I$OZ$=,...,?7,.............
......................~7,:+7+??=~........~OI+7$$?::,.......,:..,+$:.............
......................I7.:+??I?=~........:ZN7=,I++:,,.......=:..+II.............
.....................:$?,~~~~~~+:........,OMI+.+??7==.......~+,.+?7.............
.....................+$=IIOOZ8O7:.........8ZD8$OZOZOZOOZZZ8O$7+,7?7.............
.....................77:7IZ7$88Z:.........ZI8OZ$OZ$I?????$$$$7~,=OI+............
....................~Z7=Z$Z7ZDN8,.........I+OOZ7ZZZ$?????$$OOZ+,=ZIZ............
....................I$+?ZZZZODND..........~7OOZ7$OZ$????I$$O$O7,:778............
....................7Z~I$OZZODDO..........,MOOO7OO$$I???IZZO7Z$::?$8............
...................,Z$~7ZO$O8OOZ...........M?OO77ZZZ$7??IZ$ZZOZ:,+ZO............
...................,ZI=ZZOOOON==...........+?O8Z77OZ$$I?IZZZZOZ~,+$O............
..................,OO$OZZ$$$Z8O,............O$8O$OZZZ7I?I$ZZZZ$=,+$O,...........
.................+ZO7I777$8O8N?:............=IOOZII$$Z7I7$$Z7ZZ=,+Z:,~~.........
...............,$Z$7+:,:~7I7O88$..........:::$ZDO$ZZ$$$II7I77OZ~~7=?:?~=........
..............,$O+I7$I?+?III7O8II.......?~.,..:=?ZOZZZ7IIIZZ$Z7~??=:+:=+........
..............?Z$:ZZ$77$$7$7$ODN7=......$7:7~~~,:,:OOO$I?I7Z$ZI=~$7+..,=........
..........I8M,7Z+?$ZZZZ7ZZOOOO8O$I......Z77:+~$?$+:OZO7I?I7I7O7~:ID7$?I.........
........==?$?7O$~7ZOZOOZ$O8888DDZI......:II$=+~:~78$I$$$?III7Z$=:7Z$~$..........
........+=.?:~I$~7ZZZOOOZ888888Z7?=+=~~...$?==~::,....?=~~?7IZ7=:7ZZ:+..........
........+,,.?IZ?~$Z$$$ZZZ8OO$?,.:+,=~+7...?7I?I=:....,?II??77Z$+:7OI~$..........
.........I+$$DO+~$ZI7$$Z$OOOI?I+I?,=7Z7...7Z7777?:,+~=?Z7+ZOOZ$?,?OZ~O,.........
.........,Z?7O$~+$III$$$$O$$OZ::~=+7$7?...:$7?+IIIZZII$I+?=+D7Z?:=$8~Z..........
..........I~$ZZ~?ZII7+~==~....,~=+=?O.......?7+==,::..,:,,,=Z7$7~=$Z~8~.........
..........7++Z7:$Z?Z?=~+~+....,++=+7I7......$7$7I$+,....ZZ$+Z$ZI=~Z$M~:Z?,......
.........:I?NZ+=Z7I?$7$Z=,....+=$??778......$ZZZO7I:,~I?,7N$OOZZ+:7$D$=..:NI,...
.........:Z=MZ~+Z??$+=77$?===+7$?==I$,.......?I7+~=?II7?~?IZ$$Z$I:+OOZ+,....,:=,
.........:8:8Z:+ZI?I=.,I.,.~==~?=7I...........~I=:::.,==??IZ$$77$=~Z7I==:.......
......:$?~+DZ7:7$??7IZZ+....:I7$$?Z:..........?$I$Z$++~+~ZOZZZ$$Z?~?$$?=........
...=M+,.,+$O$?:O$I???87:7?:,?$O$Z7Z,...........O$,+:~$MD8OOOOOZZZ7~=8O+=,.......
,~,.....,+Z$O~=Z$I?I$?=~7?I7?=?$7?,................I$OO8OOZZZZOO$$?=O?I~........
.......:=+IN8,?ZZ7?7Z+?I:I.,~:~??..................?7D8OOZZ$$$ZZ$Z7=,Z$=,.......
........=I+87,7Z77I$$Z=~+::+777+$..................+?OI8$$$$7?~::...,=II?~......
........=?+O7:ZZ$7$ZO$O8N=,++77II..................+I$7I+,,,~:.~+~?+=I7$7$=.....
........~?Z7=:ZZZ$ZOOZ$ZZOO8O$,....................~7$$7+=?I+=I?$I7++O77I7=,....
.......,~?7$++$$ZZZZOOOOOZO877.....................,$??+=+II77I77I?:+Z?~II?.....
.....:+I,=Z7?==+$88OZ$77$$7Z7=.........................................,$7~?....
.....?I$:=OZIIIIII7I?IIII??7$:............................................:N,...
......$7I?Z$$ZZZZ$777$$$7$ZO$=...............................................+,.
......:+=Z$Z7Z8O88ZZ$$ZO8O$ZZ:..................................................
.....,$Z,....~7ZZO$7$$Z8O7?ZZ...................................................
...,8+..........................................................................
.,+:............................................................................
... and then the boring stuff */
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
function transfer(address _to, uint256 _amount) public returns (bool success) {
if (balances[msg.sender] >= _amount && _amount > 0
&& balances[_to] + _amount > balances[_to]) {
balances[msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(msg.sender, _to, _amount);
return true;
} else {
return false;
}
}
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
if (balances[_from] >= _amount
&& allowed[_from][msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]) {
balances[_from] -= _amount;
allowed[_from][msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(_from, _to, _amount);
return true;
} else {
return false;
}
}
function approve(address _spender, uint256 _amount) public returns (bool success) {
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/*
Practicing Safe Math (Division sucks)......
................................................................................
................................................................................
................................................I?+I............................
...............................................III=7............................
..............................................7II??+............................
......................................:7$$$$7+7$?~$.............................
....................................7$7I?+++?7$$77,.............................
..................................~7IIII?+++++I7$$$,............................
.................................+7IIIIIIIIIIIII+=$$I...........................
................................:7I+~=+IIIIIIII~~~~$$I..........................
...............................:7II~~~~+IIIIIIII~~~~$$~.........................
...............................III~~~~~I?II??III?~~~I$I.........................
..............................:II+~~~~???I????III~~~+$I,........................
..............................?II~~~~=?????????II~~~?$+:........................
.............................~7I?~~~~I??????????I~~=7$=:........................
.............................=II=~~~~????????????~+I7+=.........................
............................:III~~~~????????????=?I7++?.........................
............................~II+~~~~???????????I+II++=+.........................
............................=II~~~~+????????????II+++?,.........................
...........................:?II~~~~????????????II++++I..........................
...........................~III~~~~I??????????II?++++~..........................
...........I??,............~II+~~~=???????????II+++++...........................
...........???,............=III?II????I?????III?++++?...........................
...........???............:+II??I?I??I?????IIII++++++...........................
........ZZ7$$7............~IIIIIIIIIII???IIIII?++++=:...........................
.......$Z$$ZI7Z...........~III?IIIIIIIII??IIII+++++=............................
.......ZZZZ$??$+..........=III?IIIIIII??IIIII?+++++=............................
......,ZZZ????IZ+.....+$$I=II??IIIIIIIIIIIIII++++++=?...........................
.......ZZOZ???Z.,=??I~...,II??IIIIIIIIIIIIII++++++=?.7,.........................
........ZZZZ+............:=II?IIIIIIIIIIIII?++++++=,..:I........................
.........................:+IIIIIIIIIIIIIII?+++??+++....,7.......................
.........................~++IIIIIIIIIIIII??+?????+?.....,$......................
.........................~++++?IIIIIII??+?+??????++......:7.....................
.........................~+++++++++?++++???????+?+=.......?=....................
.........................~+++++++++?++++??????????=........I,...................
.........................~+++++++++?+?++?????????$=.........$...................
.........................~++++++????????????????I7=........,$$Z,................
.........................~++++++????????????????77+........IIZ7?................
.........................=+????????II77$$ZZZZZZZZZ$=,....,Z?IZZ?................
.........................:++???+??????????????I7$Z$7I....?ZO$7$.................
........................=+I??II777777I??++++==~:+ZZ$,....:$7ZIZ.................
........................=?7=:,,..,:~~~~~=?7$Z$7$ZZ:+$.....Z$+Z=.................
.........................=$$$$$7777777$$$ZZ$7~......+I.....$$$..................
.........................?...........................I~.........................
.........................I............................7.........................
........................=~............................?~........................
........................$..............................7........................
........................$..............................$........................
.................~===~,.Z..............................7,.......................
...............+$7II77$I++.............................I7??I$7I+~...............
..............77I?+?I+7$III...........................=++I7III7$$$,.............
.............II?++==I???I+:..........................,~I??I+=++?77$:............
............+I?+??++?I=,..............................,,~?+++?=++I7$............
............????II:.......................................,+++++=?+II...........
...............................................................,+I??7:..........
*/
function div(uint256 a, uint256 b) public 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;
}
} | contract BarrelAgedFOMO {
/*
................................................................................
...............................,....................................NDOO88M.....
...............................M,................................O8888888NM.....
...............................ZOMM............................MMO888DMMMM......
................................MO88MZ:......................NMO88ODMMMM$.......
................................+DO88OODMM$=...............MMNO88OMMMMM.........
.............................MZ$MMMO888888O8OOONMM:....:MMMDO8888MMMM+..........
.......................,,D8$ZZZZZZZM8888888888888888OD88888888OMMMMI............
......................:N$ZZZZZZZZZ$ZMMO88888888888888O88888888MMMM:.............
....................$ZZZZZZZZZZZZZZ$ZDMMO888888D8888888888888NMMM:..............
..................O8ZZZZZZZZZZZZZZZZZZZMMMD8DN888888888888ONMMMN=...............
................M$ZZZZZZZZZZZZZZZZZZZZZOMMMD8O8888888888888ODMM.................
...............7OZZZZZZZZ$ZZZZZZZZZZZZZZMMM888888888888888O88M~.................
................=ZDMMND8ZZZ$$ZZZZZZZZOONMM8888888888888888888D?.................
..............:M$777MMN777NMMMMMMM$ZZZZZ8MOO8888888888888O888DM.................
.............877I777DI7777I7MMMMMOZZZZZZNDNNDD88888888O8ND888MM,................
...........+7777777$I77777777MMMZ$ZZZZZZZ$Z$Z$DMMMMMMMD88888NMM$................
..........N7$77777OOI7I7777777MMZZZZZZZZZZZ$ZZ$$MMM888O8888MMMMM................
........,7NZ$$7I$7D77777777777MOZZZZZZZZZZZZZZZZNMM8888O88MDO88M?...............
.........I$IM$I7NM777777777777MZZZZZZZZZZZZZZZZZNMM8888MMM8O88OMM...............
........$777M$777N7777777777I7MZZZZZZZZZZZZZZZZZMMDMMMMMMN888888M+..............
......~$7777I77I78777777II7Z8DDZZZZZZZZZZZZZZZZZMMMMMMMMMMD888888M..............
......77777M7777IO777DMI777OMMNZZZZZZZZZZZZZZZZMMMMMMMMMMMMM8888O8M.............
.....OI777N$77777ZII8M$7777778MZZZZZZZZZZZZZZZMMMMMZZZZZZZMMMM88O8OM,...........
....D7777ID7777777777D777777778ZZZZZZZZZZZZZZMMMMMMZZZZZZZZMMMMMMO888I..........
....77I7DMZ777777777$77777777778ZZZZZZZZZZ$MMMMMMMMZZZZZZZZMMMMM:..7O8D.........
.....Z777$7777777777MI77777777$7DM8OZO8NMMMMMMMMMM8ZZZZZZZZMMMM~................
....~7777$777I77IDMMM777777777777$7MMMD$Z778MMMMMMOZZZZZZZZMMMM.................
....N77777$$DMMIZMMMD77777777777778MMMZ7777777MMMMZZZZZZZZZMMN..................
....877777777Z7777DMO7777777777778MMMMI77777777MMMZZZZZZZZDMM?..................
....77777777787777$$O7777777777IMMMMMO777777777MMMZZZZZZZZMMZ...................
....$777777$7O777777N7777I7777OMMMMMM7777777I7MMMMZZZZZ$ZNM?....................
....Z7777777ZZ777777MZ7I77I$MMMMMMMM87777777?NMMMM8ZZZZZNMZ.....................
....8777IMMMM$777777777OMMMMM$I77I7M7777I$7ZMMMMMMDZ$ZZZMO......................
.......8777$$$7777777777MMMMZI$777777$77ZMMMDOZDMMMZZZDM........................
......777777IZ777777I77MMMMM7777778MMMMMMMI77777MMNZZNM.........................
......M7777I7DII77777MMMMMM77777777778MMMM7777$ZMM.7MO..........................
......D7777777I7MMMMDO$$MMN77777777I7MMMMM77777M=..N............................
......8777777777NMN77777$O$77777777MMMMMMM77INN.................................
......87777777I8MM$77777IMDOO88NMMDZ777MMM7ZD...................................
......MI77777DMMMM7I7777777MMMM7I77777OMM.M,....................................
........?ONND7:..O7777777INMMMD777I78MN.........................................
.................$I7777$MMMMM877ZMM7............................................
...................~$88OI....~MM~...............................................
................................................................................
*/
//first step of any good idea is a name
string public constant name = "Barrel Aged FOMO";
//and of course after a name, we need a code name.
string public constant symbol = "BARF";
//Then determine brewing capacity
uint256 public totalSupply = 1000;
//get all of that's devil's cut
uint8 public constant decimals = 0;
//Setting the price on awesome
uint256 public numBrews;
uint256 public ETH_Rate = 44;
uint256 public ETH_Rate_Factor = 10000;
uint256 public WeiinEth = 1000000000000000000;
//Then some overhead
address public owner;
mapping(address => uint256) balances;
mapping(address => mapping (address => uint256)) allowed;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//Starting to brew
function BarrelAgedFOMO() public {
owner = msg.sender;
balances[this] += totalSupply - 20;
/*
Quality checks........
....................................................................IZ,~I,==~,+~
..........................................................$,....,::.ZN,+7=$=:7+=
........................................................:,D+,:=~O7Z$$M8OMDDD$?NI
.....................................................,.~=7OMNNMMMMMMMMMMMMMMMMMM
.......................................................=$8NMMMNMMMMMMMMMMMMMMMMM
................................+7=,................I+::$DMDMMMMMMMMMMMMMMMMMMMM
................................NMDNNNDN............,I7O8NMMMMMMMMMMMMMMMMMMMMMM
...............................IMMDNNNMD.............,Z8NMMMMMMMMMMMMMMMMMMMMMMM
...............................NMNDNMNMM............+?8$MMMMMMMMMMMMMMMMMMMMMMMM
...............................DMDNMMMMD............$ODMMMMMMMMMMMMMMMMMMMMMMMMM
..............................,NNZ88NNM.............:INMD8NMMMMMMMMMMMMMMMMMMMMM
..............................NN8ODDNNM:.............?+,IMMMMMMMMMMMMMMMMMMMMMMM
.............................DND8ODDNNM+............,.,MMMMMMMMMMMMMMMMMMMMMMMMM
............................,ND88ODDNNMZ.............DMMMMMMMMMMMMMMMMMMMMMMMMMM
............................DDOOZZ88DNN8...........+NMMMMMMMMMMMMMMMMMMMMMMMMMMM
............................8$$$$$O88DN8..........$MMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...........................$Z777I$$OOO8O.........~MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...........................D$$8NNNNMNNN$.........OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..........................:N?+I77I++?8M=........,8MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..........................$N??7$I?++I8N,........+NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..........................DD?I77I?++7DN..........?NNMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..........................DZI7$$7?++OMD..........?MOMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.........................INDOZ$$I?+?DM~.........7MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
........................8NNNNNNNNNNMMM:.......:NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
......................$DD888888OOZ8NNMO......DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.....................8D8$$$ZZZZ$$$O8DMMD...+MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
....................ZD87III7777III7$OMMM8:MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
....................D87??II777IIIIII$NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................,D8I??I77$77I???+INMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................~N87?I7$$$$7I?????OMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................ZDZI?I7$$Z$7II?+?$8NMM:MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................8N7II7$ZZ$$7III?I$DNMZ..NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...................DD7I7$$ZZ$$77IIIIZDMMOMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..................+DD777$ZZZZ$77IIIIONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..................ODO7$$ZZZZZ$77III78DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..................8DZ7$$ZZZZZ$77II7$8NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
..................D8$7$$ZZZZ$$77II7$DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.................?D8$$$ZZZZ$$$7III7ZNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.................8DO$$$ZZZZ$$777II7ONMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.................DDO$$ZZZZ$$$77777$8DMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.................DDOZZZZOZ$$$77777Z8NMZ.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
................+D8ZZZOOZZ$$$$77$$O8NM:~MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
................ON8ZZZOOZZ$$$$$7$Z88NM.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
................DDOZZZOOOZZ$$$$7$Z8DMN.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
................DD8OZOOOOZZ$$$$$ZO8NMZ.MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...............:DD8OOOOOOZZ$$$$ZZODNM:.8MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...............ZND8OOOOOOZZ$$$$OO8NMM...MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...............DD8OOOOOOOZZZ$$$ZODNMN....7MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
...............DDOZZZOOOOZZZ$$$ZODMM$.......7MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.=NND$Z=......~NDZZZZOOOZZ$$$$$Z8NMM=..............::~+=~+ZNMMMMMMMMMMMMMMMMMMMM
.?NMMMNND:....8MDOZZOOOOZZ$$77$Z8NMM,.........................~DMMMMMMMMMMMMMMMM
..$NMMMMDND8NDMMMNNNNNND8OZ$77$O8NMM............................:MMMMMMMMMMMMMMM
...ZMMMMNNMMNDMMMMMMNMMNNNNMNDDNNMMN..............................8MMMMMMMMMMMMM
....DMMMMMMNMMMMMMMMMMMNMNMNNMNNMMM8...............................7MMMMMMMMMMMM
.....$MMMMMMMMMMMMMMMMMMMMMMMMMMMMM?................................$MMMMMMMMMMM
.......NMMMMMMMMMMMMMMMMMMMMMMMMMMM+.................................+MMMMMMMMMM
........DMMMMMMMMMMMMMMMMMMMMMMMDNNNNIO8$:.............................NMMMMMMMM
.........8MMMMMMMMMMMMMMMMMMMMMMMMMND8O8O8NI............................IMMMMMMM
...........INNMMMMMMMMMMMMMMMMMMMMMMMMMMD88DD+..........................7NMMMMMM
...............?NMMMMMMMMMMMMMMMMMMMMMMMMMMNZOO,........................8MDMMMMM
...................8MMMMMMMMMMMMMMMMMMMMMMMMMMDOZ.......................NMMMMMMM
.....................NNMMMMMMMMMMMMMMMMMMMMMMMMMZZ......................MMMMMMMM
......................,NMMMMMMMMMMMMMMMMMMMMMMMMMO$,....................MNMMMMMM
.......................$MMMMMMMMMMMMMMMMMMMMMMMMMMOD............................
Damn that's good!
*/
balances[0xFFd2ac3C389EDB3DF325f2f1df9364b01F0D7fe5] += 10; // brewmaster samples
balances[0x88FEd759256faf7F290b1267cfBC6aecbBc83A69] += 10; // brewmaster samples
}
/* Now it's time to send you the good stuff
................................~++??I777+7I77I+................................
.............................+8I~~+$NNDNN$I$I+~~ZD..............................
............................N7~Z8DNNNDDDD888Z$?~?NN.............................
............................NNN8Z$I?II77$$ZOODNNNNO.............................
............................:7ONNNNNNNDND8$ZZ7II=:..............................
.............................DDD8OZ$ZZO88DDDDNNNNN$.............................
............................=NNNNNNNNNNNNNNNNNNNDNN.............................
............................ZNNNNNNN8NDNDNDDDNDNNNN+............................
............................NNNNNNNNNNNNNNNNNNNNNDZ.............................
............................I8DDNNNNNNDD8OZ$I+~~?$..............................
.............................~OOZ$ZII7ZO8DDDNNNNNN+.............................
.............................ONDDD88NDZNN8NNZ...:ZZ.............................
.............................D8~..=+NNNNNNZ8NN+.8NN.............................
.............................8NN~.DNNNNDDO$8NN:.DNN.............................
............................~NNN=.8NND~...ONNN..NNN.............................
............................+NNN+.ONND..Z.:8NN.:DNN:............................
............................ZNNNI.8ND..DND.7OD.~NNN=............................
............................DNNN7.8N.IDNNNN:.+.+NNNZ............................
............................NNNN$.O..ONNNNND+..+N8ND............................
...........................:NNDDZ...7NNNNNNNN7.I8NNN............................
............................NNN7I..:ZNNNNNN:....?NNN............................
...........................+NND7II?=+NNNNNNNNNNNNNND+...........................
...........................ZNDDNNNNNNNNNNNND8ZI+:NNN$...........................
...........................NNN8.................$NNND...........................
...........................NNNNNNNNNNNN=.~NNNNNNNNNND...........................
...........................NNNNNNNNNNNN~.INNNNNNNNNND...........................
...........................NNNNNNNNNNNN:.$NNNNNNNNNNN...........................
...........................NNNNNNNNNNNN:.7NNND8O$+8ND=..........................
..........................:NNNO...................ONN7..........................
..........................?NNNNND88OZZZ$ZO8DNNNNNNNNNO..........................
..........................$NNNNNDDD8NNI....INNNNNNNNNO..........................
..........................ZN:......~NNO$.~NNNNNNNNNNNN:.........................
..........................ONNN7.?NNNNNN$.?NDNNNI.ONNNN=.........................
..........................DNNN?.7NNNNNNZ.INNDNNI.ON..N?.........................
..........................NNNN=.$NNNNNNZ.$NNNDDI.8N..NZ.........................
..........................NNNN~.ONNNN::..........8N..8D?........................
.........................INNNN..8NNNDDDD8DDDNNNNNNN..$ND+.......................
.........................8NNNN..8NNNND888OOZZ$$$$7?..7NND~......................
........................ZNN..........................ZNNN$O.....................
.......................$NN8I7I$ZZOO88DDNNNNNNNNNNNNNNNDODNNN=...................
....................~ZNNNNNNNNNNNNNDZDNNNNNNNNNNNNNNNNN7..?DND7.................
...................ZNNDDNNDNNNNNNND.....=DNNNNNNNNNNNNN7...NNNNNZ:..............
..................8NNNNNNNNDNNNNNN?....+NNNNNN?=ZNNNNNN7...NNNNNND=.............
................+N7....ZNN...+NNNZ....ZNNNNN8..:.8NNNON7..=NNNNNNNN$............
...............?N7.?...ZND...DNND~...ZNNNNNN$.:7.$7...NI..$NNNNNNNNNI...........
..............+ND.OD:..DN~..:NNNI...$NN7..ONNI.I.$....?I..8NNOIONNNND...........
.............:NN=+N$..~NN...8NNN~...ND.....ONNN=.ZN=.:DI..8N....8NNDN=..........
............:DNN$DN..:8NI..:NNNZ...8N...:..?NNN..8Z..$NI..8.....$DNNN8..........
............INNNNNZ..?NN:..8NNNI...NI..=DZ.=NNZ..N..:NN7..+.78..NNNNND..........
............NNNNND..:8NZ...NNNN=..=N:..8DO.:ON+.?Z..ZNN$...~N:.ZNNNNN8..........
...........:NNDNN$..$DN+..$NNNN...DN...DN8..N8..D:..NNN$...D..INNNNNNN:.........
...........78NNNN...8ND...DNNND...8N...8NO.~D:.IZ..ONNN$.....INDNNNNNN+.........
...........NNNNN$..INN?...NNNNO..:DN~..?N$.$=.~N=..NNNN$........?NNNNN?.........
..........:N8N8N:..NN8...$NNNN$..=DN8...IZ=...DD..7NNNN$..?ODD8..+NNNNO.........
..........:NDNND..~NN?...8NNNN?..IDN.O......=NNZ..DNNNN+..NNNNNO..$NNN8.........
..........:NNNN?..8NO....DNDNN:..OND.:87~=?DNNN=..NNNN$...NNNNND..?DNND.........
..........:NNND:..NN:...~NNNNO..+DN?.:NN$.INNNN..=NNN8....8NNNND..+DNND.........
..........:NNN8..=N?....~NNNN=..ZNN..~NN~.DNNNN..+DND.~+..ZNNNNO..7DNNN.........
...........NNNZ..78.....~NNNZ..?DNN..?N$.$NNNNN..=NO.:NI.:ONNNNZ..7DDNN:........
..........:NNN$..I.......DND...8NNN..7N..DNNNNN=....=DNOONNNZ:.7..?..?N:........
...........NNNO.....7Z...ZZ...DNNNN..=..ZNNNNNND:.~8NNDNN7....:$:.Z8..N~........
...........DNNN+...$NNO.....~NNNNNNO...$NNNN8NNNNNNNNO=...:?DNND=..~~7D~........
...........NNNNND88NNNNN7+?DNNN78NNND$DNNNNNNNNNND$....:IDNNNNNNNDOZ8DN+........
...........NNNNNDDNNNNNNNN8Z?:...?DNNNNNNNNDN8$+....:$DNNNDZI=~:~+ZNNNN+........
...........DNNNN8...................~=+?~~:......:ONNNI~............7NN+........
...........8NNNNNOO...........................+8NNNNNN~..:7DNNNNNN:..:N?........
...........8NDNNNNNNN8I~................:~$NNNDDNNNNNN~..NNNNNNNND:..NN?........
...........ONND$ODNNNNNNNNND88O8888DDNNND7~......:DNNN:.:NNNNNN8?..+NNN?........
...........DNNO..........:~====~:..NNNO....=$ODD?.~NNN:.:NN87~...$NNNNNI........
...........ONNO.:ZI=:............~?NND...DNNNNNND..NN8........:DNNNNNNN7........
...........DNNO.:NNNNNNNNNNNNNNNNNNNNZ..ZNNNNNNNN..NN$...?8NO...8NNNNNNZ........
...........DNNZ.:8DDDDNDNDNDDD8O$IDN8...NNNNNNNNN...NN:.:NNNN8..~DN+.DNZ........
...........8ND:...................DN=..:NNNNNNNND..NNN:.:NNNND$..ZN~.NN$........
...........8NNO..NNNDND888888DDNNNNNN+.:NNNNNNND:.?NNN:.:NNNNNN:....=NNZ........
...........8NNO..NNNNDNNNDNNNNNNNNNNN$..ZNND7+:..7NNNN:.~NNDNNNN7=?8NNN7........
...........$NNO..DNNNNNNNNNNNNNNNNNNNN8=...:=IODNNNNNNNNNDD7=~:~~=$NN$N7........
...........ZNN8II8NNNNNNNNNNNNNNNNNNNNNNNNNNNDDNNNND$+~..N:.........+NNI........
...........?NNDDO$+:......:ONNNNNND8Z7+~......ZZ.........N...........=N7........
...........=NNN.............=DNN8~............DI.........N.....~+:....NI........
...........:NNN...............8N$.............N=........:N8Z..:NNN~..=N?........
...........~DDD...............=M$............:N=........=NNO..~NNI...DN?........
............NND................DI............=NNI..DDN=+$NN7..:=...?NNN?........
...........:NN8......I8DD8~....ONNN...NNNN~+IONN?..NNNNNNNN=.....=ONNNN+........
............NND8D....ZDNNNN....DNNN...NNNNNNNDDD+..D+$DDNNN~..:=:..7N8N=........
............ZNN8D....ONNNN8...+NNND..:N?=8NNNNNN=..~.ONNNNN...7NN:.:N.N~........
............NNNN8....ZDNNN....8NNNZ..:7..8NNNNNN~....ONNNNN...ZNN=..Z.N.........
............NNNNZ....$DNI...:DNNNN?......NNNNNNN:..8.OD88NN.....ND:..ON.........
............NNNN7....?.....7NNNNNN=.....:NNDDDNN...NNN?.77......8NNNNND.........
............NNNNI........IDNNNNNNN:..NZ.+N:..ONN..:DZ~..$Z..=ZNNNDZ+.ND.........
............NNNN?..........INDNNND:..NNNNN:..DD$........$DNNNNO+...=$88.........
............NNNN?....77=.....NNNND...NNNNO...D~.....:7DNNNNI:..?ONN8:=D.........
............NNNN+...~DNND:...7NNND...N7:.....N?..?8DNN8I:...7DNNNO:..ND.........
............NNNN=...=NNNND...~DNNO..........+NNMNNNI.....ZNIN8+D7...?ND.........
............NNND=...+NDNNI...:N~........~ZNNDNNO~...:$DDNN=:..8NN:..8NN.........
............NNNN~...+D87.....IN=....:IDNNNN+.....+8NNNNNN8N..:NNN~..ONN.........
............NN+:............~NN77ONNNNNO?:....$NDNZNNN8+..$..~NNN~..ONN.........
............NN=............$DDDDNND7~...:7887DNN$.DN7....~N..$NNN~..ZNN.........
............NN=.:........ZNNNDOI:....ZNNNNNNNN8..:N......=N..ONNN=..ZNN.........
............NN=......~INNDD+....~IDNNNNND$:DN$...?NN..~~:~N..8NNN=..DNN.........
............NN++IZDNNN87:...+ODNNNNNND:...INNN$..INN..8NDNN..ZNNN=..DNN.........
............NNNNND$=...~IDNO+IDN8I=+8NN=..+NNN8..7ND..ONNNN..ONNN=..DNN.........
............NN8....IODDNN:...DD:.....ON7..:DNND..7NN..8NNNN..$NNN~..NND.........
............NN87DNNNNNNND~..=N=..I8..~N$...DNNN..$NN..DNNNN..7NNN~..8ND.........
............DDD8D8+.DNND7...8O..~8N...NZ...ZNNN:.$NN..DNN?D..?NDN~..DNO.........
............8NN?....DNDN=...D$..?DD...NZ...7NNN:.ZNN..DO~=N..?NNN~..NN8.........
............ONNZ....8NNI.:..NI..INN...D$....DNN..ZND.....IN..=DNN:..NN8.........
............ONNZ:.?.+N8..Z..N?..$NN...N$....INN..ZNN.....+N...NN+...NNO.........
............$NN$.:N:.+..?O.~N?..ZNN...NI....~NN:.ZNN..$NNNN+........NN7.........
............+DDI.IND....8$.~N+..ONN...NI:....IN..OND..ZNNDNN7..:O:..DN=.........
............~NN=.IND...IN$.:N+..8NN..:N?..Z...N:.O8N..ZNNNNNNDI8N:..8N:.........
............:NZ..~NN8DZZN?..N?..ZNN..~N+..DI..$..7NN..7NNNN7..:NN...NN..........
.............IN$~.DNNNNNN=..N7..7N8..IN~..NN+.::.7NN..INNONNI.:NN..:NN..........
..............=DNOONNNNNN:..NO..?NZ..8N:..NN8....7NN..7NNN=DN:.::..7ND..........
................?NNNNNNNO...$N..~DI..NN...NNNZ...?NN..IN8..DNN~...ON$...........
..................:DNDNN+....N$.....ONN..:NNNN...=DN..~:...8NNNNNN$:............
....................:I88NND$=?N7:.:ZNND...DNNNI...DN......~INNN8=...............
.......................:IDNNNNNNNNNNND+....8NN=..~ZZ..IODNNNZ~..................
.........................~:+IZNNNNNNNDZ$$7$ONNDDN8NODNNN87~:....................
.................................:+$DNNNNNNNNNND8Z?=::..........................
................................................................................
*/
function () public payable {
//CheckInventory();
numBrews = div(div(msg.value,ETH_Rate)*ETH_Rate_Factor,WeiinEth);
require(numBrews > 0 && balances[this] >= numBrews);
balances[msg.sender] += numBrews;
balances[this] -= numBrews;
owner.transfer(msg.value);
}
/*
................................................................................
......................~8?.......................................................
.....................,OMM.......................................................
.....................+MMM.............................................OD+.......
.............,~=~....ZMM8..........................IO:................8MD.......
...........:ZN==NO,..NMO:........................$MM$:........+8Z,....8MD.......
..........IMM~:.$N=.DMN~..........................$MMI~~......NMMN=...DM8.......
.........7MM+..,88Z.OM8=...........OMZNI.....7DD$:.$NDNMMZ...+MMMZ~...DMO.......
........+MMN..+8MO..DMZ:.........+MM..8M?..7MM..8M..$=ZMMO...$MM8~....DMZ.......
.......,NMM..$MMD...MMI..?OZ:...7MM?..NM?.IMM$..8M..$~8MMI...=MM$,....DMI.......
.......ZMMD..8M8...?MM?,DMMMD..:MM8...MO..DMN...MM..Z=DMM=...ZNMN?....NM+.......
.......NMM8........8MM~8O=MMO..ZMM$..MN...MMN..8M..I?+MMD~..:D=NM8:...NN=.......
......~MMMI........DMN$O~?MM7..NMM?.ON...$MM8.OO...8=?MM8~..O=:7MMZ...N8........
......ZMMM.........NMMN:.8MM?..MMN=O8....ZMM88....+Z~?MM8..?O+..NM8...MZ........
......NMMM........,MMMI..NMN...MMN8I+....ZMMZ~....N=:IMMO..8~.$8OMN...MI........
......NMMN........+MMD~..MMO...MMN=......ZMMD=...DI~.=MMN$8~.ZM~7MD...I.........
......MMMD........7MMO..=MMZ...MMN?.......DMMI.,O7=,.,$MN7~..MN~ON=.............
......NMMD........OMMI..ZMM7..8~8MM88D7::..ZMMNI~:...........IND+~,..NZ,........
......NMMD........OMN=..DMM$+N......................................=M7~........
......OMMN....ZMD.......?MMM$.......................................~+~.........
......=MMM+..~MMI...............................................................
.......8MM$..NM7................................................................
........DMMNMN~.................................................................
................................................................................
................................................................................
........................III?I+=,................................................
........................ZI,~~I7+:+..............................................
.......................=$,,=~I+IZ:.............,?Z777I$I=~77$?:.................
.......................:?~=+????$:..........,=7=~.,.........,~?I,...............
.......................II.=I77D7I..........Z$:~:,.?I?.....,,,=:=O~..............
.......................Z?,+?=I??+.........$+.,..:...~I$OZ$=,...,?7,.............
......................~7,:+7+??=~........~OI+7$$?::,.......,:..,+$:.............
......................I7.:+??I?=~........:ZN7=,I++:,,.......=:..+II.............
.....................:$?,~~~~~~+:........,OMI+.+??7==.......~+,.+?7.............
.....................+$=IIOOZ8O7:.........8ZD8$OZOZOZOOZZZ8O$7+,7?7.............
.....................77:7IZ7$88Z:.........ZI8OZ$OZ$I?????$$$$7~,=OI+............
....................~Z7=Z$Z7ZDN8,.........I+OOZ7ZZZ$?????$$OOZ+,=ZIZ............
....................I$+?ZZZZODND..........~7OOZ7$OZ$????I$$O$O7,:778............
....................7Z~I$OZZODDO..........,MOOO7OO$$I???IZZO7Z$::?$8............
...................,Z$~7ZO$O8OOZ...........M?OO77ZZZ$7??IZ$ZZOZ:,+ZO............
...................,ZI=ZZOOOON==...........+?O8Z77OZ$$I?IZZZZOZ~,+$O............
..................,OO$OZZ$$$Z8O,............O$8O$OZZZ7I?I$ZZZZ$=,+$O,...........
.................+ZO7I777$8O8N?:............=IOOZII$$Z7I7$$Z7ZZ=,+Z:,~~.........
...............,$Z$7+:,:~7I7O88$..........:::$ZDO$ZZ$$$II7I77OZ~~7=?:?~=........
..............,$O+I7$I?+?III7O8II.......?~.,..:=?ZOZZZ7IIIZZ$Z7~??=:+:=+........
..............?Z$:ZZ$77$$7$7$ODN7=......$7:7~~~,:,:OOO$I?I7Z$ZI=~$7+..,=........
..........I8M,7Z+?$ZZZZ7ZZOOOO8O$I......Z77:+~$?$+:OZO7I?I7I7O7~:ID7$?I.........
........==?$?7O$~7ZOZOOZ$O8888DDZI......:II$=+~:~78$I$$$?III7Z$=:7Z$~$..........
........+=.?:~I$~7ZZZOOOZ888888Z7?=+=~~...$?==~::,....?=~~?7IZ7=:7ZZ:+..........
........+,,.?IZ?~$Z$$$ZZZ8OO$?,.:+,=~+7...?7I?I=:....,?II??77Z$+:7OI~$..........
.........I+$$DO+~$ZI7$$Z$OOOI?I+I?,=7Z7...7Z7777?:,+~=?Z7+ZOOZ$?,?OZ~O,.........
.........,Z?7O$~+$III$$$$O$$OZ::~=+7$7?...:$7?+IIIZZII$I+?=+D7Z?:=$8~Z..........
..........I~$ZZ~?ZII7+~==~....,~=+=?O.......?7+==,::..,:,,,=Z7$7~=$Z~8~.........
..........7++Z7:$Z?Z?=~+~+....,++=+7I7......$7$7I$+,....ZZ$+Z$ZI=~Z$M~:Z?,......
.........:I?NZ+=Z7I?$7$Z=,....+=$??778......$ZZZO7I:,~I?,7N$OOZZ+:7$D$=..:NI,...
.........:Z=MZ~+Z??$+=77$?===+7$?==I$,.......?I7+~=?II7?~?IZ$$Z$I:+OOZ+,....,:=,
.........:8:8Z:+ZI?I=.,I.,.~==~?=7I...........~I=:::.,==??IZ$$77$=~Z7I==:.......
......:$?~+DZ7:7$??7IZZ+....:I7$$?Z:..........?$I$Z$++~+~ZOZZZ$$Z?~?$$?=........
...=M+,.,+$O$?:O$I???87:7?:,?$O$Z7Z,...........O$,+:~$MD8OOOOOZZZ7~=8O+=,.......
,~,.....,+Z$O~=Z$I?I$?=~7?I7?=?$7?,................I$OO8OOZZZZOO$$?=O?I~........
.......:=+IN8,?ZZ7?7Z+?I:I.,~:~??..................?7D8OOZZ$$$ZZ$Z7=,Z$=,.......
........=I+87,7Z77I$$Z=~+::+777+$..................+?OI8$$$$7?~::...,=II?~......
........=?+O7:ZZ$7$ZO$O8N=,++77II..................+I$7I+,,,~:.~+~?+=I7$7$=.....
........~?Z7=:ZZZ$ZOOZ$ZZOO8O$,....................~7$$7+=?I+=I?$I7++O77I7=,....
.......,~?7$++$$ZZZZOOOOOZO877.....................,$??+=+II77I77I?:+Z?~II?.....
.....:+I,=Z7?==+$88OZ$77$$7Z7=.........................................,$7~?....
.....?I$:=OZIIIIII7I?IIII??7$:............................................:N,...
......$7I?Z$$ZZZZ$777$$$7$ZO$=...............................................+,.
......:+=Z$Z7Z8O88ZZ$$ZO8O$ZZ:..................................................
.....,$Z,....~7ZZO$7$$Z8O7?ZZ...................................................
...,8+..........................................................................
.,+:............................................................................
... and then the boring stuff */
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
function transfer(address _to, uint256 _amount) public returns (bool success) {
if (balances[msg.sender] >= _amount && _amount > 0
&& balances[_to] + _amount > balances[_to]) {
balances[msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(msg.sender, _to, _amount);
return true;
} else {
return false;
}
}
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
if (balances[_from] >= _amount
&& allowed[_from][msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]) {
balances[_from] -= _amount;
allowed[_from][msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(_from, _to, _amount);
return true;
} else {
return false;
}
}
function approve(address _spender, uint256 _amount) public returns (bool success) {
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/*
Practicing Safe Math (Division sucks)......
................................................................................
................................................................................
................................................I?+I............................
...............................................III=7............................
..............................................7II??+............................
......................................:7$$$$7+7$?~$.............................
....................................7$7I?+++?7$$77,.............................
..................................~7IIII?+++++I7$$$,............................
.................................+7IIIIIIIIIIIII+=$$I...........................
................................:7I+~=+IIIIIIII~~~~$$I..........................
...............................:7II~~~~+IIIIIIII~~~~$$~.........................
...............................III~~~~~I?II??III?~~~I$I.........................
..............................:II+~~~~???I????III~~~+$I,........................
..............................?II~~~~=?????????II~~~?$+:........................
.............................~7I?~~~~I??????????I~~=7$=:........................
.............................=II=~~~~????????????~+I7+=.........................
............................:III~~~~????????????=?I7++?.........................
............................~II+~~~~???????????I+II++=+.........................
............................=II~~~~+????????????II+++?,.........................
...........................:?II~~~~????????????II++++I..........................
...........................~III~~~~I??????????II?++++~..........................
...........I??,............~II+~~~=???????????II+++++...........................
...........???,............=III?II????I?????III?++++?...........................
...........???............:+II??I?I??I?????IIII++++++...........................
........ZZ7$$7............~IIIIIIIIIII???IIIII?++++=:...........................
.......$Z$$ZI7Z...........~III?IIIIIIIII??IIII+++++=............................
.......ZZZZ$??$+..........=III?IIIIIII??IIIII?+++++=............................
......,ZZZ????IZ+.....+$$I=II??IIIIIIIIIIIIII++++++=?...........................
.......ZZOZ???Z.,=??I~...,II??IIIIIIIIIIIIII++++++=?.7,.........................
........ZZZZ+............:=II?IIIIIIIIIIIII?++++++=,..:I........................
.........................:+IIIIIIIIIIIIIII?+++??+++....,7.......................
.........................~++IIIIIIIIIIIII??+?????+?.....,$......................
.........................~++++?IIIIIII??+?+??????++......:7.....................
.........................~+++++++++?++++???????+?+=.......?=....................
.........................~+++++++++?++++??????????=........I,...................
.........................~+++++++++?+?++?????????$=.........$...................
.........................~++++++????????????????I7=........,$$Z,................
.........................~++++++????????????????77+........IIZ7?................
.........................=+????????II77$$ZZZZZZZZZ$=,....,Z?IZZ?................
.........................:++???+??????????????I7$Z$7I....?ZO$7$.................
........................=+I??II777777I??++++==~:+ZZ$,....:$7ZIZ.................
........................=?7=:,,..,:~~~~~=?7$Z$7$ZZ:+$.....Z$+Z=.................
.........................=$$$$$7777777$$$ZZ$7~......+I.....$$$..................
.........................?...........................I~.........................
.........................I............................7.........................
........................=~............................?~........................
........................$..............................7........................
........................$..............................$........................
.................~===~,.Z..............................7,.......................
...............+$7II77$I++.............................I7??I$7I+~...............
..............77I?+?I+7$III...........................=++I7III7$$$,.............
.............II?++==I???I+:..........................,~I??I+=++?77$:............
............+I?+??++?I=,..............................,,~?+++?=++I7$............
............????II:.......................................,+++++=?+II...........
...............................................................,+I??7:..........
*/
function div(uint256 a, uint256 b) public 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;
}
} | 69,114 |
36 | // Sets the configuration bitmap of the reserve as a whole Only callable by the PoolConfigurator contract asset The address of the underlying asset of the reserve configuration The new configuration bitmap / | function setConfiguration(
| function setConfiguration(
| 4,984 |
0 | // Calculate tree age in years, rounded up, for live trees/The Alexandr N. Tetearing algorithm could increase precision/rings The number of rings from dendrochronological sample/ return Age in years, rounded up for partial years | function age(uint256 rings) external virtual pure returns (uint256) {
return rings + 1;
}
| function age(uint256 rings) external virtual pure returns (uint256) {
return rings + 1;
}
| 13,725 |
11 | // require(_list != address(0x0)); | trustlist = TrustListInterface(_list);
| trustlist = TrustListInterface(_list);
| 48,605 |
64 | // is this a referred purchase? | _referredBy != 0x0000000000000000000000000000000000000000 &&
| _referredBy != 0x0000000000000000000000000000000000000000 &&
| 1,766 |
19 | // Bought within the first 10 hours | multiplier = 3;
| multiplier = 3;
| 13,157 |
200 | // Burn taxed token | dnes.transfer(BURN_ADDRESS, tax);
| dnes.transfer(BURN_ADDRESS, tax);
| 15,293 |
139 | // Swaps {bake} for {lpToken0}, {lpToken1} & {wbnb} using ThugSwap. / | function addLiquidity() internal {
uint256 bakeHalf = IERC20(bake).balanceOf(address(this)).div(2);
if (lpToken0 != bake) {
IBakerySwapRouter(unirouter).swapExactTokensForTokens(
bakeHalf,
0,
bakeToLp0Route,
address(this),
now.add(600)
| function addLiquidity() internal {
uint256 bakeHalf = IERC20(bake).balanceOf(address(this)).div(2);
if (lpToken0 != bake) {
IBakerySwapRouter(unirouter).swapExactTokensForTokens(
bakeHalf,
0,
bakeToLp0Route,
address(this),
now.add(600)
| 11,424 |
4 | // Array with different splits we create : BitmapVector in Binary A = 001 , B = 010 , C = 100001010100=> 110 [1,3]B and C so 010 appended to 100 gives 110 C : 3 B : 2 A : 1 |
uint256[] memory partition = new uint256[](2); //array of lenght 2
partition[0] = 1;
partition[1] = 3;
dai.approve(address(conditionalTokens), amount);
conditionalTokens.splitPosition(
dai, // collateral token address
bytes32(0), // For splitting from collateral, pass bytes32(0)
conditionId, // "Choice" condition ID (we get this with the function getConditionId -> returns byte32
partition, //Each element of this partition is an index set
|
uint256[] memory partition = new uint256[](2); //array of lenght 2
partition[0] = 1;
partition[1] = 3;
dai.approve(address(conditionalTokens), amount);
conditionalTokens.splitPosition(
dai, // collateral token address
bytes32(0), // For splitting from collateral, pass bytes32(0)
conditionId, // "Choice" condition ID (we get this with the function getConditionId -> returns byte32
partition, //Each element of this partition is an index set
| 44,276 |
38 | // Index of first code of length len in symbol table | uint256 index = 0;
for (len = 1; len <= MAXBITS; len += 5) {
| uint256 index = 0;
for (len = 1; len <= MAXBITS; len += 5) {
| 38,187 |
23 | // Authoried Contract for burn/migration functionality | function setAuthorizedContract(address authorizedContract) external onlyRolesOrOwner(ADMIN_ROLE) {
_authorizedContract = authorizedContract;
}
| function setAuthorizedContract(address authorizedContract) external onlyRolesOrOwner(ADMIN_ROLE) {
_authorizedContract = authorizedContract;
}
| 4,984 |
1 | // Map Dream token IDs to Tile addresses | mapping(uint256 => address) public tileAddressOf;
| mapping(uint256 => address) public tileAddressOf;
| 66,418 |
14 | // Admin can change operator '_account' address to trader privileges, whitelist them on the shared whitelist contract, and the passed in whitelist address i.e. Equity Token, or the default whitelist. _account address that should be given trader privileges. _whitelist Whitelist contract address. / | function changeOperatorToTrader(address _account, address _whitelist) public onlyAdmin {
_toggleWhitelist(_account, _whitelist, true);
operatorsInst.removeOperator(_account);
traderOperatorsInst.addTrader(_account);
}
| function changeOperatorToTrader(address _account, address _whitelist) public onlyAdmin {
_toggleWhitelist(_account, _whitelist, true);
operatorsInst.removeOperator(_account);
traderOperatorsInst.addTrader(_account);
}
| 6,258 |
33 | // Exposes the ability to override the msg sender -- support ERC2771. | function _stakeMsgSender() internal virtual returns (address) {
return msg.sender;
}
| function _stakeMsgSender() internal virtual returns (address) {
return msg.sender;
}
| 28,883 |
5 | // Allows current owner to transfer control of the contract to a newOwner. newOwner The address to transfer ownership to. newOwnerWallet The address to transfer ownership to. / | function transferOwnership(address newOwner, address newOwnerWallet) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
ownerWallet = newOwnerWallet;
}
| function transferOwnership(address newOwner, address newOwnerWallet) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
ownerWallet = newOwnerWallet;
}
| 63,384 |
76 | // Calculate SGN minimum limiter value. _sgnAmount The given SGN amount.return The calculated SGN minimum limiter value. / | function calcSGNMinimumLimiterValue(uint256 _sgnAmount) public view returns (uint256) {
assert(sgnMinimumLimiterValueN > 0 && sgnMinimumLimiterValueD > 0);
return _sgnAmount.mul(sgnMinimumLimiterValueN) / sgnMinimumLimiterValueD;
}
| function calcSGNMinimumLimiterValue(uint256 _sgnAmount) public view returns (uint256) {
assert(sgnMinimumLimiterValueN > 0 && sgnMinimumLimiterValueD > 0);
return _sgnAmount.mul(sgnMinimumLimiterValueN) / sgnMinimumLimiterValueD;
}
| 1,117 |
0 | // The identifying key of the pool | struct PoolKey {
address token0;
address token1;
uint24 fee;
}
| struct PoolKey {
address token0;
address token1;
uint24 fee;
}
| 7,242 |
1 | // total amount of tokens | uint256 public totalSupply;
| uint256 public totalSupply;
| 8,342 |
22 | // approve specified address to spend the specified value on behalf of sender | function approve(address _spender, uint256 _value) public returns (bool success) {
// set allowance value
allowed[msg.sender][_spender] = _value;
// log approval
emit LogApproval(msg.sender, _spender, _value);
// success
return true;
}
| function approve(address _spender, uint256 _value) public returns (bool success) {
// set allowance value
allowed[msg.sender][_spender] = _value;
// log approval
emit LogApproval(msg.sender, _spender, _value);
// success
return true;
}
| 25,826 |
22 | // See {IIdentityRegistry-deleteIdentity}. / | function deleteIdentity(address _userAddress) external override onlyAgent {
tokenIdentityStorage.removeIdentityFromStorage(_userAddress);
emit IdentityRemoved(_userAddress, identity(_userAddress));
}
| function deleteIdentity(address _userAddress) external override onlyAgent {
tokenIdentityStorage.removeIdentityFromStorage(_userAddress);
emit IdentityRemoved(_userAddress, identity(_userAddress));
}
| 5,820 |
4 | // An event for tracking a user claiming some of their vested tokens. | event Claimed(address beneficiary, uint256 amount);
| event Claimed(address beneficiary, uint256 amount);
| 40,306 |
13 | // Items init | _addItems(_items);
if (_shouldComplete) {
_completeCollection();
}
| _addItems(_items);
if (_shouldComplete) {
_completeCollection();
}
| 19,021 |
46 | // Set free performance fee address Only callable by the contract admin. _user: User address _free: true:free false:not free / | function setFreePerformanceFeeUser(address _user, bool _free) external onlyAdmin {
require(_user != address(0), "Cannot be zero address");
freePerformanceFeeUsers[_user] = _free;
emit FreeFeeUser(_user, _free);
}
| function setFreePerformanceFeeUser(address _user, bool _free) external onlyAdmin {
require(_user != address(0), "Cannot be zero address");
freePerformanceFeeUsers[_user] = _free;
emit FreeFeeUser(_user, _free);
}
| 4,773 |
154 | // for the ALL_ATT_DEF modifier, the additional attack bonus is stored in the primary value and the additional defence bonus is stored in the secondary value | cumulativeAttackBonuses[0] += allCards[0][i]._modifierPrimarayVal;
cumulativeDefenceBonuses[0] += allCards[0][i]._modifierSecondaryVal;
| cumulativeAttackBonuses[0] += allCards[0][i]._modifierPrimarayVal;
cumulativeDefenceBonuses[0] += allCards[0][i]._modifierSecondaryVal;
| 52,385 |
12 | // Maximum fraction of interest that can be set aside for reserves + fees / | uint internal constant reserveFactorPlusFeesMaxMantissa = 1e18;
| uint internal constant reserveFactorPlusFeesMaxMantissa = 1e18;
| 46,493 |
29 | // Inverse perpetual: Note that `isBuy` in the order is from the maker's perspective and relative to the base currency, whereas `isBuy` in the TradeResult is from the taker's perspective, and relative to the quote currency. | return P1Types.TradeResult({
marginAmount: marginAmount,
positionAmount: tradeData.fill.amount,
isBuy: isBuyOrder,
traderFlags: TRADER_FLAG_ORDERS
});
| return P1Types.TradeResult({
marginAmount: marginAmount,
positionAmount: tradeData.fill.amount,
isBuy: isBuyOrder,
traderFlags: TRADER_FLAG_ORDERS
});
| 47,476 |
78 | // The buyer over-paid; transfer their funds back to them | payable(msg.sender).transfer(address(this).balance);
| payable(msg.sender).transfer(address(this).balance);
| 66,717 |
41 | // Query if a contract implements an interface/interfaceId The interface identifier, as specified in ERC-165/ return `true` if the contract implements `interfaceId` and/ `interfaceId` is not 0xffffffff, `false` otherwise/Interface identification is specified in ERC-165. This function/uses less than 30,000 gas. See: https:eips.ethereum.org/EIPS/eip-165/See EIP-2981: https:eips.ethereum.org/EIPS/eip-2981/See EIP-4906: https:eips.ethereum.org/EIPS/eip-4906 | function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) {
// ERC2981 & ERC4906
return interfaceId == bytes4(0x2a55205a) || interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId);
}
| function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) {
// ERC2981 & ERC4906
return interfaceId == bytes4(0x2a55205a) || interfaceId == bytes4(0x49064906) || super.supportsInterface(interfaceId);
}
| 33,468 |
153 | // Get the ClaimsManager address | function getClaimsManagerAddress() external view returns (address) {
_requireIsInitialized();
return claimsManagerAddress;
}
| function getClaimsManagerAddress() external view returns (address) {
_requireIsInitialized();
return claimsManagerAddress;
}
| 7,392 |
168 | // Add | uint256 id = authorizedContractList.push(false);
authorizedContractIds[_contract] = id;
authorizedContracts[id] = AuthorizedContract(_name, _contract);
| uint256 id = authorizedContractList.push(false);
authorizedContractIds[_contract] = id;
authorizedContracts[id] = AuthorizedContract(_name, _contract);
| 14,497 |
189 | // Emitted once a given asset has been rented | event Rent(
uint256 indexed _assetId,
uint256 _rentId,
address indexed _renter,
uint256 _start,
uint256 _end,
address indexed _paymentToken,
uint256 _rent,
uint256 _protocolFee
);
| event Rent(
uint256 indexed _assetId,
uint256 _rentId,
address indexed _renter,
uint256 _start,
uint256 _end,
address indexed _paymentToken,
uint256 _rent,
uint256 _protocolFee
);
| 46,305 |
18 | // Check for the valid destimation wallet | require(to != address(0), "Invalid wallet");
| require(to != address(0), "Invalid wallet");
| 30,057 |
12 | // Transfers control of the contract to a newOwner. _newOwner The address to transfer ownership to. / | function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
| function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
| 9,472 |
469 | // These will be populated within the scope below. | FixedPoint.Unsigned memory lockedCollateral;
FixedPoint.Unsigned memory liquidatedCollateral;
| FixedPoint.Unsigned memory lockedCollateral;
FixedPoint.Unsigned memory liquidatedCollateral;
| 5,815 |
165 | // 4. set copyright | _setCopyright(currentId, msg.sender, copyrightInfos);
| _setCopyright(currentId, msg.sender, copyrightInfos);
| 25,759 |
72 | // switch Trading | function tradingStatus(bool _status) public onlyOwner {
tradingOpen = _status;
}
| function tradingStatus(bool _status) public onlyOwner {
tradingOpen = _status;
}
| 29,627 |
257 | // A staker(mintr) can claim from the previous fee period (7 days) only. Fee Periods stored and managed from [0], such that [0] is always the current active fee period which is not claimable until the public function closeCurrentFeePeriod() is called closing the current weeks collected fees. [1] is last weeks feeperiod | uint8 public constant FEE_PERIOD_LENGTH = 2;
FeePeriod[FEE_PERIOD_LENGTH] private _recentFeePeriods;
uint256 private _currentFeePeriod;
| uint8 public constant FEE_PERIOD_LENGTH = 2;
FeePeriod[FEE_PERIOD_LENGTH] private _recentFeePeriods;
uint256 private _currentFeePeriod;
| 13,319 |
19 | // function to set the payout addressrequires ownerpayoutAddr is the new payout address/ | function setPayoutAddress(address payoutAddr) external virtual onlyOwner {
require(payoutAddr != address(0), "ERC1155TLCore: Payout address cannot be the zero address");
payoutAddress = payable(payoutAddr);
}
| function setPayoutAddress(address payoutAddr) external virtual onlyOwner {
require(payoutAddr != address(0), "ERC1155TLCore: Payout address cannot be the zero address");
payoutAddress = payable(payoutAddr);
}
| 19,172 |
242 | // Exhausted credit line | if (strategy_debtLimit <= strategy.totalDebt || vault_debtLimit <= vault_totalDebt) return 0;
| if (strategy_debtLimit <= strategy.totalDebt || vault_debtLimit <= vault_totalDebt) return 0;
| 35,452 |
90 | // return The total number of euros. / | function totalSupply()
external
view
returns (uint256)
| function totalSupply()
external
view
returns (uint256)
| 19,660 |
268 | // now we are certain the sender deployed or controls the erc20 | backend.setDOwnerFromClaim(democHash, msg.sender);
| backend.setDOwnerFromClaim(democHash, msg.sender);
| 51,295 |
52 | // divScalar only fails when divisor is zero. This is clearly not the case. | assert(err1 == MathError.NO_ERROR);
_utilizationRate; // pragma ignore unused variable
| assert(err1 == MathError.NO_ERROR);
_utilizationRate; // pragma ignore unused variable
| 14,736 |
44 | // Reclaim. | (result.reclaimed, result.rewarded) = oracle_.reclaim(msg.sender, coin_);
oracle_.revokeOwnership(coin_);
logging_.vote(result.epoch_id, result.commit_result,
result.reveal_result, result.deposited,
result.reclaimed, result.rewarded);
emit VoteEvent(
msg.sender, result.epoch_id, hash, oracle_level, salt,
result.commit_result, result.reveal_result, result.deposited,
| (result.reclaimed, result.rewarded) = oracle_.reclaim(msg.sender, coin_);
oracle_.revokeOwnership(coin_);
logging_.vote(result.epoch_id, result.commit_result,
result.reveal_result, result.deposited,
result.reclaimed, result.rewarded);
emit VoteEvent(
msg.sender, result.epoch_id, hash, oracle_level, salt,
result.commit_result, result.reveal_result, result.deposited,
| 7,932 |
0 | // count cards count is initialized using the first card without doing the `while` check | uint count = 1 << (cards & 15);
| uint count = 1 << (cards & 15);
| 25,202 |
29 | // _den is small enough to be MAX_ERROR or better w/o a factor | value = value.mul(numMin);
return value;
| value = value.mul(numMin);
return value;
| 29,693 |
75 | // Set the registrar address for the contract, (This function can be called only once). public_function_registrarAddress - The Registrar contract address./ | function configure(address _registrarAddress) noEther returns(bool) {
// Convert into array to properly generate Error event
bytes32[] memory ref = new bytes32[](1);
ref[0] = bytes32(registrarAddress);
if (msg.sender != deployerAddress) {
Error(3, ref);
return false;
}
if (registrarAddress != 0x0) {
Error(9, ref);
return false;
}
registrarAddress = _registrarAddress;
return true;
}
| function configure(address _registrarAddress) noEther returns(bool) {
// Convert into array to properly generate Error event
bytes32[] memory ref = new bytes32[](1);
ref[0] = bytes32(registrarAddress);
if (msg.sender != deployerAddress) {
Error(3, ref);
return false;
}
if (registrarAddress != 0x0) {
Error(9, ref);
return false;
}
registrarAddress = _registrarAddress;
return true;
}
| 56,741 |
42 | // Authorization getters / | function isOperatorAuthorizedFor(address operator, address assetHolder)
| function isOperatorAuthorizedFor(address operator, address assetHolder)
| 29,345 |
45 | // update bonus state when balance changed | BonusState(bonusState).setBalanceState(_from,balances[_from]);
BonusState(bonusState).setBalanceState(_to,balances[_to]);
| BonusState(bonusState).setBalanceState(_from,balances[_from]);
BonusState(bonusState).setBalanceState(_to,balances[_to]);
| 24,110 |
241 | // If we're continuing, then we are going to lock something (unless it's zero) | uint256 cvxToLock = newLockRatio.sub(currentLockRatio);
| uint256 cvxToLock = newLockRatio.sub(currentLockRatio);
| 9,552 |
9 | // Gets the facet that supports the given selector./If facet is not found return address(0)./_functionSelector The function selector./ return facetAddress_ The facet address. | function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);
| function facetAddress(bytes4 _functionSelector) external view returns (address facetAddress_);
| 22,838 |
50 | // We have to lookup the team AND check the fields because of some of the workings of solidity 1. We could have a team at index 0, so we CAN'T just check the index is > 0 2. Solidity intializes with an empty set of struct values, so we need to do equality on the manager field | uint teamIndex = managerToTeamId[manager];
Team memory team = teams[teamIndex];
if (team.manager == manager) {
return true;
}
| uint teamIndex = managerToTeamId[manager];
Team memory team = teams[teamIndex];
if (team.manager == manager) {
return true;
}
| 23,455 |
30 | // Set metadata for music game data format: description, imageURI, animationURI, tokenId | for (uint256 i = firstMintedTokenId; i <= _lastMintedTokenId(); i++) {
bytes memory data = abi.encode(
description,
imageURI,
animationURI,
i
);
config.metadataRenderer.initializeWithData(data);
}
| for (uint256 i = firstMintedTokenId; i <= _lastMintedTokenId(); i++) {
bytes memory data = abi.encode(
description,
imageURI,
animationURI,
i
);
config.metadataRenderer.initializeWithData(data);
}
| 25,148 |
0 | // Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing/ Returns the downcasted uint128 from uint256, reverting onoverflow (when the input is greater than largest uint128). Counterpart to Solidity's `uint128` operator. Requirements: - input must fit into 128 bits / | function toUint128(uint256 value) internal pure returns (uint128) {
require(value < 2 ** 128, "SafeCast: value doesn't fit in 128 bits");
return uint128(value);
}
| function toUint128(uint256 value) internal pure returns (uint128) {
require(value < 2 ** 128, "SafeCast: value doesn't fit in 128 bits");
return uint128(value);
}
| 29,438 |
39 | // An event to make the transfer easy to find on the blockchain | Transfer(_from, _to, _amount);
| Transfer(_from, _to, _amount);
| 25,545 |
126 | // rlp encode & decode function | function decodeValidatorSetSynPackage(bytes memory msgBytes) internal pure returns (IbcValidatorSetPackage memory, bool) {
IbcValidatorSetPackage memory validatorSetPkg;
RLPDecode.Iterator memory iter = msgBytes.toRLPItem().iterator();
bool success = false;
uint256 idx=0;
while (iter.hasNext()) {
if (idx == 0) {
validatorSetPkg.packageType = uint8(iter.next().toUint());
} else if (idx == 1) {
RLPDecode.RLPItem[] memory items = iter.next().toList();
validatorSetPkg.validatorSet =new Validator[](items.length);
for (uint j = 0;j<items.length;j++) {
(Validator memory val, bool ok) = decodeValidator(items[j]);
if (!ok) {
return (validatorSetPkg, false);
}
validatorSetPkg.validatorSet[j] = val;
}
success = true;
} else {
break;
}
idx++;
}
return (validatorSetPkg, success);
}
| function decodeValidatorSetSynPackage(bytes memory msgBytes) internal pure returns (IbcValidatorSetPackage memory, bool) {
IbcValidatorSetPackage memory validatorSetPkg;
RLPDecode.Iterator memory iter = msgBytes.toRLPItem().iterator();
bool success = false;
uint256 idx=0;
while (iter.hasNext()) {
if (idx == 0) {
validatorSetPkg.packageType = uint8(iter.next().toUint());
} else if (idx == 1) {
RLPDecode.RLPItem[] memory items = iter.next().toList();
validatorSetPkg.validatorSet =new Validator[](items.length);
for (uint j = 0;j<items.length;j++) {
(Validator memory val, bool ok) = decodeValidator(items[j]);
if (!ok) {
return (validatorSetPkg, false);
}
validatorSetPkg.validatorSet[j] = val;
}
success = true;
} else {
break;
}
idx++;
}
return (validatorSetPkg, success);
}
| 16,765 |
99 | // May emit a {RoleGranted} event. / | function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
| function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
| 29,679 |
8 | // Throws if called by an account other than the owner or dev. / | modifier onlyOwnerOrDev() {
require(owner() == msg.sender || devAddress == msg.sender, "Caller is not owner or dev.");
_;
}
| modifier onlyOwnerOrDev() {
require(owner() == msg.sender || devAddress == msg.sender, "Caller is not owner or dev.");
_;
}
| 21,801 |
21 | // AUCTION MANAGEMENT/ Creates a new auction and transfers the token to the contract to be held in escrow until the end of the auction.Requires this contract to be approved for the token to be auctioned. / | function createAuction(address _contractAddress, uint256 _tokenId, uint256 _startingPrice, uint256 expiryDate, TokenType tokenType, uint256 _quantity) public nonReentrant returns(uint256 auctionId){
require(expiryDate.sub(minimumAuctionLiveness) > block.timestamp, "Expiry date is not far enough in the future");
require(tokenType != TokenType.NONE, "Invalid token type provided");
uint256 quantity = 1;
if(tokenType == TokenType.ERC1155){
quantity = _quantity;
}
// Generate Auction Id
totalAuctionCount.increment();
auctionId = totalAuctionCount.current();
// Register new Auction
auctions[auctionId] = Auction(_contractAddress, _tokenId, _startingPrice, msg.sender, address(0), AuctionStatus.OPEN, expiryDate, auctionId, tokenType, quantity);
// Transfer Token
transferToken(auctionId, msg.sender, address(this));
emit AuctionCreated(auctionId, _contractAddress, _tokenId, _startingPrice, msg.sender, expiryDate);
}
| function createAuction(address _contractAddress, uint256 _tokenId, uint256 _startingPrice, uint256 expiryDate, TokenType tokenType, uint256 _quantity) public nonReentrant returns(uint256 auctionId){
require(expiryDate.sub(minimumAuctionLiveness) > block.timestamp, "Expiry date is not far enough in the future");
require(tokenType != TokenType.NONE, "Invalid token type provided");
uint256 quantity = 1;
if(tokenType == TokenType.ERC1155){
quantity = _quantity;
}
// Generate Auction Id
totalAuctionCount.increment();
auctionId = totalAuctionCount.current();
// Register new Auction
auctions[auctionId] = Auction(_contractAddress, _tokenId, _startingPrice, msg.sender, address(0), AuctionStatus.OPEN, expiryDate, auctionId, tokenType, quantity);
// Transfer Token
transferToken(auctionId, msg.sender, address(this));
emit AuctionCreated(auctionId, _contractAddress, _tokenId, _startingPrice, msg.sender, expiryDate);
}
| 1,181 |
92 | // Check is msg.sender address is a Name / | modifier senderIsName() {
require (_nameFactory.ethAddressToNameId(msg.sender) != address(0));
_;
}
| modifier senderIsName() {
require (_nameFactory.ethAddressToNameId(msg.sender) != address(0));
_;
}
| 23,918 |
100 | // Set the address of the contract that represents CryptoSaga Cards. | function setCryptoSagaCardSwapContract(address _contractAddress)
public
onlyOwner
| function setCryptoSagaCardSwapContract(address _contractAddress)
public
onlyOwner
| 36,226 |
84 | // set the rest of the contract variables | uniswapV2Router = _uniswapV2Router;
| uniswapV2Router = _uniswapV2Router;
| 2,103 |
210 | // NOTE(pb): No transfer, no contract supply change since whole amount is taken as swap fee. | emit ReverseSwap(rid, to, from, originTxHash, 0, amount);
| emit ReverseSwap(rid, to, from, originTxHash, 0, amount);
| 72,363 |
8 | // to pause the dapp | bool paused = false;
| bool paused = false;
| 14,866 |
50 | // or 0-9 | (_temp[i] > 0x2f && _temp[i] < 0x3a),
"string contains invalid characters"
);
| (_temp[i] > 0x2f && _temp[i] < 0x3a),
"string contains invalid characters"
);
| 39,719 |
4 | // 7. Read in the creation time of a hash | function getCreationTime(string memory hash) public view returns(uint){
require(checkExists(hash)); // Make sure it exists
return hashToProof[hash].timestamp; // Return timestamp
}
| function getCreationTime(string memory hash) public view returns(uint){
require(checkExists(hash)); // Make sure it exists
return hashToProof[hash].timestamp; // Return timestamp
}
| 20,936 |
83 | // get the amount of unsold tokens allocated to this contract; | function getWeiLeft() external constant returns (uint) {
return weiMaximumGoal - weiRaised;
}
| function getWeiLeft() external constant returns (uint) {
return weiMaximumGoal - weiRaised;
}
| 5,756 |
15 | // Token observer interface Allows a token smart-contract to notify observers when tokens are received created 09/10/2017author Frank Bonnet / | contract ITokenObserver {
/**
* Called by the observed token smart-contract in order
* to notify the token observer when tokens are received
*
* @param _from The address that the tokens where send from
* @param _value The amount of tokens that was received
*/
function notifyTokensReceived(address _from, uint _value) external;
}
| contract ITokenObserver {
/**
* Called by the observed token smart-contract in order
* to notify the token observer when tokens are received
*
* @param _from The address that the tokens where send from
* @param _value The amount of tokens that was received
*/
function notifyTokensReceived(address _from, uint _value) external;
}
| 6,306 |
91 | // 6.9% of your SemenRetentionTokens retained in the coom pool | uint256 semenRetained = coomShot.mul(69).div(1000);
uint256 userReward = coomShot.sub(semenRetained);
| uint256 semenRetained = coomShot.mul(69).div(1000);
uint256 userReward = coomShot.sub(semenRetained);
| 29,023 |
16 | // Allows to add a new owner. Transaction has to be sent by wallet./owner Address of new owner. | function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
| function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
| 32,946 |
20 | // Cancel an unbonding period for a stake that is currently unbonding. Resets the unbonding timer and reinstates any lock boosts.depositId The specified deposit to unstake from./ | function cancelUnbonding(uint256 depositId) external override whenNotPaused updateRewards {
_cancelUnbonding(depositId);
}
| function cancelUnbonding(uint256 depositId) external override whenNotPaused updateRewards {
_cancelUnbonding(depositId);
}
| 24,044 |
2 | // Record card | struct Card {
uint8 id;
address owner;
string title;
string url;
string image;
bool nsfw;
}
| struct Card {
uint8 id;
address owner;
string title;
string url;
string image;
bool nsfw;
}
| 7,728 |
41 | // the uniswap pool that will receive the rebase | UniswapPair public pool;
RewardDistributionDelegate public rewardDistribution;
RewardDistributionFactory public constant REWARDFACTORY = RewardDistributionFactory(0x19231725f21B3BA2989A396A31F3B66502C7de66);
GovernanceFactory public constant GOVERNANCEFACTORY = GovernanceFactory(0x95283102A95f84fd7FB3ba0EE5C5A8F16E82c025);
| UniswapPair public pool;
RewardDistributionDelegate public rewardDistribution;
RewardDistributionFactory public constant REWARDFACTORY = RewardDistributionFactory(0x19231725f21B3BA2989A396A31F3B66502C7de66);
GovernanceFactory public constant GOVERNANCEFACTORY = GovernanceFactory(0x95283102A95f84fd7FB3ba0EE5C5A8F16E82c025);
| 40,453 |
77 | // Since the new array still fits in the slot, we just need to update the contents of the slot. uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length | sstore(
_preBytes.slot,
| sstore(
_preBytes.slot,
| 22,658 |
13 | // Claims rewards for the voters and send to a recipient/_pools pools to claim for | function claimForVoters(address[] calldata _pools) external {
// VE_PENDLE pool can't be present
for (uint256 i; i < _pools.length;) {
if (_pools[i] == VE_PENDLE) revert WRONG_CLAIM();
unchecked {
++i;
}
}
address[] memory vePendlePool = new address[](1);
vePendlePool[0] = VE_PENDLE;
uint256 vePendleRewardClaimable =
IPendleFeeDistributor(PENDLE_FEE_D).getProtocolClaimables(address(locker), vePendlePool)[0];
uint256 totalAccrued = IPendleFeeDistributor(PENDLE_FEE_D).getProtocolTotalAccrued(address(locker));
uint256 claimed = IPendleFeeDistributor(PENDLE_FEE_D).claimed(address(locker));
uint256 totalReward = _claimReward(_pools);
if (totalReward + _pools.length != totalAccrued - claimed - vePendleRewardClaimable) revert NOT_CLAIMED_ALL();
// send the reward to the recipient if it is not to distribute
// and not charge fees on this
if (!distributeVotersRewards) {
IERC20(WETH).transfer(votesRewardRecipient, totalReward);
} else {
_chargeFee(totalReward);
}
}
| function claimForVoters(address[] calldata _pools) external {
// VE_PENDLE pool can't be present
for (uint256 i; i < _pools.length;) {
if (_pools[i] == VE_PENDLE) revert WRONG_CLAIM();
unchecked {
++i;
}
}
address[] memory vePendlePool = new address[](1);
vePendlePool[0] = VE_PENDLE;
uint256 vePendleRewardClaimable =
IPendleFeeDistributor(PENDLE_FEE_D).getProtocolClaimables(address(locker), vePendlePool)[0];
uint256 totalAccrued = IPendleFeeDistributor(PENDLE_FEE_D).getProtocolTotalAccrued(address(locker));
uint256 claimed = IPendleFeeDistributor(PENDLE_FEE_D).claimed(address(locker));
uint256 totalReward = _claimReward(_pools);
if (totalReward + _pools.length != totalAccrued - claimed - vePendleRewardClaimable) revert NOT_CLAIMED_ALL();
// send the reward to the recipient if it is not to distribute
// and not charge fees on this
if (!distributeVotersRewards) {
IERC20(WETH).transfer(votesRewardRecipient, totalReward);
} else {
_chargeFee(totalReward);
}
}
| 35,135 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.