Contract Address Details

0x3C41BDF6C36E816B5510A84887447947bc3Dc7f2

Contract Name
Bondee
Creator
0x75c224–eec790 at 0xf00e82–52fd3a
Balance
0 AVAX
Tokens
Fetching tokens...
Transactions
Transfers
Gas Used
Last Balance Update
5801996
Contract name:
Bondee




Optimization enabled
false
Compiler version
v0.8.9+commit.e5eed63a




EVM Version
default




Verified at
2021-10-10 18:06:02.856699Z

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;
contract Bondee {
// GLOBAL VARIABLES
address internal dev;
uint internal totalBonds;
uint internal multiplierEndTime;
mapping (address => uint) internal totalInvested;
mapping (address => uint) internal totalReturn;
mapping (address => uint) internal bondsEarnedFromReferrals;
mapping (address => uint) internal userBonds;
mapping (address => uint) internal userLastTXN;
mapping (address => bool) internal hasBonds;
mapping (address => address) internal userReferredBy;
// CONSTRUCTOR
constructor() {
dev = msg.sender;
}
// FUNCTIONS
function BuyBonds(address referrer) public payable {
require(msg.value >= 1 gwei, "Message value must be at least one gwei.");
if (hasBonds[msg.sender] == true) {
PayDevFee(msg.value);
MintBonds(msg.value + RewardOwed(msg.sender));
MintToReferrer(msg.value/10);
totalInvested[msg.sender] += msg.value;
} else if (hasBonds[msg.sender] == false) {
AddReferrer(msg.sender, referrer);
PayDevFee(msg.value);
MintBonds(msg.value);
MintToReferrer(msg.value/10);
totalInvested[msg.sender] += msg.value;
hasBonds[msg.sender] = true;
}
}
function AddReferrer(address referred, address referrer) internal {
userReferredBy[referred] = referrer;
}
function MintToReferrer(uint amount) internal {
if(userReferredBy[msg.sender] != address(0x0) && userReferredBy[msg.sender] != msg.sender) {
if(CheckForMultiplier() == false) {
userBonds[userReferredBy[msg.sender]] += amount;
totalBonds += amount;
bondsEarnedFromReferrals[userReferredBy[msg.sender]] += amount;
} else if (CheckForMultiplier() == true) {
userBonds[userReferredBy[msg.sender]] += amount * 2;
totalBonds += amount * 2;
bondsEarnedFromReferrals[userReferredBy[msg.sender]] += amount *2;
}
} else if (userReferredBy[msg.sender] != address(0x0) || userReferredBy[msg.sender] == msg.sender) {
userBonds[userReferredBy[msg.sender]] += 0;
}
}
function MintBonds(uint amount) internal {
if(CheckForMultiplier() == false) {
userBonds[msg.sender] += amount;
totalBonds += amount;
userLastTXN[msg.sender] = uint(block.timestamp);
} else if (CheckForMultiplier() == true) {
userBonds[msg.sender] += amount * 2;
totalBonds += amount * 2;
userLastTXN[msg.sender] = uint(block.timestamp);
}
}
function ClaimReward() public {
require(RewardOwed(msg.sender) > 0, "No reward is owed.");
if (RewardOwed(msg.sender) <= address(this).balance) {
payable(msg.sender).transfer(uint(RewardOwed(msg.sender)));
totalReturn[msg.sender] += uint(RewardOwed(msg.sender));
userLastTXN[msg.sender] = uint(block.timestamp);
} else if (RewardOwed(msg.sender) > address(this).balance) {
payable(msg.sender).transfer(address(this).balance);
totalReturn[msg.sender] += uint(address(this).balance);
userLastTXN[msg.sender] = uint(block.timestamp);
}
}
function CompoundReward() public {
if (RewardOwed(msg.sender) <= address(this).balance) {
MintBonds((Percent(RewardOwed(msg.sender), 10500)));
} else if (RewardOwed(msg.sender) > address(this).balance) {
MintBonds((Percent(address(this).balance, 10500)));
}
}
function SetMultiplierTime(uint secondsToRun) public {
require(msg.sender == dev, "Only the owner can call this function.");
multiplierEndTime = uint(block.timestamp) + secondsToRun;
}
function CheckForMultiplier() public view returns(bool isActive) {
if(multiplierEndTime >= block.timestamp) {
return true;
} else if(multiplierEndTime < block.timestamp) {
return false;
}
}
function MultiplierMessage() public view returns (string memory message) {
if(CheckForMultiplier() == false) {
return "2x multiplier IS NOT active.";
} else if(CheckForMultiplier() == true) {
return "2x multiplier is currently active!";
}
}
function RewardPerSecond(address _address) internal view returns(uint) {
return (((Percent(address(this).balance, 500) * userBonds[_address])) / totalBonds) / 86400;
}
function RewardOwed(address _address) internal view returns(uint) {
return RewardPerSecond(_address) * ElapsedSeconds(_address);
}
function ElapsedSeconds(address _address) internal view returns(uint) {
return block.timestamp - userLastTXN[_address];
}
function PayDevFee(uint amount) internal {
payable(dev).transfer(Percent(amount, 500)); // 500 bp = 5%
}
function ViewRewardOwed(address _address) public view returns(uint) {
return RewardOwed(_address);
}
function ViewMyBonds(address _address) public view returns(uint) {
return userBonds[_address];
}
function ViewTotalBonds() public view returns(uint) {
return totalBonds;
}
function ViewContractBalance() public view returns(uint) {
return address(this).balance;
}
function ViewTotalInvested(address _address) public view returns (uint) {
return totalInvested[_address];
}
function ViewTotalReturn(address _address) public view returns (uint) {
return totalReturn[_address];
}
function ViewDailyROI(address _address) public view returns (uint) {
return RewardPerSecond(_address) * 86400;
}
function Percent(uint number, uint bp) internal pure returns (uint) {
return number * bp / 10000;
}
function ViewBondsFromReferrals(address _address) public view returns (uint) {
return bondsEarnedFromReferrals[_address];
}
function ViewReferrer(address _address) public view returns (address) {
return userReferredBy[_address];
}
}

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"BuyBonds","inputs":[{"type":"address","name":"referrer","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"isActive","internalType":"bool"}],"name":"CheckForMultiplier","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"ClaimReward","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"CompoundReward","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"message","internalType":"string"}],"name":"MultiplierMessage","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"SetMultiplierTime","inputs":[{"type":"uint256","name":"secondsToRun","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ViewBondsFromReferrals","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ViewContractBalance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ViewDailyROI","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ViewMyBonds","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ViewReferrer","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ViewRewardOwed","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ViewTotalBonds","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ViewTotalInvested","inputs":[{"type":"address","name":"_address","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ViewTotalReturn","inputs":[{"type":"address","name":"_address","internalType":"address"}]}]
            

Deployed ByteCode

0x6080604052600436106100e85760003560e01c80638c18b4b31161008a578063cce9607911610059578063cce960791461030a578063d499007c14610347578063e2dc94a714610363578063fd653da71461037a576100e8565b80638c18b4b31461023a578063b2a6463814610277578063c15782fb146102a2578063c57971d6146102df576100e8565b806351077d7c116100c657806351077d7c146101905780635f2f42cb146101cd5780636b4d440d146101f857806379372f9a14610223576100e8565b8063390838d1146100ed57806347e575c91461011657806350801c1214610153575b600080fd5b3480156100f957600080fd5b50610114600480360381019061010f9190611657565b6103b7565b005b34801561012257600080fd5b5061013d600480360381019061013891906116e2565b61045a565b60405161014a919061171e565b60405180910390f35b34801561015f57600080fd5b5061017a600480360381019061017591906116e2565b6104c3565b6040516101879190611748565b60405180910390f35b34801561019c57600080fd5b506101b760048036038101906101b291906116e2565b61050c565b6040516101c49190611748565b60405180910390f35b3480156101d957600080fd5b506101e2610555565b6040516101ef91906117fc565b60405180910390f35b34801561020457600080fd5b5061020d6105e0565b60405161021a9190611839565b60405180910390f35b34801561022f57600080fd5b5061023861060b565b005b34801561024657600080fd5b50610261600480360381019061025c91906116e2565b610850565b60405161026e9190611748565b60405180910390f35b34801561028357600080fd5b5061028c610862565b6040516102999190611748565b60405180910390f35b3480156102ae57600080fd5b506102c960048036038101906102c491906116e2565b61086c565b6040516102d69190611748565b60405180910390f35b3480156102eb57600080fd5b506102f461088c565b6040516103019190611748565b60405180910390f35b34801561031657600080fd5b50610331600480360381019061032c91906116e2565b610894565b60405161033e9190611748565b60405180910390f35b610361600480360381019061035c91906116e2565b6108dd565b005b34801561036f57600080fd5b50610378610b4f565b005b34801561038657600080fd5b506103a1600480360381019061039c91906116e2565b610ba7565b6040516103ae9190611748565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610445576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161043c906118c6565b60405180910390fd5b80426104519190611915565b60028190555050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600015156105636105e0565b151514156105a8576040518060400160405280601c81526020017f3278206d756c7469706c696572204953204e4f54206163746976652e0000000081525090506105dd565b600115156105b46105e0565b151514156105dc57604051806060016040528060228152602001611b586022913990506105dd565b5b90565b600042600254106105f45760019050610608565b4260025410156106075760009050610608565b5b90565b600061061633610bf0565b11610656576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064d906119b7565b60405180910390fd5b4761066033610bf0565b1161075b573373ffffffffffffffffffffffffffffffffffffffff166108fc61068833610bf0565b9081150290604051600060405180830381858888f193505050501580156106b3573d6000803e3d6000fd5b506106bd33610bf0565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461070b9190611915565b9250508190555042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061084e565b4761076533610bf0565b111561084d573373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156107b1573d6000803e3d6000fd5b5047600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546108019190611915565b9250508190555042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b565b600061085b82610bf0565b9050919050565b6000600154905090565b60006201518061087b83610c15565b61088591906119d7565b9050919050565b600047905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b633b9aca00341015610924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091b90611aa3565b60405180910390fd5b60011515600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610a125761098634610c8f565b6109a261099233610bf0565b3461099d9190611915565b610d04565b6109b7600a346109b29190611af2565b610eb4565b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610a069190611915565b92505081905550610b4c565b60001515600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610b4b57610a753382611523565b610a7e34610c8f565b610a8734610d04565b610a9c600a34610a979190611af2565b610eb4565b34600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610aeb9190611915565b925050819055506001600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b50565b47610b5933610bf0565b11610b7f57610b7a610b75610b6d33610bf0565b6129046115a5565b610d04565b610ba5565b47610b8933610bf0565b1115610ba457610ba3610b9e476129046115a5565b610d04565b5b5b565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610bfb826115c8565b610c0483610c15565b610c0e91906119d7565b9050919050565b600062015180600154600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c6a476101f46115a5565b610c7491906119d7565b610c7e9190611af2565b610c889190611af2565b9050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc610cd5836101f46115a5565b9081150290604051600060405180830381858888f19350505050158015610d00573d6000803e3d6000fd5b5050565b60001515610d106105e0565b15151415610dd05780600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d679190611915565b925050819055508060016000828254610d809190611915565b9250508190555042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610eb1565b60011515610ddc6105e0565b15151415610eb057600281610df191906119d7565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e3f9190611915565b92505081905550600281610e5391906119d7565b60016000828254610e649190611915565b9250508190555042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b50565b600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015610fdb57503373ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561133e5760001515610fec6105e0565b1515141561117c578060066000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110a29190611915565b9250508190555080600160008282546110bb9190611915565b925050819055508060056000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111709190611915565b92505081905550611339565b600115156111886105e0565b151514156113385760028161119d91906119d7565b60066000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461124a9190611915565b9250508190555060028161125e91906119d7565b6001600082825461126f9190611915565b9250508190555060028161128391906119d7565b60056000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113309190611915565b925050819055505b5b611520565b600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158061146357503373ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b1561151f57600060066000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546115179190611915565b925050819055505b5b50565b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600061271082846115b691906119d7565b6115c09190611af2565b905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426116159190611b23565b9050919050565b600080fd5b6000819050919050565b61163481611621565b811461163f57600080fd5b50565b6000813590506116518161162b565b92915050565b60006020828403121561166d5761166c61161c565b5b600061167b84828501611642565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006116af82611684565b9050919050565b6116bf816116a4565b81146116ca57600080fd5b50565b6000813590506116dc816116b6565b92915050565b6000602082840312156116f8576116f761161c565b5b6000611706848285016116cd565b91505092915050565b611718816116a4565b82525050565b6000602082019050611733600083018461170f565b92915050565b61174281611621565b82525050565b600060208201905061175d6000830184611739565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561179d578082015181840152602081019050611782565b838111156117ac576000848401525b50505050565b6000601f19601f8301169050919050565b60006117ce82611763565b6117d8818561176e565b93506117e881856020860161177f565b6117f1816117b2565b840191505092915050565b6000602082019050818103600083015261181681846117c3565b905092915050565b60008115159050919050565b6118338161181e565b82525050565b600060208201905061184e600083018461182a565b92915050565b7f4f6e6c7920746865206f776e65722063616e2063616c6c20746869732066756e60008201527f6374696f6e2e0000000000000000000000000000000000000000000000000000602082015250565b60006118b060268361176e565b91506118bb82611854565b604082019050919050565b600060208201905081810360008301526118df816118a3565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061192082611621565b915061192b83611621565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156119605761195f6118e6565b5b828201905092915050565b7f4e6f20726577617264206973206f7765642e0000000000000000000000000000600082015250565b60006119a160128361176e565b91506119ac8261196b565b602082019050919050565b600060208201905081810360008301526119d081611994565b9050919050565b60006119e282611621565b91506119ed83611621565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611a2657611a256118e6565b5b828202905092915050565b7f4d6573736167652076616c7565206d757374206265206174206c65617374206f60008201527f6e6520677765692e000000000000000000000000000000000000000000000000602082015250565b6000611a8d60288361176e565b9150611a9882611a31565b604082019050919050565b60006020820190508181036000830152611abc81611a80565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611afd82611621565b9150611b0883611621565b925082611b1857611b17611ac3565b5b828204905092915050565b6000611b2e82611621565b9150611b3983611621565b925082821015611b4c57611b4b6118e6565b5b82820390509291505056fe3278206d756c7469706c6965722069732063757272656e746c792061637469766521a26469706673582212204d78e53a9bd99506b5f6609a991b993a5c468c3fcfd82e6ef788e9043f13a0b364736f6c63430008090033