Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
BNBMiner vs BNBMachine
생성일
3년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
15 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
152 행
복사
19 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
156 행
복사
/**
/**
복사
복사됨
복사
복사됨
*Submitted for verification at BscScan.com on 202
1-03-22
*Submitted for verification at BscScan.com on 202
2-12-31
*/
*/
복사
복사됨
복사
복사됨
/**
/* BNB Machine
*Website: https://bnbMiner.finance
Website: bnbmachine.xyz
Telegram: https://t.me/TheBNBMachine
*/
*/
복사
복사됨
복사
복사됨
pragma solidity ^0.4.26; // solhint-disable-line
pragma solidity ^0.4.26; // solhint-disable-line
복사
복사됨
복사
복사됨
contract BNB
M
ine
r
{
contract BNB
_Mach
ine
{
//uint256
EGGS
_PER_MINERS_PER_SECOND=1;
//uint256
BNB
_PER_MINERS_PER_SECOND=1;
uint256 public
EGGS
_TO_HATCH_1MINERS=
2592000
;//for final version should be seconds in a day
uint256 public
BNB
_TO_HATCH_1MINERS=
540000
;//for final version should be seconds in a day
.
uint256 PSN=10000;
uint256 PSN=10000;
uint256 PSNH=5000;
uint256 PSNH=5000;
bool public initialized=false;
bool public initialized=false;
address public ceoAddress;
address public ceoAddress;
address public ceoAddress2;
address public ceoAddress2;
mapping (address => uint256) public hatcheryMiners;
mapping (address => uint256) public hatcheryMiners;
mapping (address => uint256) public claimedEggs;
mapping (address => uint256) public claimedEggs;
mapping (address => uint256) public lastHatch;
mapping (address => uint256) public lastHatch;
mapping (address => address) public referrals;
mapping (address => address) public referrals;
uint256 public marketEggs;
uint256 public marketEggs;
constructor() public{
constructor() public{
ceoAddress=msg.sender;
ceoAddress=msg.sender;
복사
복사됨
복사
복사됨
ceoAddress2=address(
0x5Ce4c97C4Ab2dE8698A5Ca2C277f8e2cb468e71A
);
ceoAddress2=address(
0x90f44470bd0322C9E8c58d8234CF005018cf91D8
);
}
}
function hatchEggs(address ref) public{
function hatchEggs(address ref) public{
require(initialized);
require(initialized);
if(ref == msg.sender) {
if(ref == msg.sender) {
ref = 0;
ref = 0;
}
}
if(referrals[msg.sender]==0 && referrals[msg.sender]!=msg.sender){
if(referrals[msg.sender]==0 && referrals[msg.sender]!=msg.sender){
referrals[msg.sender]=ref;
referrals[msg.sender]=ref;
}
}
uint256 eggsUsed=getMyEggs();
uint256 eggsUsed=getMyEggs();
복사
복사됨
복사
복사됨
uint256 newMiners=SafeMath.div(eggsUsed,
EGGS
_TO_HATCH_1MINERS);
uint256 newMiners=SafeMath.div(eggsUsed,
BNB
_TO_HATCH_1MINERS);
hatcheryMiners[msg.sender]=SafeMath.add(hatcheryMiners[msg.sender],newMiners);
hatcheryMiners[msg.sender]=SafeMath.add(hatcheryMiners[msg.sender],newMiners);
claimedEggs[msg.sender]=0;
claimedEggs[msg.sender]=0;
lastHatch[msg.sender]=now;
lastHatch[msg.sender]=now;
//send referral eggs
//send referral eggs
복사
복사됨
복사
복사됨
claimedEggs[referrals[msg.sender]]=SafeMath.add(claimedEggs[referrals[msg.sender]],SafeMath.div(eggsUsed,
10
));
claimedEggs[referrals[msg.sender]]=SafeMath.add(claimedEggs[referrals[msg.sender]],SafeMath.div(eggsUsed,
8
));
//boost market to nerf miners hoarding
//boost market to nerf miners hoarding
marketEggs=SafeMath.add(marketEggs,SafeMath.div(eggsUsed,5));
marketEggs=SafeMath.add(marketEggs,SafeMath.div(eggsUsed,5));
}
}
function sellEggs() public{
function sellEggs() public{
require(initialized);
require(initialized);
uint256 hasEggs=getMyEggs();
uint256 hasEggs=getMyEggs();
uint256 eggValue=calculateEggSell(hasEggs);
uint256 eggValue=calculateEggSell(hasEggs);
uint256 fee=devFee(eggValue);
uint256 fee=devFee(eggValue);
uint256 fee2=fee/2;
uint256 fee2=fee/2;
claimedEggs[msg.sender]=0;
claimedEggs[msg.sender]=0;
lastHatch[msg.sender]=now;
lastHatch[msg.sender]=now;
marketEggs=SafeMath.add(marketEggs,hasEggs);
marketEggs=SafeMath.add(marketEggs,hasEggs);
ceoAddress.transfer(fee2);
ceoAddress.transfer(fee2);
ceoAddress2.transfer(fee-fee2);
ceoAddress2.transfer(fee-fee2);
msg.sender.transfer(SafeMath.sub(eggValue,fee));
msg.sender.transfer(SafeMath.sub(eggValue,fee));
}
}
function buyEggs(address ref) public payable{
function buyEggs(address ref) public payable{
require(initialized);
require(initialized);
uint256 eggsBought=calculateEggBuy(msg.value,SafeMath.sub(address(this).balance,msg.value));
uint256 eggsBought=calculateEggBuy(msg.value,SafeMath.sub(address(this).balance,msg.value));
eggsBought=SafeMath.sub(eggsBought,devFee(eggsBought));
eggsBought=SafeMath.sub(eggsBought,devFee(eggsBought));
uint256 fee=devFee(msg.value);
uint256 fee=devFee(msg.value);
uint256 fee2=fee/2;
uint256 fee2=fee/2;
ceoAddress.transfer(fee2);
ceoAddress.transfer(fee2);
ceoAddress2.transfer(fee-fee2);
ceoAddress2.transfer(fee-fee2);
claimedEggs[msg.sender]=SafeMath.add(claimedEggs[msg.sender],eggsBought);
claimedEggs[msg.sender]=SafeMath.add(claimedEggs[msg.sender],eggsBought);
hatchEggs(ref);
hatchEggs(ref);
}
}
//magic trade balancing algorithm
//magic trade balancing algorithm
function calculateTrade(uint256 rt,uint256 rs, uint256 bs) public view returns(uint256){
function calculateTrade(uint256 rt,uint256 rs, uint256 bs) public view returns(uint256){
//(PSN*bs)/(PSNH+((PSN*rs+PSNH*rt)/rt));
//(PSN*bs)/(PSNH+((PSN*rs+PSNH*rt)/rt));
return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt)));
return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt)));
}
}
function calculateEggSell(uint256 eggs) public view returns(uint256){
function calculateEggSell(uint256 eggs) public view returns(uint256){
return calculateTrade(eggs,marketEggs,address(this).balance);
return calculateTrade(eggs,marketEggs,address(this).balance);
}
}
function calculateEggBuy(uint256 eth,uint256 contractBalance) public view returns(uint256){
function calculateEggBuy(uint256 eth,uint256 contractBalance) public view returns(uint256){
return calculateTrade(eth,contractBalance,marketEggs);
return calculateTrade(eth,contractBalance,marketEggs);
}
}
function calculateEggBuySimple(uint256 eth) public view returns(uint256){
function calculateEggBuySimple(uint256 eth) public view returns(uint256){
return calculateEggBuy(eth,address(this).balance);
return calculateEggBuy(eth,address(this).balance);
}
}
function devFee(uint256 amount) public pure returns(uint256){
function devFee(uint256 amount) public pure returns(uint256){
복사
복사됨
복사
복사됨
return SafeMath.div(SafeMath.mul(amount,
5
),100);
return SafeMath.div(SafeMath.mul(amount,
4
),100);
}
}
function seedMarket() public payable{
function seedMarket() public payable{
require(marketEggs==0);
require(marketEggs==0);
initialized=true;
initialized=true;
복사
복사됨
복사
복사됨
marketEggs=
2592
00000000;
marketEggs=
540
00000000;
}
}
function getBalance() public view returns(uint256){
function getBalance() public view returns(uint256){
return address(this).balance;
return address(this).balance;
}
}
function getMyMiners() public view returns(uint256){
function getMyMiners() public view returns(uint256){
return hatcheryMiners[msg.sender];
return hatcheryMiners[msg.sender];
}
}
function getMyEggs() public view returns(uint256){
function getMyEggs() public view returns(uint256){
return SafeMath.add(claimedEggs[msg.sender],getEggsSinceLastHatch(msg.sender));
return SafeMath.add(claimedEggs[msg.sender],getEggsSinceLastHatch(msg.sender));
}
}
function getEggsSinceLastHatch(address adr) public view returns(uint256){
function getEggsSinceLastHatch(address adr) public view returns(uint256){
복사
복사됨
복사
복사됨
uint256 secondsPassed=min(
EGGS
_TO_HATCH_1MINERS,SafeMath.sub(now,lastHatch[adr]));
uint256 secondsPassed=min(
BNB
_TO_HATCH_1MINERS,SafeMath.sub(now,lastHatch[adr]));
return SafeMath.mul(secondsPassed,hatcheryMiners[adr]);
return SafeMath.mul(secondsPassed,hatcheryMiners[adr]);
}
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
function min(uint256 a, uint256 b) private pure returns (uint256) {
return a < b ? a : b;
return a < b ? a : b;
}
}
}
}
library SafeMath {
library SafeMath {
/**
/**
* @dev Multiplies two numbers, throws on overflow.
* @dev Multiplies two numbers, throws on overflow.
*/
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
if (a == 0) {
return 0;
return 0;
}
}
uint256 c = a * b;
uint256 c = a * b;
assert(c / a == b);
assert(c / a == b);
return c;
return c;
}
}
/**
/**
* @dev Integer division of two numbers, truncating the quotient.
* @dev Integer division of two numbers, truncating the quotient.
*/
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
return c;
}
}
/**
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
assert(b <= a);
return a - b;
return a - b;
}
}
/**
/**
* @dev Adds two numbers, throws on overflow.
* @dev Adds two numbers, throws on overflow.
*/
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
uint256 c = a + b;
assert(c >= a);
assert(c >= a);
return c;
return c;
}
}
}
}
저장된 비교 결과
원본
파일 열기
/** *Submitted for verification at BscScan.com on 2021-03-22 */ /** *Website: https://bnbMiner.finance */ pragma solidity ^0.4.26; // solhint-disable-line contract BNBMiner{ //uint256 EGGS_PER_MINERS_PER_SECOND=1; uint256 public EGGS_TO_HATCH_1MINERS=2592000;//for final version should be seconds in a day uint256 PSN=10000; uint256 PSNH=5000; bool public initialized=false; address public ceoAddress; address public ceoAddress2; mapping (address => uint256) public hatcheryMiners; mapping (address => uint256) public claimedEggs; mapping (address => uint256) public lastHatch; mapping (address => address) public referrals; uint256 public marketEggs; constructor() public{ ceoAddress=msg.sender; ceoAddress2=address(0x5Ce4c97C4Ab2dE8698A5Ca2C277f8e2cb468e71A); } function hatchEggs(address ref) public{ require(initialized); if(ref == msg.sender) { ref = 0; } if(referrals[msg.sender]==0 && referrals[msg.sender]!=msg.sender){ referrals[msg.sender]=ref; } uint256 eggsUsed=getMyEggs(); uint256 newMiners=SafeMath.div(eggsUsed,EGGS_TO_HATCH_1MINERS); hatcheryMiners[msg.sender]=SafeMath.add(hatcheryMiners[msg.sender],newMiners); claimedEggs[msg.sender]=0; lastHatch[msg.sender]=now; //send referral eggs claimedEggs[referrals[msg.sender]]=SafeMath.add(claimedEggs[referrals[msg.sender]],SafeMath.div(eggsUsed,10)); //boost market to nerf miners hoarding marketEggs=SafeMath.add(marketEggs,SafeMath.div(eggsUsed,5)); } function sellEggs() public{ require(initialized); uint256 hasEggs=getMyEggs(); uint256 eggValue=calculateEggSell(hasEggs); uint256 fee=devFee(eggValue); uint256 fee2=fee/2; claimedEggs[msg.sender]=0; lastHatch[msg.sender]=now; marketEggs=SafeMath.add(marketEggs,hasEggs); ceoAddress.transfer(fee2); ceoAddress2.transfer(fee-fee2); msg.sender.transfer(SafeMath.sub(eggValue,fee)); } function buyEggs(address ref) public payable{ require(initialized); uint256 eggsBought=calculateEggBuy(msg.value,SafeMath.sub(address(this).balance,msg.value)); eggsBought=SafeMath.sub(eggsBought,devFee(eggsBought)); uint256 fee=devFee(msg.value); uint256 fee2=fee/2; ceoAddress.transfer(fee2); ceoAddress2.transfer(fee-fee2); claimedEggs[msg.sender]=SafeMath.add(claimedEggs[msg.sender],eggsBought); hatchEggs(ref); } //magic trade balancing algorithm function calculateTrade(uint256 rt,uint256 rs, uint256 bs) public view returns(uint256){ //(PSN*bs)/(PSNH+((PSN*rs+PSNH*rt)/rt)); return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt))); } function calculateEggSell(uint256 eggs) public view returns(uint256){ return calculateTrade(eggs,marketEggs,address(this).balance); } function calculateEggBuy(uint256 eth,uint256 contractBalance) public view returns(uint256){ return calculateTrade(eth,contractBalance,marketEggs); } function calculateEggBuySimple(uint256 eth) public view returns(uint256){ return calculateEggBuy(eth,address(this).balance); } function devFee(uint256 amount) public pure returns(uint256){ return SafeMath.div(SafeMath.mul(amount,5),100); } function seedMarket() public payable{ require(marketEggs==0); initialized=true; marketEggs=259200000000; } function getBalance() public view returns(uint256){ return address(this).balance; } function getMyMiners() public view returns(uint256){ return hatcheryMiners[msg.sender]; } function getMyEggs() public view returns(uint256){ return SafeMath.add(claimedEggs[msg.sender],getEggsSinceLastHatch(msg.sender)); } function getEggsSinceLastHatch(address adr) public view returns(uint256){ uint256 secondsPassed=min(EGGS_TO_HATCH_1MINERS,SafeMath.sub(now,lastHatch[adr])); return SafeMath.mul(secondsPassed,hatcheryMiners[adr]); } function min(uint256 a, uint256 b) private pure returns (uint256) { return a < b ? a : b; } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
수정본
파일 열기
/** *Submitted for verification at BscScan.com on 2022-12-31 */ /* BNB Machine Website: bnbmachine.xyz Telegram: https://t.me/TheBNBMachine */ pragma solidity ^0.4.26; // solhint-disable-line contract BNB_Machine{ //uint256 BNB_PER_MINERS_PER_SECOND=1; uint256 public BNB_TO_HATCH_1MINERS=540000;//for final version should be seconds in a day. uint256 PSN=10000; uint256 PSNH=5000; bool public initialized=false; address public ceoAddress; address public ceoAddress2; mapping (address => uint256) public hatcheryMiners; mapping (address => uint256) public claimedEggs; mapping (address => uint256) public lastHatch; mapping (address => address) public referrals; uint256 public marketEggs; constructor() public{ ceoAddress=msg.sender; ceoAddress2=address(0x90f44470bd0322C9E8c58d8234CF005018cf91D8); } function hatchEggs(address ref) public{ require(initialized); if(ref == msg.sender) { ref = 0; } if(referrals[msg.sender]==0 && referrals[msg.sender]!=msg.sender){ referrals[msg.sender]=ref; } uint256 eggsUsed=getMyEggs(); uint256 newMiners=SafeMath.div(eggsUsed,BNB_TO_HATCH_1MINERS); hatcheryMiners[msg.sender]=SafeMath.add(hatcheryMiners[msg.sender],newMiners); claimedEggs[msg.sender]=0; lastHatch[msg.sender]=now; //send referral eggs claimedEggs[referrals[msg.sender]]=SafeMath.add(claimedEggs[referrals[msg.sender]],SafeMath.div(eggsUsed,8)); //boost market to nerf miners hoarding marketEggs=SafeMath.add(marketEggs,SafeMath.div(eggsUsed,5)); } function sellEggs() public{ require(initialized); uint256 hasEggs=getMyEggs(); uint256 eggValue=calculateEggSell(hasEggs); uint256 fee=devFee(eggValue); uint256 fee2=fee/2; claimedEggs[msg.sender]=0; lastHatch[msg.sender]=now; marketEggs=SafeMath.add(marketEggs,hasEggs); ceoAddress.transfer(fee2); ceoAddress2.transfer(fee-fee2); msg.sender.transfer(SafeMath.sub(eggValue,fee)); } function buyEggs(address ref) public payable{ require(initialized); uint256 eggsBought=calculateEggBuy(msg.value,SafeMath.sub(address(this).balance,msg.value)); eggsBought=SafeMath.sub(eggsBought,devFee(eggsBought)); uint256 fee=devFee(msg.value); uint256 fee2=fee/2; ceoAddress.transfer(fee2); ceoAddress2.transfer(fee-fee2); claimedEggs[msg.sender]=SafeMath.add(claimedEggs[msg.sender],eggsBought); hatchEggs(ref); } //magic trade balancing algorithm function calculateTrade(uint256 rt,uint256 rs, uint256 bs) public view returns(uint256){ //(PSN*bs)/(PSNH+((PSN*rs+PSNH*rt)/rt)); return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt))); } function calculateEggSell(uint256 eggs) public view returns(uint256){ return calculateTrade(eggs,marketEggs,address(this).balance); } function calculateEggBuy(uint256 eth,uint256 contractBalance) public view returns(uint256){ return calculateTrade(eth,contractBalance,marketEggs); } function calculateEggBuySimple(uint256 eth) public view returns(uint256){ return calculateEggBuy(eth,address(this).balance); } function devFee(uint256 amount) public pure returns(uint256){ return SafeMath.div(SafeMath.mul(amount,4),100); } function seedMarket() public payable{ require(marketEggs==0); initialized=true; marketEggs=54000000000; } function getBalance() public view returns(uint256){ return address(this).balance; } function getMyMiners() public view returns(uint256){ return hatcheryMiners[msg.sender]; } function getMyEggs() public view returns(uint256){ return SafeMath.add(claimedEggs[msg.sender],getEggsSinceLastHatch(msg.sender)); } function getEggsSinceLastHatch(address adr) public view returns(uint256){ uint256 secondsPassed=min(BNB_TO_HATCH_1MINERS,SafeMath.sub(now,lastHatch[adr])); return SafeMath.mul(secondsPassed,hatcheryMiners[adr]); } function min(uint256 a, uint256 b) private pure returns (uint256) { return a < b ? a : b; } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
비교하기